ooo-build r15412 - in trunk: . patches/dev300 patches/vba
- From: noelpwer svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r15412 - in trunk: . patches/dev300 patches/vba
- Date: Wed, 25 Feb 2009 00:24:09 +0000 (UTC)
Author: noelpwer
Date: Wed Feb 25 00:24:09 2009
New Revision: 15412
URL: http://svn.gnome.org/viewvc/ooo-build?rev=15412&view=rev
Log:
2009-02-24 Noel Power <noel power novell com>
* patches/dev300/apply: add a simple template object ( it's aware
if the document is opened from a template ( or created from a
template )
* patches/vba/vba-templateobject.diff:
Added:
trunk/patches/vba/vba-templateobject.diff
Modified:
trunk/ChangeLog
trunk/patches/dev300/apply
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Wed Feb 25 00:24:09 2009
@@ -1843,6 +1843,7 @@
vba-combobox-listindex-fix.diff, n#476891, Fong
vba-fix-copysheet-toend.diff, n#478187
vba-improve-toolbarapi-macro-search.diff
+vba-templateobject.diff
[ VBAUntested ]
SectionOwner => noelpwer
vba-basic-null.diff i#85349, jjiao
Added: trunk/patches/vba/vba-templateobject.diff
==============================================================================
--- (empty file)
+++ trunk/patches/vba/vba-templateobject.diff Wed Feb 25 00:24:09 2009
@@ -0,0 +1,396 @@
+diff --git oovbaapi/ooo/vba/word/XDocument.idl oovbaapi/ooo/vba/word/XDocument.idl
+index 32cf6d8..2502846 100644
+--- oovbaapi/ooo/vba/word/XDocument.idl
++++ oovbaapi/ooo/vba/word/XDocument.idl
+@@ -47,6 +47,7 @@ module ooo { module vba { module word {
+ interface XDocument : com::sun::star::uno::XInterface
+ {
+ [attribute, readonly] XRange Content;
++ [attribute] any AttachedTemplate;
+
+ XRange Range( [in] any Start, [in] any End );
+ any BuiltInDocumentProperties( [in] any index );
+diff --git oovbaapi/ooo/vba/word/XTemplate.idl oovbaapi/ooo/vba/word/XTemplate.idl
+new file mode 100644
+index 0000000..1913118
+--- /dev/null
++++ oovbaapi/ooo/vba/word/XTemplate.idl
+@@ -0,0 +1,54 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile:
++ * $Revision:
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org. If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++#ifndef __ooo_vba_word_XTemplate_idl__
++#define __ooo_vba_word_XTemplate_idl__
++
++#ifndef __com_sun_star_uno_XInterface_idl__
++#include <com/sun/star/uno/XInterface.idl>
++#endif
++
++#ifndef __ooo_vba_XHelperInterface_idl__
++#include <ooo/vba/XHelperInterface.idl>
++#endif
++
++module ooo { module vba { module word {
++
++interface XTemplate
++{
++ interface ooo::vba::XHelperInterface;
++
++ [attribute, readonly] string Name;
++};
++
++}; }; };
++
++#endif
++
++
+diff --git oovbaapi/ooo/vba/word/makefile.mk oovbaapi/ooo/vba/word/makefile.mk
+index 646e623..c638476 100644
+--- oovbaapi/ooo/vba/word/makefile.mk
++++ oovbaapi/ooo/vba/word/makefile.mk
+@@ -56,6 +56,7 @@ IDLFILES= XGlobals.idl\
+ XPanes.idl \
+ XOptions.idl \
+ XSelection.idl \
++ XTemplate.idl \
+
+ # ------------------------------------------------------------------
+
+diff --git sw/inc/docsh.hxx sw/inc/docsh.hxx
+index 8cc3a72..831b785 100644
+--- sw/inc/docsh.hxx
++++ sw/inc/docsh.hxx
+@@ -85,6 +85,7 @@ class SW_DLLPUBLIC SwDocShell: public SfxObjectShell, public SfxListener
+ comphelper::EmbeddedObjectContainer* pOLEChildList;
+ sal_Int16 nUpdateDocMode; // contains the com::sun::star::document::UpdateDocMode
+ bool bInUpdateFontList; //prevent nested calls of UpdateFontList
++ bool bIsATemplate; //prevent nested calls of UpdateFontList
+ // Methoden fuer den Zugriff aufs Doc
+ SW_DLLPRIVATE void AddLink();
+ SW_DLLPRIVATE void RemoveLink();
+@@ -299,6 +300,8 @@ public:
+ GetController();
+
+ SfxInPlaceClient* GetIPClient( const ::svt::EmbeddedObjectRef& xObjRef );
++ SW_DLLPRIVATE sal_Bool IsTemplate() { return bIsATemplate; }
++ SW_DLLPRIVATE void SetIsTemplate( bool bValue ) { bIsATemplate = bValue; }
+ };
+
+ class Graphic;
+diff --git sw/inc/unomap.hxx sw/inc/unomap.hxx
+index 92feb78..1e842ab 100644
+--- sw/inc/unomap.hxx
++++ sw/inc/unomap.hxx
+@@ -262,6 +262,7 @@
+ #define WID_DOC_LOCK_UPDATES 1016
+ #define WID_DOC_HAS_VALID_SIGNATURES 1017
+ #define WID_DOC_BUILDID 1024
++#define WID_DOC_ISTEMPLATEID 1025
+ // --> OD 2006-03-21 #b6375613#
+ #define WID_APPLY_WORKAROUND_FOR_B6375613 1070
+ // <--
+diff --git sw/inc/unoprnms.hxx sw/inc/unoprnms.hxx
+index 2ba5469..2aacb96 100644
+--- sw/inc/unoprnms.hxx
++++ sw/inc/unoprnms.hxx
+@@ -804,7 +804,8 @@ enum SwPropNameIds
+ /* 0734 */ UNO_NAME_CHAR_OVERLINE_COLOR,
+ /* 0735 */ UNO_NAME_CHAR_OVERLINE_HAS_COLOR,
+ /* 0736 */ UNO_NAME_OUTLINE_LEVEL, //#outline level,add<-zhaojianwei outlinelevel
+-/* 0737 */ SW_PROPNAME_END
++/* 0737 */ UNO_NAME_IS_TEMPLATE,
++/* 0738 */ SW_PROPNAME_END
+ };
+
+
+diff --git sw/source/core/unocore/unomap.cxx sw/source/core/unocore/unomap.cxx
+index abc341b..14ff14e 100644
+--- sw/source/core/unocore/unomap.cxx
++++ sw/source/core/unocore/unomap.cxx
+@@ -1703,6 +1703,7 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP
+ { SW_PROP_NMID(UNO_NAME_RECORD_CHANGES), WID_DOC_CHANGES_RECORD, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
+ { SW_PROP_NMID(UNO_NAME_SHOW_CHANGES), WID_DOC_CHANGES_SHOW, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
+ { SW_PROP_NMID(UNO_NAME_WORD_COUNT), WID_DOC_WORD_COUNT, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::READONLY, 0},
++ { SW_PROP_NMID(UNO_NAME_IS_TEMPLATE), WID_DOC_ISTEMPLATEID, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::READONLY, 0},
+ { SW_PROP_NMID(UNO_NAME_WORD_SEPARATOR), WID_DOC_WORD_SEPARATOR, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0},
+ { SW_PROP_NMID(UNO_NAME_HIDE_FIELD_TIPS), WID_DOC_HIDE_TIPS, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
+ { SW_PROP_NMID(UNO_NAME_REDLINE_DISPLAY_TYPE), WID_DOC_REDLINE_DISPLAY, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0},
+diff --git sw/source/core/unocore/unoprnms.cxx sw/source/core/unocore/unoprnms.cxx
+index cbb2d18..35a7192 100644
+--- sw/source/core/unocore/unoprnms.cxx
++++ sw/source/core/unocore/unoprnms.cxx
+@@ -778,7 +778,8 @@ const SwPropNameTab aPropNameTab = {
+ /* 0733 CHAR_OVERLINE */ {MAP_CHAR_LEN("CharOverline")},
+ /* 0734 CHAR_OVERLINE_COLOR */ {MAP_CHAR_LEN("CharOverlineColor")},
+ /* 0735 CHAR_OVERLINE_HAS_COLOR */ {MAP_CHAR_LEN("CharOverlineHasColor")},
+-/* 0736 UNO_NAME_OUTLINE_LEVEL */ {MAP_CHAR_LEN("OutlineLevel")}//#outline level,add<-zhaojianwei Outlinelevel
++/* 0736 UNO_NAME_OUTLINE_LEVEL */ {MAP_CHAR_LEN("OutlineLevel")},//#outline level,add<-zhaojianwei Outlinelevel
++/* 0737 UNO_NAME_IS_TEMPLATE */ {MAP_CHAR_LEN("IsTemplate")}
+ };
+
+ const SwPropNameLen& SwGetPropName( USHORT nId )
+diff --git sw/source/filter/ww8/ww8par.cxx sw/source/filter/ww8/ww8par.cxx
+index 714c63a..e6cca0f 100644
+--- sw/source/filter/ww8/ww8par.cxx
++++ sw/source/filter/ww8/ww8par.cxx
+@@ -3987,6 +3987,8 @@ ULONG SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
+ {
+ if (mbNewDoc && pStg && !pGloss) /*meaningless for a glossary, cmc*/
+ {
++
++ mpDocShell->SetIsTemplate( pWwFib->fDot ); // point at tgc record
+ const SvtFilterOptions* pVBAFlags = SvtFilterOptions::Get();
+ maTracer.EnterEnvironment(sw::log::eMacros);
+ // Create and insert Excel vba Globals
+diff --git sw/source/ui/uno/unotxdoc.cxx sw/source/ui/uno/unotxdoc.cxx
+index fc3b8b9..356efaf 100644
+--- sw/source/ui/uno/unotxdoc.cxx
++++ sw/source/ui/uno/unotxdoc.cxx
+@@ -2147,6 +2147,9 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName)
+ Any aAny;
+ switch(pMap->nWID)
+ {
++ case WID_DOC_ISTEMPLATEID :
++ aAny <<= pDocShell->IsTemplate();
++ break;
+ case WID_DOC_CHAR_COUNT :
+ case WID_DOC_PARA_COUNT :
+ case WID_DOC_WORD_COUNT :
+diff --git sw/source/ui/vba/makefile.mk sw/source/ui/vba/makefile.mk
+index e789fde..42a9bbc 100644
+--- sw/source/ui/vba/makefile.mk
++++ sw/source/ui/vba/makefile.mk
+@@ -69,6 +69,7 @@ SLOFILES= \
+ $(SLO)$/vbapanes.obj \
+ $(SLO)$/vbaoptions.obj \
+ $(SLO)$/vbaselection.obj \
++ $(SLO)$/vbatemplate.obj \
+
+ # --- Targets ------------------------------------------------------
+
+diff --git sw/source/ui/vba/vbadocument.cxx sw/source/ui/vba/vbadocument.cxx
+index c6b1c25..9e9fdc4 100644
+--- sw/source/ui/vba/vbadocument.cxx
++++ sw/source/ui/vba/vbadocument.cxx
+@@ -35,8 +35,12 @@
+ #include "vbavariables.hxx"
+ #include <com/sun/star/text/XBookmarksSupplier.hpp>
+ #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
++#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
+ #include <com/sun/star/document/XDocumentProperties.hpp>
+ #include <vbahelper/helperdecl.hxx>
++#include <wordvbahelper.hxx>
++#include <docsh.hxx>
++#include "vbatemplate.hxx"
+
+ using namespace ::ooo::vba;
+ using namespace ::com::sun::star;
+@@ -161,6 +165,32 @@ SwVbaDocument::getServiceImplName()
+ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaDocument") );
+ return sImplName;
+ }
++uno::Any SAL_CALL
++SwVbaDocument::getAttachedTemplate() throw (uno::RuntimeException)
++{
++ SwDocShell* pDocShell = word::getDocShell( getModel() );
++ uno::Reference< word::XTemplate > xTemplate;
++ // is this document a template
++ if ( pDocShell && pDocShell->IsTemplate() )
++ xTemplate = new SwVbaTemplate( this, mxContext, getModel(), rtl::OUString::createFromAscii("UnKnown") ); // we should be able to find the name
++ else
++ // is this document an ms document opened from a template
++ {
++ uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( getModel(), uno::UNO_QUERY_THROW );
++ uno::Reference< document::XDocumentPropertiesSupplier > xDocPropSupp( xDocInfoSupp->getDocumentInfo(), uno::UNO_QUERY_THROW );
++ uno::Reference< document::XDocumentProperties > xDocProps( xDocPropSupp->getDocumentProperties(), uno::UNO_QUERY_THROW );
++ rtl::OUString sTemplateName = xDocProps->getTemplateName();
++
++ xTemplate = new SwVbaTemplate( this, mxContext, getModel(), sTemplateName );
++ }
++ return uno::makeAny( xTemplate );
++}
++
++void SAL_CALL
++SwVbaDocument::setAttachedTemplate( const css::uno::Any& _attachedtemplate ) throw (uno::RuntimeException)
++{
++ throw uno::RuntimeException();
++}
+
+ uno::Sequence< rtl::OUString >
+ SwVbaDocument::getServiceNames()
+diff --git sw/source/ui/vba/vbadocument.hxx sw/source/ui/vba/vbadocument.hxx
+index 0f696ce..a82503b 100644
+--- sw/source/ui/vba/vbadocument.hxx
++++ sw/source/ui/vba/vbadocument.hxx
+@@ -55,6 +55,9 @@ public:
+ virtual css::uno::Any SAL_CALL CustomDocumentProperties( const css::uno::Any& index ) throw (css::uno::RuntimeException);
+ virtual css::uno::Any SAL_CALL Bookmarks( const css::uno::Any& rIndex ) throw ( css::uno::RuntimeException );
+ virtual css::uno::Any SAL_CALL Variables( const css::uno::Any& rIndex ) throw ( css::uno::RuntimeException );
++ virtual css::uno::Any SAL_CALL getAttachedTemplate() throw (css::uno::RuntimeException);
++ virtual void SAL_CALL setAttachedTemplate( const css::uno::Any& _attachedtemplate ) throw (css::uno::RuntimeException);
++
+
+ // XHelperInterface
+ virtual rtl::OUString& getServiceImplName();
+diff --git sw/source/ui/vba/vbatemplate.cxx sw/source/ui/vba/vbatemplate.cxx
+new file mode 100644
+index 0000000..11c1a59
+--- /dev/null
++++ sw/source/ui/vba/vbatemplate.cxx
+@@ -0,0 +1,70 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile:
++ * $Revision:
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org. If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++#include "vbatemplate.hxx"
++#include <vbahelper/vbahelper.hxx>
++#include "wordvbahelper.hxx"
++
++using namespace ::ooo::vba;
++using namespace ::com::sun::star;
++
++SwVbaTemplate::SwVbaTemplate( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& rModel, const rtl::OUString& rName )
++ : SwVbaTemplate_BASE( rParent, rContext ), mxModel( rModel ), msName( rName )
++{
++}
++
++
++SwVbaTemplate::~SwVbaTemplate()
++{
++}
++
++rtl::OUString
++SwVbaTemplate::getName() throw ( css::uno::RuntimeException )
++{
++ return msName;
++}
++rtl::OUString&
++SwVbaTemplate::getServiceImplName()
++{
++ static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("SwVbaTemplate") );
++ return sImplName;
++}
++
++uno::Sequence< rtl::OUString >
++SwVbaTemplate::getServiceNames()
++{
++ static uno::Sequence< rtl::OUString > aServiceNames;
++ if ( aServiceNames.getLength() == 0 )
++ {
++ aServiceNames.realloc( 1 );
++ aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Template" ) );
++ }
++ return aServiceNames;
++}
++
+diff --git sw/source/ui/vba/vbatemplate.hxx sw/source/ui/vba/vbatemplate.hxx
+new file mode 100644
+index 0000000..63a2f26
+--- /dev/null
++++ sw/source/ui/vba/vbatemplate.hxx
+@@ -0,0 +1,54 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile:
++ * $Revision:
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org. If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++#ifndef SW_VBA_TEMPLATE_HXX
++#define SW_VBA_TEMPLATE_HXX
++
++#include <ooo/vba/word/XTemplate.hpp>
++#include <vbahelper/vbahelperinterface.hxx>
++
++typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XTemplate > SwVbaTemplate_BASE;
++
++class SwVbaTemplate : public SwVbaTemplate_BASE
++{
++private:
++ css::uno::Reference< css::frame::XModel > mxModel;
++ rtl::OUString msName;
++public:
++ SwVbaTemplate( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext,
++ const css::uno::Reference< css::frame::XModel >& rModel, const rtl::OUString& );
++ virtual ~SwVbaTemplate();
++
++ // XTemplate
++ virtual rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
++ // XHelperInterface
++ virtual rtl::OUString& getServiceImplName();
++ virtual css::uno::Sequence<rtl::OUString> getServiceNames();
++};
++#endif /* SW_VBA_TEMPLATE_HXX */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]