[Libreoffice-commits] .: 5 commits - sw/inc sw/source sw/util
Noel Power
noelp at kemper.freedesktop.org
Wed Oct 13 07:25:58 PDT 2010
sw/inc/doc.hxx | 9
sw/inc/docsh.hxx | 3
sw/inc/unocoll.hxx | 6
sw/inc/unoprnms.hxx | 6
sw/inc/unotbl.hxx | 2
sw/source/core/doc/doc.cxx | 4
sw/source/core/unocore/unocoll.cxx | 239 +++++
sw/source/core/unocore/unomap.cxx | 2
sw/source/core/unocore/unoprnms.cxx | 5
sw/source/filter/ww8/makefile.mk | 2
sw/source/filter/ww8/ww8par.cxx | 332 ++++++-
sw/source/filter/ww8/ww8par.hxx | 2
sw/source/filter/ww8/ww8toolbar.cxx | 1301 +++++++++++++++++++++++++++++
sw/source/filter/ww8/ww8toolbar.hxx | 347 +++++++
sw/source/ui/app/docsh2.cxx | 48 -
sw/source/ui/uno/unotxdoc.cxx | 147 +--
sw/source/ui/vba/makefile.mk | 24
sw/source/ui/vba/service.cxx | 5
sw/source/ui/vba/vbaapplication.cxx | 11
sw/source/ui/vba/vbaapplication.hxx | 11
sw/source/ui/vba/vbaautotextentry.cxx | 31
sw/source/ui/vba/vbabookmark.cxx | 7
sw/source/ui/vba/vbabookmarks.cxx | 13
sw/source/ui/vba/vbabookmarks.hxx | 2
sw/source/ui/vba/vbaborders.cxx | 45 -
sw/source/ui/vba/vbacell.cxx | 119 ++
sw/source/ui/vba/vbacell.hxx | 67 +
sw/source/ui/vba/vbacells.cxx | 223 ++++
sw/source/ui/vba/vbacells.hxx | 75 +
sw/source/ui/vba/vbacheckbox.cxx | 97 ++
sw/source/ui/vba/vbacheckbox.hxx | 58 +
sw/source/ui/vba/vbacolumn.cxx | 200 ++++
sw/source/ui/vba/vbacolumn.hxx | 68 +
sw/source/ui/vba/vbacolumns.cxx | 160 +++
sw/source/ui/vba/vbacolumns.hxx | 75 +
sw/source/ui/vba/vbadocument.cxx | 170 +++
sw/source/ui/vba/vbadocument.hxx | 19
sw/source/ui/vba/vbadocumentproperties.cxx | 12
sw/source/ui/vba/vbafield.cxx | 157 +++
sw/source/ui/vba/vbafield.hxx | 10
sw/source/ui/vba/vbaformfield.cxx | 138 +++
sw/source/ui/vba/vbaformfield.hxx | 61 +
sw/source/ui/vba/vbaformfields.cxx | 205 ++++
sw/source/ui/vba/vbaformfields.hxx | 60 +
sw/source/ui/vba/vbaframe.cxx | 74 +
sw/source/ui/vba/vbaframe.hxx | 57 +
sw/source/ui/vba/vbaframes.cxx | 109 ++
sw/source/ui/vba/vbaframes.hxx | 61 +
sw/source/ui/vba/vbaglobals.cxx | 6
sw/source/ui/vba/vbaglobals.hxx | 17
sw/source/ui/vba/vbaheaderfooter.cxx | 7
sw/source/ui/vba/vbaheaderfooterhelper.cxx | 135 +--
sw/source/ui/vba/vbaheaderfooterhelper.hxx | 16
sw/source/ui/vba/vbaheadersfooters.cxx | 150 +++
sw/source/ui/vba/vbaheadersfooters.hxx | 62 +
sw/source/ui/vba/vbalistformat.cxx | 120 ++
sw/source/ui/vba/vbalistformat.hxx | 60 +
sw/source/ui/vba/vbalistgalleries.cxx | 115 ++
sw/source/ui/vba/vbalistgalleries.hxx | 61 +
sw/source/ui/vba/vbalistgallery.cxx | 72 +
sw/source/ui/vba/vbalistgallery.hxx | 58 +
sw/source/ui/vba/vbalisthelper.cxx | 706 +++++++++++++++
sw/source/ui/vba/vbalisthelper.hxx | 74 +
sw/source/ui/vba/vbalistlevel.cxx | 400 ++++++++
sw/source/ui/vba/vbalistlevel.hxx | 81 +
sw/source/ui/vba/vbalistlevels.cxx | 118 ++
sw/source/ui/vba/vbalistlevels.hxx | 62 +
sw/source/ui/vba/vbalisttemplate.cxx | 79 +
sw/source/ui/vba/vbalisttemplate.hxx | 60 +
sw/source/ui/vba/vbalisttemplates.cxx | 112 ++
sw/source/ui/vba/vbalisttemplates.hxx | 62 +
sw/source/ui/vba/vbaparagraph.cxx | 14
sw/source/ui/vba/vbaparagraph.hxx | 2
sw/source/ui/vba/vbaparagraphformat.cxx | 10
sw/source/ui/vba/vbarange.cxx | 183 +++-
sw/source/ui/vba/vbarange.hxx | 13
sw/source/ui/vba/vbarangehelper.cxx | 30
sw/source/ui/vba/vbarangehelper.hxx | 3
sw/source/ui/vba/vbareplacement.cxx | 6
sw/source/ui/vba/vbareplacement.hxx | 3
sw/source/ui/vba/vbarevision.cxx | 104 ++
sw/source/ui/vba/vbarevision.hxx | 60 +
sw/source/ui/vba/vbarevisions.cxx | 188 ++++
sw/source/ui/vba/vbarevisions.hxx | 66 +
sw/source/ui/vba/vbarow.cxx | 135 +++
sw/source/ui/vba/vbarow.hxx | 69 +
sw/source/ui/vba/vbarows.cxx | 368 ++++++++
sw/source/ui/vba/vbarows.hxx | 87 +
sw/source/ui/vba/vbasection.cxx | 15
sw/source/ui/vba/vbasection.hxx | 4
sw/source/ui/vba/vbasections.cxx | 13
sw/source/ui/vba/vbasections.hxx | 2
sw/source/ui/vba/vbaselection.cxx | 838 +++++++++++++++---
sw/source/ui/vba/vbaselection.hxx | 35
sw/source/ui/vba/vbastyle.cxx | 143 +++
sw/source/ui/vba/vbastyle.hxx | 20
sw/source/ui/vba/vbastyles.cxx | 157 +--
sw/source/ui/vba/vbasystem.cxx | 153 ++-
sw/source/ui/vba/vbatable.cxx | 24
sw/source/ui/vba/vbatable.hxx | 3
sw/source/ui/vba/vbatablehelper.cxx | 306 ++++++
sw/source/ui/vba/vbatablehelper.hxx | 70 +
sw/source/ui/vba/vbatableofcontents.cxx | 124 ++
sw/source/ui/vba/vbatableofcontents.hxx | 70 +
sw/source/ui/vba/vbatables.cxx | 127 ++
sw/source/ui/vba/vbatablesofcontents.cxx | 197 ++++
sw/source/ui/vba/vbatablesofcontents.hxx | 64 +
sw/source/ui/vba/vbatabstop.cxx | 62 +
sw/source/ui/vba/vbatabstop.hxx | 54 +
sw/source/ui/vba/vbatabstops.cxx | 280 ++++++
sw/source/ui/vba/vbatabstops.hxx | 65 +
sw/source/ui/vba/vbatemplate.cxx | 62 +
sw/source/ui/vba/vbatemplate.hxx | 3
sw/source/ui/vba/vbaview.cxx | 36
sw/source/ui/vba/vbawindow.cxx | 67 +
sw/source/ui/vba/vbawindow.hxx | 2
sw/source/ui/vba/wordvbahelper.cxx | 104 ++
sw/source/ui/vba/wordvbahelper.hxx | 15
sw/util/makefile.mk | 5
119 files changed, 11345 insertions(+), 628 deletions(-)
New commits:
commit d4bdfe99d56a606b6887d050c2dd9e640f48b535
Merge: 9a47f27... b80c225...
Author: Noel Power <noel.power at novell.com>
Date: Wed Oct 13 15:18:03 2010 +0100
Merge branch 'master' of ssh://noelp@git.freedesktop.org/git/libreoffice/writer
diff --cc sw/source/ui/uno/unotxdoc.cxx
index 6082257,510dc53..11ce826
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@@ -2694,10 -2668,14 +2694,14 @@@ uno::Sequence< beans::PropertyValue > S
{
// --> TL, OD 2010-09-07 #i114210#
// determine the correct page number from the renderer index
- const USHORT nPage = m_pRenderData->GetPagesToPrint()[ nRenderer ];
+ // --> OD 2010-10-01 #i114875
+ // consider brochure print
+ const USHORT nPage = bPrintProspect
+ ? nRenderer + 1
+ : m_pRenderData->GetPagesToPrint()[ nRenderer ];
// <--
-
- // get paper tray to use ...
+
+ // get paper tray to use ...
sal_Int32 nPrinterPaperTray = -1;
if (! bPrintPaperFromSetup)
{
commit 9a47f274a399fcef2160fa0c6352d1fe7b32125e
Merge: 43a6561... 14f8ec5...
Author: Noel Power <noel.power at novell.com>
Date: Wed Oct 13 13:33:33 2010 +0100
Merge commit 'origin/master'
commit 43a65612e9014e4be6ca218721d171ae51e4a6b0
Merge: abe40b1... 2b90812...
Author: Noel Power <noel.power at novell.com>
Date: Wed Oct 13 11:12:51 2010 +0100
Merge branch 'vba' fix trailing ws & tab issues
Conflicts:
sw/source/ui/app/docsh.cxx
sw/source/ui/uno/unotxdoc.cxx
diff --cc sw/inc/unotbl.hxx
index d0b4f30,7aa83d8..86804ef
--- a/sw/inc/unotbl.hxx
+++ b/sw/inc/unotbl.hxx
@@@ -337,7 -337,7 +337,7 @@@ public
SwXTextTable(SwFrmFmt& rFrmFmt);
- static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
- SW_DLLPUBLIC static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
++ SW_DLLPUBLIC static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
//XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
diff --cc sw/source/core/unocore/unocoll.cxx
index bbabfa9,e215044..42f3c13
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@@ -1,7 -1,7 +1,7 @@@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-- *
++ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@@ -87,6 -98,184 +96,184 @@@ using namespace ::com::sun::star::text
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
+ class SwVbaCodeNameProvider : public ::cppu::WeakImplHelper1< document::XCodeNameQuery >
+ {
+ SwDocShell* mpDocShell;
+ rtl::OUString msThisDocumentCodeName;
+ public:
+ SwVbaCodeNameProvider( SwDocShell* pDocShell ) : mpDocShell( pDocShell ) {}
+ // XCodeNameQuery
+ rtl::OUString SAL_CALL getCodeNameForObject( const uno::Reference< uno::XInterface >& xIf ) throw( uno::RuntimeException )
+ {
+ // Initialise the code name
+ if ( msThisDocumentCodeName.getLength() == 0 )
+ {
+ try
+ {
+ uno::Reference< beans::XPropertySet > xProps( mpDocShell->GetModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XNameAccess > xLibContainer( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BasicLibraries") ) ), uno::UNO_QUERY_THROW );
- rtl::OUString sProjectName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Standard") ) );
++ rtl::OUString sProjectName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Standard") ) );
+ if ( mpDocShell->GetBasicManager()->GetName().Len() )
+ sProjectName = mpDocShell->GetBasicManager()->GetName();
-
++
+ uno::Reference< container::XNameAccess > xLib( xLibContainer->getByName( sProjectName ), uno::UNO_QUERY_THROW );
+ uno::Sequence< rtl::OUString > sModuleNames = xLib->getElementNames();
+ uno::Reference< script::vba::XVBAModuleInfo > xVBAModuleInfo( xLib, uno::UNO_QUERY );
+
+ for ( sal_Int32 i=0; i < sModuleNames.getLength(); ++i )
+ {
+ script::ModuleInfo mInfo;
-
++
+ if ( xVBAModuleInfo->hasModuleInfo( sModuleNames[ i ] ) && xVBAModuleInfo->getModuleInfo( sModuleNames[ i ] ).ModuleType == script::ModuleType::DOCUMENT )
+ {
+ msThisDocumentCodeName = sModuleNames[ i ];
+ break;
- }
++ }
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+ rtl::OUString sCodeName;
+ if ( mpDocShell )
+ {
+ OSL_TRACE( "*** In ScVbaCodeNameProvider::getCodeNameForObject");
+ // need to find the page ( and index ) for this control
+ uno::Reference< drawing::XDrawPageSupplier > xSupplier( mpDocShell->GetModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexAccess > xIndex( xSupplier->getDrawPage(), uno::UNO_QUERY_THROW );
+ sal_Int32 nLen = xIndex->getCount();
+ bool bMatched = false;
+ uno::Sequence< script::ScriptEventDescriptor > aFakeEvents;
+ try
+ {
+ uno::Reference< form::XFormsSupplier > xFormSupplier( xIndex, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexAccess > xFormIndex( xFormSupplier->getForms(), uno::UNO_QUERY_THROW );
+ // get the www-standard container
+ uno::Reference< container::XIndexAccess > xFormControls( xFormIndex->getByIndex(0), uno::UNO_QUERY_THROW );
+ sal_Int32 nCntrls = xFormControls->getCount();
+ for( sal_Int32 cIndex = 0; cIndex < nCntrls; ++cIndex )
+ {
- uno::Reference< uno::XInterface > xControl( xFormControls->getByIndex( cIndex ), uno::UNO_QUERY_THROW );
++ uno::Reference< uno::XInterface > xControl( xFormControls->getByIndex( cIndex ), uno::UNO_QUERY_THROW );
+ bMatched = ( xControl == xIf );
+ if ( bMatched )
+ {
+ sCodeName = msThisDocumentCodeName;
+ break;
+ }
+ }
+ }
+ catch( uno::Exception& ) {}
+ }
+ // Probably should throw here ( if !bMatched )
+ return sCodeName;
+ }
+ };
+
+ typedef std::hash_map< rtl::OUString, rtl::OUString, rtl::OUStringHash > StringHashMap;
+ class SwVbaProjectNameProvider : public ::cppu::WeakImplHelper1< container::XNameContainer >
+ {
+ SwDocShell* mpDocShell;
- StringHashMap mTemplateToProject;
++ StringHashMap mTemplateToProject;
+ public:
+ SwVbaProjectNameProvider( SwDocShell* pDocShell ) : mpDocShell( pDocShell )
+ {
+ }
+ virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException )
+ {
+ return ( mTemplateToProject.find( aName ) != mTemplateToProject.end() );
+ }
+ virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+ {
+ if ( !hasByName( aName ) )
+ throw container::NoSuchElementException();
+ return uno::makeAny( mTemplateToProject.find( aName )->second );
+ }
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ uno::Sequence< rtl::OUString > aElements( mTemplateToProject.size() );
+ StringHashMap::iterator it_end = mTemplateToProject.end();
+ sal_Int32 index = 0;
+ for ( StringHashMap::iterator it = mTemplateToProject.begin(); it != it_end; ++it, ++index )
+ aElements[ index ] = it->first;
+ return aElements;
+ }
+
+ virtual void SAL_CALL insertByName( const rtl::OUString& aName, const uno::Any& aElement ) throw ( com::sun::star::lang::IllegalArgumentException, com::sun::star::container::ElementExistException, com::sun::star::lang::WrappedTargetException )
+ {
-
++
+ rtl::OUString sProjectName;
+ aElement >>= sProjectName;
+ OSL_TRACE("** Template cache inserting template name %s with project %s"
+ , rtl::OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr()
+ , rtl::OUStringToOString( sProjectName, RTL_TEXTENCODING_UTF8 ).getStr() );
+ mTemplateToProject[ aName ] = sProjectName;
+ }
+
+ virtual void SAL_CALL removeByName( const rtl::OUString& Name ) throw ( com::sun::star::container::NoSuchElementException, com::sun::star::lang::WrappedTargetException )
+ {
+ if ( !hasByName( Name ) )
+ throw container::NoSuchElementException();
+ mTemplateToProject.erase( Name );
+ }
+ virtual void SAL_CALL replaceByName( const rtl::OUString& aName, const uno::Any& aElement ) throw ( com::sun::star::lang::IllegalArgumentException, com::sun::star::container::NoSuchElementException, com::sun::star::lang::WrappedTargetException )
+ {
+ if ( !hasByName( aName ) )
+ throw container::NoSuchElementException();
+ insertByName( aName, aElement ); // insert will overwrite
+ }
+ // XElemenAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException)
- {
- return ::getCppuType((const rtl::OUString*)0);
++ {
++ return ::getCppuType((const rtl::OUString*)0);
+ }
- virtual ::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException )
- {
-
++ virtual ::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException )
++ {
++
+ return ( mTemplateToProject.size() > 0 );
+ }
+
+ };
+
+ class SwVbaObjectForCodeNameProvider : public ::cppu::WeakImplHelper1< container::XNameAccess >
+ {
+ SwDocShell* mpDocShell;
+ public:
+ SwVbaObjectForCodeNameProvider( SwDocShell* pDocShell ) : mpDocShell( pDocShell )
+ {
+ // #FIXME #TODO is the code name for ThisDocument read anywhere?
+ }
+
+ virtual ::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException )
+ {
- // #FIXME #TODO we really need to be checking against the codename for
- // ThisDocument
++ // #FIXME #TODO we really need to be checking against the codename for
++ // ThisDocument
+ if ( aName.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ThisDocument" ) ) ) )
+ return sal_True;
+ return sal_False;
+ }
+ ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+ {
+ if ( !hasByName( aName ) )
+ throw container::NoSuchElementException();
- uno::Sequence< uno::Any > aArgs( 2 );
++ uno::Sequence< uno::Any > aArgs( 2 );
+ aArgs[0] = uno::Any( uno::Reference< uno::XInterface >() );
+ aArgs[1] = uno::Any( mpDocShell->GetModel() );
+ uno::Reference< uno::XInterface > xDocObj = ooo::vba::createVBAUnoAPIServiceWithArgs( mpDocShell, "ooo.vba.word.Document" , aArgs );
+ OSL_TRACE("Creating Object ( ooo.vba.word.Document ) 0x%x", xDocObj.get() );
+ return uno::makeAny( xDocObj );
+ }
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ uno::Sequence< rtl::OUString > aNames;
+ return aNames;
+ }
+ // XElemenAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException){ return uno::Type(); }
+ virtual ::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException ) { return sal_True; }
+
+ };
+
/******************************************************************************
*
******************************************************************************/
@@@ -389,6 -582,50 +580,50 @@@ uno::Reference< uno::XInterface > SwX
xRet = (cppu::OWeakObject*)pFieldmark;
}
break;
- case SW_SERVICE_VBAOBJECTPROVIDER :
- {
- SwVbaObjectForCodeNameProvider* pObjProv = new SwVbaObjectForCodeNameProvider( pDoc->GetDocShell() );
- xRet = (cppu::OWeakObject*)pObjProv;
- }
- break;
- case SW_SERVICE_VBACODENAMEPROVIDER :
- {
- if ( pDoc->GetDocShell() && ooo::vba::isAlienWordDoc( *pDoc->GetDocShell() ) )
- {
- SwVbaCodeNameProvider* pObjProv = new SwVbaCodeNameProvider( pDoc->GetDocShell() );
- xRet = (cppu::OWeakObject*)pObjProv;
- }
- }
- break;
- case SW_SERVICE_VBAPROJECTNAMEPROVIDER :
- {
++ case SW_SERVICE_VBAOBJECTPROVIDER :
++ {
++ SwVbaObjectForCodeNameProvider* pObjProv = new SwVbaObjectForCodeNameProvider( pDoc->GetDocShell() );
++ xRet = (cppu::OWeakObject*)pObjProv;
++ }
++ break;
++ case SW_SERVICE_VBACODENAMEPROVIDER :
++ {
++ if ( pDoc->GetDocShell() && ooo::vba::isAlienWordDoc( *pDoc->GetDocShell() ) )
++ {
++ SwVbaCodeNameProvider* pObjProv = new SwVbaCodeNameProvider( pDoc->GetDocShell() );
++ xRet = (cppu::OWeakObject*)pObjProv;
++ }
++ }
++ break;
++ case SW_SERVICE_VBAPROJECTNAMEPROVIDER :
++ {
+ uno::Reference< container::XNameContainer > xProjProv = pDoc->GetVBATemplateToProjectCache();
+ if ( !xProjProv.is() && pDoc->GetDocShell() && ooo::vba::isAlienWordDoc( *pDoc->GetDocShell() ) )
+ {
- xProjProv = new SwVbaProjectNameProvider( pDoc->GetDocShell() );
++ xProjProv = new SwVbaProjectNameProvider( pDoc->GetDocShell() );
+ pDoc->SetVBATemplateToProjectCache( xProjProv );
+ }
- //xRet = (cppu::OWeakObject*)xProjProv;
- xRet = xProjProv;
- }
- break;
++ //xRet = (cppu::OWeakObject*)xProjProv;
++ xRet = xProjProv;
++ }
++ break;
+ case SW_SERVICE_VBAGLOBALS :
+ {
+ if ( pDoc )
+ {
+ uno::Any aGlobs;
+ if ( !pDoc->GetDocShell()->GetBasicManager()->GetGlobalUNOConstant( "VBAGlobals", aGlobs ) )
+ {
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[ 0 ] <<= pDoc->GetDocShell()->GetModel();
+ aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( ::rtl::OUString::createFromAscii( "ooo.vba.word.Globals"), aArgs );
+ pDoc->GetDocShell()->GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs );
+ }
+ aGlobs >>= xRet;
+ }
+ }
+ break;
+
case SW_SERVICE_TYPE_FOOTNOTE :
xRet = (cppu::OWeakObject*)new SwXFootnote(sal_False);
break;
diff --cc sw/source/core/unocore/unomap.cxx
index f5aee26,f4df212..a7e10a7
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@@ -1585,6 -1586,7 +1586,7 @@@ const SfxItemPropertyMapEntry* SwUnoPro
{ 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_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 --cc sw/source/filter/ww8/ww8par.cxx
index 6bf1b0b,90e6fa8..47d4836
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@@ -144,6 -152,87 +152,87 @@@ using namespace sw::util
using namespace sw::types;
using namespace nsHdFtFlags;
+ #include <com/sun/star/document/XEventsSupplier.hpp>
+ #include <com/sun/star/container/XNameReplace.hpp>
+ #include <com/sun/star/frame/XModel.hpp>
+ #include <filter/msfilter/msvbahelper.hxx>
+ #include <unotools/pathoptions.hxx>
+ #include <com/sun/star/ucb/XSimpleFileAccess.hpp>
+
+ class Sttb : TBBase
+ {
+ struct SBBItem
+ {
+ sal_uInt16 cchData;
- rtl::OUString data;
++ rtl::OUString data;
+ SBBItem() : cchData(0){}
+ };
+ sal_uInt16 fExtend;
+ sal_uInt16 cData;
+ sal_uInt16 cbExtra;
+
+ std::vector< SBBItem > dataItems;
+
+ Sttb(const Sttb&);
+ Sttb& operator = ( const Sttb&);
+ public:
+ Sttb();
+ ~Sttb();
+ bool Read(SvStream *pS);
+ void Print( FILE* fp );
+ rtl::OUString getStringAtIndex( sal_uInt32 );
+ };
+
+ Sttb::Sttb() : fExtend( 0 )
+ ,cData( 0 )
+ ,cbExtra( 0 )
+ {
+ }
+
+ Sttb::~Sttb()
+ {
+ }
+
+ bool Sttb::Read( SvStream* pS )
+ {
+ OSL_TRACE("Sttb::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ *pS >> fExtend >> cData >> cbExtra;
+ if ( cData )
+ {
+ for ( sal_Int32 index = 0; index < cData; ++index )
+ {
+ SBBItem aItem;
+ *pS >> aItem.cchData;
+ aItem.data = readUnicodeString( pS, aItem.cchData );
+ dataItems.push_back( aItem );
+ }
+ }
+ return true;
+ }
+
+ void Sttb::Print( FILE* fp )
+ {
+ fprintf( fp, "[ 0x%x ] Sttb - dump\n", nOffSet);
+ fprintf( fp, " fExtend 0x%x [expected 0xFFFF ]\n", fExtend );
+ fprintf( fp, " cData no. or string data items %d (0x%x)\n", cData, cData );
-
++
+ if ( cData )
+ {
+ for ( sal_Int32 index = 0; index < cData; ++index )
+ fprintf(fp," string dataItem[ %d(0x%x) ] has name %s\n", static_cast< int >( index ), static_cast< unsigned int >( index ), rtl::OUStringToOString( dataItems[ index ].data, RTL_TEXTENCODING_UTF8 ).getStr() );
+ }
+
+ }
+
-rtl::OUString
++rtl::OUString
+ Sttb::getStringAtIndex( sal_uInt32 index )
+ {
+ rtl::OUString aRet;
+ if ( index < dataItems.size() )
+ aRet = dataItems[ index ].data;
+ return aRet;
+ }
SwMSDffManager::SwMSDffManager( SwWW8ImplReader& rRdr )
: SvxMSDffManager(*rRdr.pTableStream, rRdr.GetBaseURL(), rRdr.pWwFib->fcDggInfo,
@@@ -587,10 -666,10 +676,10 @@@ SdrObject* SwMSDffManager::ProcessObj(S
{
pObj->SetMergedItemSet(aSet);
pObj->SetModel(pSdrModel);
--
++
if (bVerticalText && dynamic_cast< SdrTextObj* >( pObj ) )
dynamic_cast< SdrTextObj* >( pObj )->SetVerticalWriting(sal_True);
--
++
if ( bIsSimpleDrawingTextBox )
{
if ( nTextRotationAngle )
@@@ -609,7 -688,7 +698,7 @@@
if ( ( ( rObjData.nSpFlags & SP_FFLIPV ) || mnFix16Angle || nTextRotationAngle ) && dynamic_cast< SdrObjCustomShape* >( pObj ) )
{
SdrObjCustomShape* pCustomShape = dynamic_cast< SdrObjCustomShape* >( pObj );
--
++
double fExtraTextRotation = 0.0;
if ( mnFix16Angle && !( GetPropertyValue( DFF_Prop_FitTextToShape ) & 4 ) )
{ // text is already rotated, we have to take back the object rotation if DFF_Prop_RotateText is false
@@@ -861,13 -938,13 +950,13 @@@ long lcl_GetTrueMargin(const SvxLRSpace
// --> OD 2010-05-06 #i103711#
// --> OD 2010-05-11 #i105414#
--void SyncIndentWithList( SvxLRSpaceItem &rLR,
++void SyncIndentWithList( SvxLRSpaceItem &rLR,
const SwNumFmt &rFmt,
const bool bFirstLineOfstSet,
const bool bLeftIndentSet )
{
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
-- {
++ {
long nWantedFirstLinePos;
long nExtraListIndent = lcl_GetTrueMargin(rLR, rFmt, nWantedFirstLinePos);
rLR.SetTxtLeft(nWantedFirstLinePos - nExtraListIndent);
@@@ -875,7 -952,7 +964,7 @@@
}
else if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
-- if ( !bFirstLineOfstSet && bLeftIndentSet &&
++ if ( !bFirstLineOfstSet && bLeftIndentSet &&
rFmt.GetFirstLineIndent() != 0 )
{
rLR.SetTxtFirstLineOfst( rFmt.GetFirstLineIndent() );
@@@ -944,7 -1021,7 +1033,7 @@@ void SwWW8FltControlStack::SetAttrInDoc
pNum = GetNumFmtFromStack(*aRegion.GetPoint(),
*pTxtNode);
if (!pNum)
-- {
++ {
pNum = GetNumFmtFromTxtNode(*pTxtNode);
}
@@@ -3799,11 -3876,168 +3888,168 @@@ void SwWW8ImplReader::ReadDocInfo(
DBG_ASSERT(xDocProps.is(), "DocumentProperties is null");
if (xDocProps.is()) {
+ if ( pWwFib->fDot )
+ {
+ rtl::OUString sTemplateURL;
+ SfxMedium* pMedium = mpDocShell->GetMedium();
+ if ( pMedium )
+ {
+ rtl::OUString aName = pMedium->GetName();
+ INetURLObject aURL( aName );
+ sTemplateURL = aURL.GetMainURL(INetURLObject::DECODE_TO_IURI);
+ if ( sTemplateURL.getLength() > 0 )
+ xDocProps->setTemplateURL( sTemplateURL );
+ }
+ }
+ else // not a template
+ {
+ long nCur = pTableStream->Tell();
+ Sttb aSttb;
+ pTableStream->Seek( pWwFib->fcSttbfAssoc ); // point at tgc record
+ if (!aSttb.Read( pTableStream ) )
+ OSL_TRACE("** Read of SttbAssoc data failed!!!! ");
+ pTableStream->Seek( nCur ); // return to previous position, is that necessary?
+ #if DEBUG
+ aSttb.Print( stderr );
+ #endif
+ String sPath = aSttb.getStringAtIndex( 0x1 );
+ String aURL;
- // attempt to convert to url ( won't work for obvious reasons on linux
++ // attempt to convert to url ( won't work for obvious reasons on linux
+ if ( sPath.Len() )
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sPath, aURL );
++ ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sPath, aURL );
+ if ( aURL.Len() )
+ xDocProps->setTemplateURL( aURL );
+ else
+ xDocProps->setTemplateURL( sPath );
-
++
+ }
sfx2::LoadOlePropertySet(xDocProps, pStg);
}
}
}
+ void lcl_createTemplateToProjectEntry( const uno::Reference< container::XNameContainer >& xPrjNameCache, const rtl::OUString& sTemplatePathOrURL, const rtl::OUString& sVBAProjName )
+ {
+ if ( xPrjNameCache.is() )
+ {
+ INetURLObject aObj;
+ aObj.SetURL( sTemplatePathOrURL );
+ bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
+ rtl::OUString aURL;
+ if ( bIsURL )
+ aURL = sTemplatePathOrURL;
+ else
+ {
+ osl::FileBase::getFileURLFromSystemPath( sTemplatePathOrURL, aURL );
+ aObj.SetURL( aURL );
+ }
+ try
+ {
+ rtl::OUString templateNameWithExt = aObj.GetLastName();
+ rtl::OUString templateName;
+ sal_Int32 nIndex = templateNameWithExt.lastIndexOf( '.' );
- //xPrjNameCache->insertByName( templateNameWithExt, uno::makeAny( sVBAProjName ) );
++ //xPrjNameCache->insertByName( templateNameWithExt, uno::makeAny( sVBAProjName ) );
+ if ( nIndex != -1 )
+ {
+ templateName = templateNameWithExt.copy( 0, nIndex );
- xPrjNameCache->insertByName( templateName, uno::makeAny( sVBAProjName ) );
++ xPrjNameCache->insertByName( templateName, uno::makeAny( sVBAProjName ) );
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+ }
+
+ class WW8Customizations
+ {
+ SvStream* mpTableStream;
+ WW8Fib mWw8Fib;
+ public:
+ WW8Customizations( SvStream*, WW8Fib& );
+ bool Import( SwDocShell* pShell );
+ };
+
+ WW8Customizations::WW8Customizations( SvStream* pTableStream, WW8Fib& rFib ) : mpTableStream(pTableStream), mWw8Fib( rFib )
+ {
+ }
+
-bool WW8Customizations::Import( SwDocShell* pShell )
++bool WW8Customizations::Import( SwDocShell* pShell )
+ {
+ if ( mWw8Fib.lcbCmds == 0 )
+ return false;
+ Tcg aTCG;
+ long nCur = mpTableStream->Tell();
+ mpTableStream->Seek( mWw8Fib.fcCmds ); // point at tgc record
+ bool bReadResult = aTCG.Read( mpTableStream );
+ mpTableStream->Seek( nCur ); // return to previous position, is that necessary?
+ if ( !bReadResult )
+ {
+ OSL_TRACE("** Read of Customization data failed!!!! ");
+ return false;
+ }
+ #if DEBUG
+ aTCG.Print( stderr );
+ #endif
+ return aTCG.ImportCustomToolBar( *pShell );
+ }
+
+ bool SwWW8ImplReader::ReadGlobalTemplateSettings( const rtl::OUString& sCreatedFrom, const uno::Reference< container::XNameContainer >& xPrjNameCache )
+ {
+ SvtPathOptions aPathOpt;
+ String aAddinPath = aPathOpt.GetAddinPath();
+ uno::Sequence< rtl::OUString > sGlobalTemplates;
+
+ // first get the autoload addins in the directory STARTUP
+ uno::Reference< ucb::XSimpleFileAccess > xSFA( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW );
+
+ if( xSFA->isFolder( aAddinPath ) )
+ sGlobalTemplates = xSFA->getFolderContents( aAddinPath, sal_False );
+
+ sal_Int32 nEntries = sGlobalTemplates.getLength();
+ bool bRes = true;
+ const SvtFilterOptions* pVBAFlags = SvtFilterOptions::Get();
+ for ( sal_Int32 i=0; i<nEntries; ++i )
+ {
+ INetURLObject aObj;
+ aObj.SetURL( sGlobalTemplates[ i ] );
+ bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
+ rtl::OUString aURL;
+ if ( bIsURL )
+ aURL = sGlobalTemplates[ i ];
+ else
- osl::FileBase::getFileURLFromSystemPath( sGlobalTemplates[ i ], aURL );
++ osl::FileBase::getFileURLFromSystemPath( sGlobalTemplates[ i ], aURL );
+ if ( !aURL.endsWithIgnoreAsciiCaseAsciiL( ".dot", 4 ) || ( sCreatedFrom.getLength() && sCreatedFrom.equals( aURL ) ) )
+ continue; // don't try and read the same document as ourselves
+
- SotStorageRef rRoot = new SotStorage( aURL, STREAM_STD_READWRITE, STORAGE_TRANSACTED );
++ SotStorageRef rRoot = new SotStorage( aURL, STREAM_STD_READWRITE, STORAGE_TRANSACTED );
+
+ // Read Macro Projects
+ SvxImportMSVBasic aVBasic(*mpDocShell, *rRoot,
+ pVBAFlags->IsLoadWordBasicCode(),
+ pVBAFlags->IsLoadWordBasicStorage() );
+
+
+ String s1(CREATE_CONST_ASC("Macros"));
+ String s2(CREATE_CONST_ASC("VBA"));
+ aVBasic.Import( s1, s2, !pVBAFlags->IsLoadWordBasicExecutable() );
+ lcl_createTemplateToProjectEntry( xPrjNameCache, aURL, aVBasic.GetVBAProjectName() );
+ // Read toolbars & menus
+ SvStorageStreamRef refMainStream = rRoot->OpenSotStream( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WordDocument") ) );
+ refMainStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
- WW8Fib aWwFib( *refMainStream, 8 );
++ WW8Fib aWwFib( *refMainStream, 8 );
+ SvStorageStreamRef xTableStream = rRoot->OpenSotStream(String::CreateFromAscii( aWwFib.fWhichTblStm ? SL::a1Table : SL::a0Table), STREAM_STD_READ);
+
+ if (xTableStream.Is() && SVSTREAM_OK == xTableStream->GetError())
+ {
+ xTableStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
- WW8Customizations aGblCustomisations( xTableStream, aWwFib );
++ WW8Customizations aGblCustomisations( xTableStream, aWwFib );
+ aGblCustomisations.Import( mpDocShell );
+ }
+ }
+ return bRes;
+ }
+
ULONG SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
{
ULONG nErrRet = 0;
@@@ -4087,7 -4321,59 +4333,59 @@@
}
else //ordinary case
{
+ 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);
+ // dissable below for 3.1 at the moment, 'cause it's kinda immature
+ // similarly the project reference in svx/source/msvba
+ #if 1
+ uno::Reference< document::XDocumentInfoSupplier > xDocInfoSupp( mpDocShell->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 sCreatedFrom = xDocProps->getTemplateURL();
+ uno::Reference< container::XNameContainer > xPrjNameCache;
+ uno::Reference< lang::XMultiServiceFactory> xSF(mpDocShell->GetModel(), uno::UNO_QUERY);
+ if ( xSF.is() )
+ xPrjNameCache.set( xSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAProjectNameProvider" ) ) ), uno::UNO_QUERY );
+
- // Read Global templates
++ // Read Global templates
+ ReadGlobalTemplateSettings( sCreatedFrom, xPrjNameCache );
-#endif
++#endif
+ // Create and insert Word vba Globals
+ uno::Any aGlobs;
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[ 0 ] <<= mpDocShell->GetModel();
+ aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( ::rtl::OUString::createFromAscii( "ooo.vba.word.Globals"), aArgs );
+ mpDocShell->GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs );
-
++
+ SvxImportMSVBasic aVBasic(*mpDocShell, *pStg,
+ pVBAFlags->IsLoadWordBasicCode(),
+ pVBAFlags->IsLoadWordBasicStorage() );
+ String s1(CREATE_CONST_ASC("Macros"));
+ String s2(CREATE_CONST_ASC("VBA"));
+ int nRet = aVBasic.Import( s1, s2, !pVBAFlags->IsLoadWordBasicExecutable() );
+ // dissable below for 3.1 at the moment, 'cause it's kinda immature
+ // similarly the project reference in svx/source/msvba
+ #if 1
+ lcl_createTemplateToProjectEntry( xPrjNameCache, sCreatedFrom, aVBasic.GetVBAProjectName() );
- WW8Customizations aCustomisations( pTableStream, *pWwFib );
++ WW8Customizations aCustomisations( pTableStream, *pWwFib );
+ aCustomisations.Import( mpDocShell );
-#endif
++#endif
+ if( 2 & nRet )
+ {
+ maTracer.Log(sw::log::eContainsVisualBasic);
+ rDoc.SetContainsMSVBasic(true);
+ }
+
+ StoreMacroCmds();
+
+ maTracer.LeaveEnvironment(sw::log::eMacros);
+ }
ReadText(0, pWwFib->ccpText, MAN_MAINTEXT);
+
}
::SetProgressState(nProgress, mpDocShell); // Update
diff --cc sw/source/filter/ww8/ww8toolbar.cxx
index 0000000,e9fb6a3..d0d5a0f
mode 000000,100644..100644
--- a/sw/source/filter/ww8/ww8toolbar.cxx
+++ b/sw/source/filter/ww8/ww8toolbar.cxx
@@@ -1,0 -1,1302 +1,1301 @@@
+ #include "ww8toolbar.hxx"
+ #include <rtl/ustrbuf.hxx>
+ #include <stdarg.h>
+ #include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
+ #include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
+ #include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
+ #include <com/sun/star/lang/XMultiServiceFactory.hpp>
+ #include <com/sun/star/lang/XSingleComponentFactory.hpp>
+ #include <com/sun/star/lang/XMultiComponentFactory.hpp>
+ #include <com/sun/star/ui/XImageManager.hpp>
+ #include <com/sun/star/ui/ItemType.hpp>
+ #include <fstream>
+ #include <comphelper/processfactory.hxx>
+ #include <vcl/graph.hxx>
+ #include <map>
+ using namespace com::sun::star;
+
-// no. of visual data elements in a CTB ( fixed )
++// no. of visual data elements in a CTB ( fixed )
+ const short nVisualData = 5;
+
+ typedef std::map< sal_Int16, rtl::OUString > IdToString;
+
+ class MSOWordCommandConvertor : public MSOCommandConvertor
+ {
+ IdToString msoToOOcmd;
+ IdToString tcidToOOcmd;
+ public:
+ MSOWordCommandConvertor();
+ virtual rtl::OUString MSOCommandToOOCommand( sal_Int16 msoCmd );
+ virtual rtl::OUString MSOTCIDToOOCommand( sal_Int16 key );
+ };
+
+ MSOWordCommandConvertor::MSOWordCommandConvertor()
+ {
+ // mso command id to ooo command string
+ // #FIXME and *HUNDREDS* of id's to added here
+ msoToOOcmd[ 0x20b ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:CloseDoc") );
+ msoToOOcmd[ 0x50 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:Open") );
+
+ // mso tcid to ooo command string
+ // #FIXME and *HUNDREDS* of id's to added here
+ tcidToOOcmd[ 0x9d9 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:Print") );
+ }
+
+ rtl::OUString MSOWordCommandConvertor::MSOCommandToOOCommand( sal_Int16 key )
+ {
+ rtl::OUString sResult;
+ IdToString::iterator it = msoToOOcmd.find( key );
+ if ( it != msoToOOcmd.end() )
+ sResult = it->second;
+ return sResult;
+ }
+
+ rtl::OUString MSOWordCommandConvertor::MSOTCIDToOOCommand( sal_Int16 key )
+ {
+ rtl::OUString sResult;
+ IdToString::iterator it = tcidToOOcmd.find( key );
+ if ( it != tcidToOOcmd.end() )
+ sResult = it->second;
+ return sResult;
+ }
+
+
+ CTBWrapper::CTBWrapper( bool bReadId ) : Tcg255SubStruct( bReadId )
+ ,reserved2(0)
+ ,reserved3(0)
+ ,reserved4(0)
+ ,reserved5(0)
+ ,cbTBD(0)
+ ,cCust(0)
+ ,cbDTBC(0)
+ ,rtbdc(0)
+ {
+ }
+
+ CTBWrapper::~CTBWrapper()
+ {
+ }
+
+ Customization* CTBWrapper::GetCustomizaton( sal_Int16 index )
+ {
+ if ( index < 0 || index >= static_cast<sal_Int16>( rCustomizations.size() ) )
+ return NULL;
- return &rCustomizations[ index ];
++ return &rCustomizations[ index ];
+ }
+
+ CTB* CTBWrapper::GetCustomizationData( const rtl::OUString& sTBName )
+ {
+ CTB* pCTB = NULL;
+ for ( std::vector< Customization >::iterator it = rCustomizations.begin(); it != rCustomizations.end(); ++it )
+ {
+ if ( it->GetCustomizationData() && it->GetCustomizationData()->GetName().equals( sTBName ) )
+ {
+ pCTB = it->GetCustomizationData();
+ break;
+ }
+ }
+ return pCTB;
+ }
+
+ bool CTBWrapper::Read( SvStream* pS )
+ {
+ OSL_TRACE("CTBWrapper::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ Tcg255SubStruct::Read( pS );
+ *pS >> reserved2 >> reserved3 >> reserved4 >> reserved5;
+ *pS >> cbTBD >> cCust >> cbDTBC;
+ long nExpectedPos = pS->Tell() + cbDTBC;
+ if ( cbDTBC )
+ {
+ // cbDTBC is the size in bytes of the TBC array
+ // but the size of a TBC element is dynamic ( and this relates to TBDelta's
+ int nStart = pS->Tell();
+
+ int bytesRead = 0;
- int bytesToRead = cbDTBC - bytesRead;
++ int bytesToRead = cbDTBC - bytesRead;
+ // cbDTBC specifies the size ( in bytes ) taken by an array ( of unspecified size )
+ // of TBC records ( TBC records have dynamic length, so we need to check our position
+ // after each read )
+ do
+ {
+ TBC aTBC;
+ if ( !aTBC.Read( pS ) )
+ return false;
+ rtbdc.push_back( aTBC );
- bytesToRead = cbDTBC - ( pS->Tell() - nStart );
++ bytesToRead = cbDTBC - ( pS->Tell() - nStart );
+ } while ( bytesToRead > 0 );
+ }
+ if ( static_cast< long >( pS->Tell() ) != nExpectedPos )
+ {
+ // Strange error condition, shouldn't happen ( but does in at least
- // one test document ) In the case where it happens the TBC &
++ // one test document ) In the case where it happens the TBC &
+ // TBCHeader records seem blank??? ( and incorrect )
+ OSL_ENSURE( pS->Tell() == nExpectedPos, "### Error: Expected pos not equal to actual pos after reading rtbdc");
+ OSL_TRACE("\tPos now is 0x%x should be 0x%x", pS->Tell(), nExpectedPos );
+ // seek to correct position after rtbdc
+ pS->Seek( nExpectedPos );
+ }
+ if ( cCust )
+ {
+ for ( sal_Int32 index = 0; index < cCust; ++index )
+ {
+ Customization aCust( this );
+ if ( !aCust.Read( pS ) )
+ return false;
+ rCustomizations.push_back( aCust );
- }
- }
++ }
++ }
+ std::vector< sal_Int16 >::iterator it_end = dropDownMenuIndices.end();
+ for ( std::vector< sal_Int16 >::iterator it = dropDownMenuIndices.begin(); it != it_end; ++it )
+ {
+ rCustomizations[ *it ].bIsDroppedMenuTB = true;
+ }
+ return true;
+ }
+
+ TBC* CTBWrapper::GetTBCAtOffset( sal_uInt32 nStreamOffset )
+ {
+ for ( std::vector< TBC >::iterator it = rtbdc.begin(); it != rtbdc.end(); ++it )
+ {
+ if ( (*it).GetOffset() == nStreamOffset )
+ return &(*it);
+ }
+ return NULL;
+ }
+
+ void CTBWrapper::Print( FILE* fp )
+ {
+ Indent a;
+ indent_printf(fp,"[ 0x%x ] CTBWrapper - dump\n", nOffSet );
+ bool bRes = ( ch == 0x12 && reserved2 == 0x0 && reserved3 == 0x7 && reserved4 == 0x6 && reserved5 == 0xC );
+ if ( bRes )
+ indent_printf(fp," sanity check ( first 8 bytes conform )\n");
- else
++ else
+ {
+ indent_printf(fp," reserved1(0x%x)\n",ch);
+ indent_printf(fp," reserved2(0x%x)\n",reserved2);
+ indent_printf(fp," reserved3(0x%x)\n",reserved3);
+ indent_printf(fp," reserved4(0x%x)\n",reserved4);
+ indent_printf(fp," reserved5(0x%x)\n",reserved5);
+ indent_printf(fp,"Quiting dump");
+ return;
+ }
+ indent_printf(fp," size of TBDelta structures 0x%x\n", cbTBD );
+ indent_printf(fp," cCust: no. of cCust structures 0x%x\n",cCust);
+ indent_printf(fp," cbDTBC: no. of bytes in rtbdc array 0x%x\n", static_cast< unsigned int >( cbDTBC ));
+
+ sal_Int32 index = 0;
+
+ for ( std::vector< TBC >::iterator it = rtbdc.begin(); it != rtbdc.end(); ++it, ++index )
+ {
+ indent_printf(fp," Dumping rtbdc[%d]\n", static_cast< int >( index ));
+ Indent b;
+ it->Print( fp );
+ }
+
+ index = 0;
+
+ for ( std::vector< Customization >::iterator it = rCustomizations.begin(); it != rCustomizations.end(); ++it, ++index )
+ {
+ indent_printf(fp," Dumping custimization [%d]\n", static_cast< int >( index ));
+ Indent c;
+ it->Print(fp);
+ }
+ }
+
+ bool CTBWrapper::ImportCustomToolBar( SfxObjectShell& rDocSh )
+ {
+ for ( std::vector< Customization >::iterator it = rCustomizations.begin(); it != rCustomizations.end(); ++it )
+ {
+ uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
- uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xAppCfgSupp( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ) ) ), uno::UNO_QUERY_THROW );
++ uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xAppCfgSupp( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ) ) ), uno::UNO_QUERY_THROW );
+ CustomToolBarImportHelper helper( rDocSh, xAppCfgSupp->getUIConfigurationManager( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument" ) ) ) );
+ helper.setMSOCommandMap( new MSOWordCommandConvertor() );
+
+ if ( !(*it).ImportCustomToolBar( *this, helper ) )
+ return false;
+ }
+ return false;
+ }
+
+ Customization::Customization( CTBWrapper* wrapper ) : tbidForTBD( 0 )
+ ,reserved1( 0 )
+ , ctbds( 0 )
+ , pWrapper( wrapper )
+ , bIsDroppedMenuTB( false )
+ {
+ }
+
+ Customization::~Customization()
+ {
+ }
+
+ bool Customization::Read( SvStream *pS)
+ {
+ OSL_TRACE("Custimization::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ *pS >> tbidForTBD >> reserved1 >> ctbds;
+ if ( tbidForTBD )
+ {
+ for ( sal_Int32 index = 0; index < ctbds; ++index )
+ {
+ TBDelta aTBDelta;
+ if (!aTBDelta.Read( pS ) )
+ return false;
+ customizationDataTBDelta.push_back( aTBDelta );
+ // Only set the drop down for menu's associated with standard toolbar
+ if ( aTBDelta.ControlDropsToolBar() && tbidForTBD == 0x25 )
+ pWrapper->InsertDropIndex( aTBDelta.CustomizationIndex() );
+ }
+ }
+ else
+ {
+ customizationDataCTB.reset( new CTB() );
+ if ( !customizationDataCTB->Read( pS ) )
+ return false;
+ }
+ return true;
+ }
+
+ void Customization::Print( FILE* fp )
+ {
+ Indent a;
+ indent_printf( fp,"[ 0x%x ] Customization -- dump \n", nOffSet );
+ indent_printf( fp," tbidForTBD 0x%x ( should be 0 for CTBs )\n", static_cast< unsigned int >( tbidForTBD ));
+ indent_printf( fp," reserved1 0x%x \n", reserved1);
+ indent_printf( fp," ctbds - number of customisations %d(0x%x) \n", ctbds, ctbds );
+ if ( !tbidForTBD && !ctbds )
+ customizationDataCTB->Print( fp );
+ else
+ {
+ const char* pToolBar = NULL;
+ switch ( tbidForTBD )
+ {
+ case 0x9:
+ pToolBar = "Standard";
+ break;
+ case 0x25:
+ pToolBar = "Builtin-Menu";
+ break;
+ default:
+ pToolBar = "Unknown toolbar";
+ break;
+ }
-
++
+ indent_printf( fp," TBDelta(s) are associated with %s toolbar.\n", pToolBar);
+ std::vector< TBDelta >::iterator it = customizationDataTBDelta.begin();
+ for ( sal_Int32 index = 0; index < ctbds; ++it,++index )
+ it->Print( fp );
+ }
-
++
+ }
+
+ bool Customization::ImportMenu( CTBWrapper& rWrapper, CustomToolBarImportHelper& helper )
+ {
+ if ( tbidForTBD == 0x25 ) // we can handle in a limited way additions the built-in menu bar
+ {
+ for ( std::vector< TBDelta >::iterator it = customizationDataTBDelta.begin(); it != customizationDataTBDelta.end(); ++it )
+ {
+ // for each new menu ( control that drops a toolbar )
+ // import a toolbar
+ if ( it->ControlIsInserted() && it->ControlDropsToolBar() )
+ {
+ Customization* pCust = pWrapper->GetCustomizaton( it->CustomizationIndex() );
+ if ( pCust )
+ {
+ // currently only support built-in menu
+ rtl::OUString sMenuBar( RTL_CONSTASCII_USTRINGPARAM("private:resource/menubar/") );
+
+ sMenuBar = sMenuBar.concat( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("menubar") ) );
+ // Get menu name
+ TBC* pTBC = pWrapper->GetTBCAtOffset( it->TBCStreamOffset() );
+ if ( !pTBC )
+ return false;
+ rtl::OUString sMenuName = pTBC->GetCustomText();
+ sMenuName = sMenuName.replace('&','~');
+
+ // see if the document has already setting for the menubar
-
++
+ uno::Reference< container::XIndexContainer > xIndexContainer;
+ bool bHasSettings = false;
+ if ( helper.getCfgManager()->hasSettings( sMenuBar ) )
+ {
+ xIndexContainer.set( helper.getCfgManager()->getSettings( sMenuBar, sal_True ), uno::UNO_QUERY_THROW );
+ bHasSettings = true;
+ }
+ else
+ {
+ if ( helper.getAppCfgManager()->hasSettings( sMenuBar ) )
+ xIndexContainer.set( helper.getAppCfgManager()->getSettings( sMenuBar, sal_True ), uno::UNO_QUERY_THROW );
- else
++ else
+ xIndexContainer.set( helper.getAppCfgManager()->createSettings(), uno::UNO_QUERY_THROW );
+ }
-
++
+ uno::Reference< lang::XSingleComponentFactory > xSCF( xIndexContainer, uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+ uno::Reference< uno::XComponentContext > xContext( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), uno::UNO_QUERY_THROW );
+ // create the popup menu
+ uno::Sequence< beans::PropertyValue > aPopupMenu( 4 );
+ aPopupMenu[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CommandURL") );
+ aPopupMenu[0].Value = uno::makeAny( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("vnd.openoffice.org:") ) + sMenuName );
+ aPopupMenu[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Label") );
+ aPopupMenu[1].Value <<= sMenuName;
+ aPopupMenu[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Type" ) );
+ aPopupMenu[2].Value <<= sal_Int32( 0 );
+ aPopupMenu[3].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ItemDescriptorContainer") );
+ uno::Reference< container::XIndexContainer > xMenuContainer( xSCF->createInstanceWithContext( xContext ), uno::UNO_QUERY_THROW );
+ aPopupMenu[3].Value <<= xMenuContainer;
+ if ( pCust->customizationDataCTB.get() && !pCust->customizationDataCTB->ImportMenuTB( rWrapper, xMenuContainer, helper ) )
+ return false;
+ OSL_TRACE("** there are %d menu items on the bar, inserting after that", xIndexContainer->getCount() );
+ xIndexContainer->insertByIndex( xIndexContainer->getCount(), uno::makeAny( aPopupMenu ) );
+
+ if ( bHasSettings )
+ helper.getCfgManager()->replaceSettings( sMenuBar, uno::Reference< container::XIndexAccess >( xIndexContainer, uno::UNO_QUERY_THROW ) );
+ else
+ helper.getCfgManager()->insertSettings( sMenuBar, uno::Reference< container::XIndexAccess >( xIndexContainer, uno::UNO_QUERY_THROW ) );
+ uno::Reference< ui::XUIConfigurationPersistence > xPersistence( helper.getCfgManager(), uno::UNO_QUERY_THROW );
+ xPersistence->store();
+ }
+ }
+ }
+ return true;
+ }
+ return true;
+ }
+
+ bool Customization::ImportCustomToolBar( CTBWrapper& rWrapper, CustomToolBarImportHelper& helper )
+ {
+ if ( GetTBIDForTB() == 0x25 )
+ return ImportMenu( rWrapper, helper );
+ if ( !customizationDataCTB.get() )
+ return false;
+ if ( !customizationDataCTB->IsMenuToolbar() )
+ {
+ if ( !customizationDataCTB->ImportCustomToolBar( rWrapper, helper ) )
+ return false;
+ }
+ return true;
+ }
+
+ TBDelta::TBDelta() : doprfatendFlags(0)
+ ,ibts(0)
+ ,cidNext(0)
+ ,cid(0)
+ ,fc(0)
+ ,cbTBC(0)
+ {
+ }
+
+ bool TBDelta::ControlIsModified()
+ {
+ return ( ( doprfatendFlags & 0x3 ) == 0x2 );
+ }
+
+ bool TBDelta::ControlIsInserted()
+ {
+ return ( ( doprfatendFlags & 0x3 ) == 0x1 );
+ }
+
+ bool TBDelta::ControlIsChanged()
+ {
+ return ( ( doprfatendFlags & 0x3 ) == 0x1 );
+ }
+
+ bool TBDelta::ControlDropsToolBar()
+ {
+ return !( CiTBDE & 0x8000 );
+ }
+
+ sal_Int32 TBDelta::TBCStreamOffset()
+ {
+ return fc;
+ }
+
+ sal_Int16 TBDelta::CustomizationIndex()
+ {
+ sal_Int16 nIndex = CiTBDE;
+ nIndex = nIndex >> 1;
+ nIndex &= 0x1ff; // only 13 bits are relevant
+ return nIndex;
+ }
+
+ bool TBDelta::Read(SvStream *pS)
+ {
+ OSL_TRACE("TBDelta::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ *pS >> doprfatendFlags >> ibts >> cidNext >> cid >> fc ;
+ *pS >> CiTBDE >> cbTBC;
+ return true;
+ }
+
+ void TBDelta::Print( FILE* fp )
+ {
+ // Like most of the debug output, it's raw and little ( no )
+ // interpretation of the data is output ( e.g. flag values etc. )
+ indent_printf( fp, "[ 0x%x ] TBDelta -- dump\n", nOffSet );
+ indent_printf( fp, " doprfatendFlags 0x%x\n",doprfatendFlags );
-
++
+ indent_printf( fp, " ibts 0x%x\n",ibts );
+ indent_printf( fp, " cidNext 0x%x\n", static_cast< unsigned int >( cidNext ) );
+ indent_printf( fp, " cid 0x%x\n", static_cast< unsigned int >( cid ) );
+ indent_printf( fp, " fc 0x%x\n", static_cast< unsigned int >( fc ) );
+ indent_printf( fp, " CiTBDE 0x%x\n",CiTBDE );
+ indent_printf( fp, " cbTBC 0x%x\n", cbTBC );
+ if ( ControlDropsToolBar() )
+ {
+ indent_printf( fp, " this delta is associated with a control that drops a menu toolbar\n", cbTBC );
+ indent_printf( fp, " the menu toolbar drops the toolbar defined at index[%d] in the rCustomizations array of the CTBWRAPPER that contains this TBDelta\n", CustomizationIndex() );
+ }
+ }
+
+ CTB::CTB() : cbTBData( 0 )
+ ,iWCTBl( 0 )
+ ,reserved( 0 )
+ ,unused( 0 )
+ ,cCtls( 0 )
+ {
+ }
+
+ CTB::~CTB()
+ {
+ }
+
+ bool CTB::IsMenuToolbar()
+ {
+ return tb.IsMenuToolbar();
+ }
+
+
+ bool CTB::Read( SvStream *pS)
+ {
+ OSL_TRACE("CTB::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ if ( !name.Read( pS ) )
+ return false;
+ *pS >> cbTBData;
+ if ( !tb.Read( pS ) )
+ return false;
+ for ( short index = 0; index < nVisualData; ++index )
+ {
+ TBVisualData aVisData;
+ aVisData.Read( pS );
+ rVisualData.push_back( aVisData );
+ }
+
+ *pS >> iWCTBl >> reserved >> unused >> cCtls;
-
++
+ if ( cCtls )
+ {
+ for ( sal_Int32 index = 0; index < cCtls; ++index )
+ {
+ TBC aTBC;
+ if ( !aTBC.Read( pS ) )
+ return false;
+ rTBC.push_back( aTBC );
+ }
+ }
+ return true;
+ }
+
+ void
+ CTB::Print( FILE* fp )
+ {
+ Indent a;
+ indent_printf(fp, "[ 0x%x ] CTB - dump\n", nOffSet );
+ indent_printf(fp, " name %s\n", rtl::OUStringToOString( name.getString(), RTL_TEXTENCODING_UTF8 ).getStr() );
+ indent_printf(fp, " cbTBData size, in bytes, of this structure excluding the name, cCtls, and rTBC fields. %x\n", static_cast< unsigned int >( cbTBData ) );
-
++
+ tb.Print(fp);
+ for ( short counter = 0; counter < nVisualData; ++counter )
+ {
+ indent_printf( fp, " TBVisualData [%d]\n", counter);
+ Indent b;
+ rVisualData[ counter ].Print( fp );
- }
++ }
+ indent_printf(fp, " iWCTBl 0x%x reserved 0x%x unused 0x%x cCtls( toolbar controls ) 0x%x \n", static_cast< unsigned int >( iWCTBl ), reserved, unused, static_cast< unsigned int >( cCtls ) );
+ if ( cCtls )
+ {
+ for ( sal_Int32 index = 0; index < cCtls; ++index )
+ {
-
++
+ indent_printf(fp, " dumping toolbar control 0x%x\n", static_cast< unsigned int >( index ) );
+ rTBC[ index ].Print( fp );
+ }
+ }
+ }
+
+ bool CTB::ImportCustomToolBar( CTBWrapper& rWrapper, CustomToolBarImportHelper& helper )
+ {
+ static rtl::OUString sToolbarPrefix( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/custom_" ) );
+ bool bRes = false;
+ try
+ {
+ if ( !tb.IsEnabled() )
+ return true; // didn't fail, just ignoring
+ // Create default setting
+ uno::Reference< container::XIndexContainer > xIndexContainer( helper.getCfgManager()->createSettings(), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexAccess > xIndexAccess( xIndexContainer, uno::UNO_QUERY_THROW );
- uno::Reference< beans::XPropertySet > xProps( xIndexContainer, uno::UNO_QUERY_THROW );
-
++ uno::Reference< beans::XPropertySet > xProps( xIndexContainer, uno::UNO_QUERY_THROW );
++
+ // set UI name for toolbar
- xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UIName") ), uno::makeAny( name.getString() ) );
-
++ xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UIName") ), uno::makeAny( name.getString() ) );
++
+ rtl::OUString sToolBarName = sToolbarPrefix.concat( name.getString() );
+ for ( std::vector< TBC >::iterator it = rTBC.begin(); it != rTBC.end(); ++it )
+ {
+ // createToolBar item for control
+ if ( !it->ImportToolBarControl( rWrapper, xIndexContainer, helper, IsMenuToolbar() ) )
+ return false;
+ }
-
++
+ OSL_TRACE("Name of toolbar :-/ %s", rtl::OUStringToOString( sToolBarName, RTL_TEXTENCODING_UTF8 ).getStr() );
-
++
+ helper.getCfgManager()->insertSettings( sToolBarName, xIndexAccess );
+ helper.applyIcons();
+ #if 1 // don't think this is necessary
+ uno::Reference< ui::XUIConfigurationPersistence > xPersistence( helper.getCfgManager()->getImageManager(), uno::UNO_QUERY_THROW );
+ xPersistence->store();
+
+ xPersistence.set( helper.getCfgManager(), uno::UNO_QUERY_THROW );
+ xPersistence->store();
+ #endif
+ bRes = true;
+ }
+ catch( uno::Exception& e )
+ {
+ OSL_TRACE("***** For some reason we have an exception %s", rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ bRes = false;
+ }
+ return bRes;
+ }
+
+ bool CTB::ImportMenuTB( CTBWrapper& rWrapper, const css::uno::Reference< css::container::XIndexContainer >& xIndexContainer, CustomToolBarImportHelper& rHelper )
+ {
+ for ( std::vector< TBC >::iterator it = rTBC.begin(); it != rTBC.end(); ++it )
+ {
+ // createToolBar item for control
+ if ( !it->ImportToolBarControl( rWrapper, xIndexContainer, rHelper, true ) )
+ return false;
+ }
+ return true;
+ }
+
+ TBC::TBC()
+ {
+ }
+
+ TBC::~TBC()
+ {
+ }
+
+ bool TBC::Read( SvStream *pS )
+ {
+ OSL_TRACE("TBC::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ if ( !tbch.Read( pS ) )
+ return false;
+ if ( tbch.getTcID() != 0x1 && tbch.getTcID() != 0x1051 )
+ {
+ cid.reset( new sal_uInt32 );
+ *pS >> *cid;
+ }
+ // MUST exist if tbch.tct is not equal to 0x16
+ if ( tbch.getTct() != 0x16 )
+ {
+ tbcd.reset( new TBCData( tbch ) );
+ if ( !tbcd->Read( pS ) )
+ return false;
+ }
+ return true;
+ }
+
+ void TBC::Print( FILE* fp )
+ {
+ Indent a;
+ indent_printf(fp,"[ 0x%x ] TBC -- dump\n", nOffSet );
+ indent_printf(fp," dumping header ( TBCHeader )\n");
+ tbch.Print( fp );
+ if ( cid.get() )
+ indent_printf(fp," cid = 0x%x\n", static_cast< unsigned int >( *cid ) );
+ if ( tbcd.get() )
+ {
+ indent_printf(fp," dumping toolbar data TBCData \n");
+ tbcd->Print(fp);
+ }
+ }
+
+ bool
+ TBC::ImportToolBarControl( CTBWrapper& rWrapper, const css::uno::Reference< css::container::XIndexContainer >& toolbarcontainer, CustomToolBarImportHelper& helper, bool bIsMenuBar )
+ {
+ // cmtFci 0x1 Command based on a built-in command. See CidFci.
+ // cmtMacro 0x2 Macro command. See CidMacro.
+ // cmtAllocated 0x3 Allocated command. See CidAllocated.
+ // cmtNil 0x7 No command. See Cid.
+ bool bBuiltin = false;
+ sal_uInt16 cmdId = 0;
+ if ( cid.get() )
+ {
+ sal_uInt16 arg2 = ( *( cid.get() ) & 0xFFFF );
+
+ sal_uInt8 cmt = ( arg2 & 0x7 );
+ arg2 = ( arg2 >> 3 );
+
+ switch ( cmt )
+ {
+ case 1:
+ OSL_TRACE("cmt is cmtFci builtin command 0x%x", arg2);
+ bBuiltin = true;
+ cmdId = arg2;
+ break;
+ case 2:
+ OSL_TRACE("cmt is cmtMacro macro 0x%x", arg2);
+ break;
+ case 3:
+ OSL_TRACE("cmt is cmtAllocated [???] 0x%x", arg2);
+ break;
+ case 7:
+ OSL_TRACE("cmt is cmNill no-phing 0x%x", arg2);
+ break;
+ default:
+ OSL_TRACE("illegal 0x%x", cmt);
+ break;
+ }
+ }
+
+ if ( tbcd.get() )
+ {
+ std::vector< css::beans::PropertyValue > props;
+ if ( bBuiltin )
+ {
+ rtl::OUString sCommand = helper.MSOCommandToOOCommand( cmdId );
+ if ( sCommand.getLength() > 0 )
+ {
+ beans::PropertyValue aProp;
-
++
+ aProp.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CommandURL") );
+ aProp.Value <<= sCommand;
- props.push_back( aProp );
++ props.push_back( aProp );
+ }
+ }
+ bool bBeginGroup = false;
+ if ( ! tbcd->ImportToolBarControl( helper, props, bBeginGroup, bIsMenuBar ) )
+ return false;
+
+ TBCMenuSpecific* pMenu = tbcd->getMenuSpecific();
+ if ( pMenu )
+ {
+ OSL_TRACE("** control has a menu, name of toolbar with menu items is %s", rtl::OUStringToOString( pMenu->Name(), RTL_TEXTENCODING_UTF8 ).getStr() );
+ // search for CTB with the appropriate name ( it contains the
+ // menu items, although we cannot import ( or create ) a menu on
- // a custom toolbar we can import the menu items in a separate
++ // a custom toolbar we can import the menu items in a separate
+ // toolbar ( better than nothing )
+ CTB* pCustTB = rWrapper.GetCustomizationData( pMenu->Name() );
+ if ( pCustTB )
+ {
+ uno::Reference< container::XIndexContainer > xMenuDesc;
+ uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+ xMenuDesc.set( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.IndexedPropertyValues" ) ) ), uno::UNO_QUERY_THROW );
+ if ( !pCustTB->ImportMenuTB( rWrapper,xMenuDesc, helper ) )
- return false;
++ return false;
+ if ( !bIsMenuBar )
+ {
+ if ( !helper.createMenu( pMenu->Name(), uno::Reference< container::XIndexAccess >( xMenuDesc, uno::UNO_QUERY ), true ) )
+ return false;
+ }
+ else
+ {
+ beans::PropertyValue aProp;
+ aProp.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ItemDescriptorContainer") );
+ aProp.Value <<= xMenuDesc;
+ props.push_back( aProp );
+ }
- }
++ }
+ }
+
+ if ( bBeginGroup )
+ {
+ // insert spacer
+ uno::Sequence< beans::PropertyValue > sProps( 1 );
+ sProps[ 0 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Type") );
- sProps[ 0 ].Value = uno::makeAny( ui::ItemType::SEPARATOR_LINE );
- toolbarcontainer->insertByIndex( toolbarcontainer->getCount(), uno::makeAny( sProps ) );
++ sProps[ 0 ].Value = uno::makeAny( ui::ItemType::SEPARATOR_LINE );
++ toolbarcontainer->insertByIndex( toolbarcontainer->getCount(), uno::makeAny( sProps ) );
+ }
-
++
+ uno::Sequence< beans::PropertyValue > sProps( props.size() );
+ beans::PropertyValue* pProp = sProps.getArray();
-
++
+ for ( std::vector< css::beans::PropertyValue >::iterator it = props.begin(); it != props.end(); ++it, ++pProp )
+ *pProp = *it;
+
- toolbarcontainer->insertByIndex( toolbarcontainer->getCount(), uno::makeAny( sProps ) );
++ toolbarcontainer->insertByIndex( toolbarcontainer->getCount(), uno::makeAny( sProps ) );
+ }
+ return true;
+ }
+
-rtl::OUString
++rtl::OUString
+ TBC::GetCustomText()
+ {
+ rtl::OUString sCustomText;
+ if ( tbcd.get() )
+ sCustomText = tbcd->getGeneralInfo().CustomText();
+ return sCustomText;
-
-
++
++
+ }
+
-bool
++bool
+ Xst::Read( SvStream* pS )
+ {
+ OSL_TRACE("Xst::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ sal_Int16 nChars = 0;
+ *pS >> nChars;
+ sString = readUnicodeString( pS, static_cast< sal_Int32 >( nChars ) );
+ return true;
+ }
+
+ void
+ Xst::Print( FILE* fp )
+ {
+ Indent a;
+ indent_printf( fp, "[ 0x%x ] Xst -- dump\n", nOffSet );
+ indent_printf( fp, " %s", rtl::OUStringToOString( sString, RTL_TEXTENCODING_UTF8 ).getStr() );
+ }
+
+ Tcg::Tcg() : nTcgVer( 255 )
+ {
+ }
+
+ bool Tcg::Read(SvStream *pS)
+ {
+ OSL_TRACE("Tcg::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ *pS >> nTcgVer;
+ if ( nTcgVer != (sal_Int8)255 )
+ return false;
+ tcg.reset( new Tcg255() );
+ return tcg->Read( pS );
+ }
+
+ void Tcg::Print( FILE* fp )
+ {
+ Indent a(true);
+ indent_printf(fp, "[ 0x%x ] Tcg - dump %d\n", nOffSet, nTcgVer);
+ indent_printf(fp," nTcgVer %d\n", nTcgVer);
+ if ( tcg.get() )
+ tcg->Print( fp );
+ }
+
+ bool Tcg::ImportCustomToolBar( SfxObjectShell& rDocSh )
+ {
+ if ( tcg.get() )
+ return tcg->ImportCustomToolBar( rDocSh );
+ return false;
+ }
+
+ Tcg255::Tcg255()
+ {
+ }
+
+ Tcg255::~Tcg255()
+ {
+ std::vector< Tcg255SubStruct* >::iterator it = rgtcgData.begin();
+ for ( ; it != rgtcgData.end(); ++it )
+ delete *it;
+ }
+
+ bool Tcg255::processSubStruct( sal_uInt8 nId, SvStream *pS )
+ {
+ Tcg255SubStruct* pSubStruct = NULL;
+ switch ( nId )
+ {
+ case 0x1:
+ {
+ pSubStruct = new PlfMcd( false ); // don't read the id
+ break;
+ }
- case 0x2:
++ case 0x2:
+ {
+ pSubStruct = new PlfAcd( false );
+ break;
+ }
- case 0x3:
- case 0x4:
++ case 0x3:
++ case 0x4:
+ {
+ pSubStruct = new PlfKme( false );
+ break;
+ }
- case 0x10:
++ case 0x10:
+ {
+ pSubStruct = new TcgSttbf( false );
+ break;
+ }
- case 0x11:
++ case 0x11:
+ {
+ pSubStruct = new MacroNames( false );
+ break;
+ }
- case 0x12:
++ case 0x12:
+ {
+ pSubStruct = new CTBWrapper( false );
+ break;
+ }
+ default:
+ OSL_TRACE("Unknown id 0x%x",nId);
+ return false;
+ }
+ pSubStruct->ch = nId;
+ if ( !pSubStruct->Read( pS ) )
+ return false;
+ rgtcgData.push_back( pSubStruct );
+ return true;
+ }
+
+ bool Tcg255::ImportCustomToolBar( SfxObjectShell& rDocSh )
+ {
+ // Find the CTBWrapper
+ for ( std::vector< Tcg255SubStruct* >::const_iterator it = rgtcgData.begin(); it != rgtcgData.end(); ++it )
+ {
+ if ( (*it)->id() == 0x12 )
+ {
- // not so great, shouldn't really have to do a horror casting
++ // not so great, shouldn't really have to do a horror casting
+ CTBWrapper* pCTBWrapper = dynamic_cast< CTBWrapper* > ( *it );
+ if ( pCTBWrapper )
+ {
+ if ( !pCTBWrapper->ImportCustomToolBar( rDocSh ) )
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+
+ bool Tcg255::Read(SvStream *pS)
+ {
+ OSL_TRACE("Tcg255::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
- sal_uInt8 nId = 0; //
++ sal_uInt8 nId = 0; //
+ *pS >> nId;
+ while ( nId != 0x40 )
+ {
+ if ( !processSubStruct( nId, pS ) )
+ return false;
+ *pS >> nId;
- }
++ }
+ return true;
- // Peek at
++ // Peek at
+ }
+
+ void Tcg255::Print( FILE* fp)
+ {
+ Indent a;
+ indent_printf(fp, "[ 0x%x ] Tcg255 - dump\n", nOffSet );
+ indent_printf(fp, " contains %d sub records\n", rgtcgData.size() );
- std::vector< Tcg255SubStruct* >::iterator it = rgtcgData.begin();
- std::vector< Tcg255SubStruct* >::iterator it_end = rgtcgData.end();
-
++ std::vector< Tcg255SubStruct* >::iterator it = rgtcgData.begin();
++ std::vector< Tcg255SubStruct* >::iterator it_end = rgtcgData.end();
++
+ for( sal_Int32 count = 1; it != it_end ; ++it, ++count )
+ {
+ Indent b;
+ indent_printf(fp, " [%d] Tcg255SubStruct \n", static_cast< unsigned int >( count ) );
+ (*it)->Print(fp);
+ }
+ }
+
+
+ Tcg255SubStruct::Tcg255SubStruct( bool bReadId ) : mbReadId( bReadId ), ch(0)
+ {
+ }
+
+ bool Tcg255SubStruct::Read(SvStream *pS)
+ {
+ OSL_TRACE("Tcg255SubStruct::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ if ( mbReadId )
+ *pS >> ch;
+ return true;
+ }
+
+ PlfMcd::PlfMcd( bool bReadId ): Tcg255SubStruct( bReadId ), rgmcd( NULL )
+ {
+ }
+ PlfMcd::~PlfMcd()
+ {
+ if ( rgmcd )
+ delete[] rgmcd;
+ }
+
+ bool PlfMcd::Read(SvStream *pS)
+ {
+ OSL_TRACE("PffMcd::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ Tcg255SubStruct::Read( pS );
+ *pS >> iMac;
+ if ( iMac )
- {
++ {
+ rgmcd = new MCD[ iMac ];
+ for ( sal_Int32 index = 0; index < iMac; ++index )
+ {
+ if ( !rgmcd[ index ].Read( pS ) )
- return false;
- }
++ return false;
++ }
+ }
+ return true;
+ }
+
+ void PlfMcd::Print( FILE* fp )
+ {
+ Indent a;
+ indent_printf(fp, "[ 0x%x ] PlfMcd ( Tcg255SubStruct ) - dump\n", nOffSet );
+ indent_printf(fp, " contains %d MCD records\n", static_cast<int>( iMac ) );
+ for ( sal_Int32 count=0; count < iMac; ++count )
+ {
+ Indent b;
+ indent_printf(fp, "[%d] MCD\n", static_cast< int >( count ) );
+ rgmcd[ count ].Print( fp );
+ }
-
++
+ }
+
+ PlfAcd::PlfAcd( bool bReadId ) : Tcg255SubStruct( bReadId )
+ ,iMac(0)
+ ,rgacd(NULL)
+ {
+ }
+
+
+ PlfAcd::~PlfAcd()
+ {
+ if ( rgacd )
+ delete[] rgacd;
+ }
+
+ bool PlfAcd::Read( SvStream *pS)
+ {
+ OSL_TRACE("PffAcd::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ Tcg255SubStruct::Read( pS );
+ *pS >> iMac;
+ if ( iMac )
+ {
+ rgacd = new Acd[ iMac ];
+ for ( sal_Int32 index = 0; index < iMac; ++index )
+ {
- if ( !rgacd[ index ].Read( pS ) )
++ if ( !rgacd[ index ].Read( pS ) )
+ return false;
+ }
+ }
+ return true;
+ }
+ void PlfAcd::Print( FILE* fp )
+ {
+ Indent a;
+ indent_printf(fp, "[ 0x%x ] PlfAcd ( Tcg255SubStruct ) - dump\n", nOffSet );
+ indent_printf(fp, " contains %d ACD records\n", static_cast< int >( iMac ) );
+ for ( sal_Int32 count=0; count < iMac; ++count )
+ {
+ Indent b;
+ indent_printf(fp, "[%d] ACD\n", static_cast< int >( count ) );
+ rgacd[ count ].Print( fp );
+ }
-
++
+ }
+
+ PlfKme::PlfKme( bool bReadId ) : Tcg255SubStruct( bReadId )
+ ,iMac( 0 )
+ ,rgkme( NULL )
+ {
+ }
+
+ PlfKme::~PlfKme()
+ {
+ if ( rgkme )
+ delete[] rgkme;
+ }
+
+ bool PlfKme::Read(SvStream *pS)
+ {
+ OSL_TRACE("PlfKme::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ Tcg255SubStruct::Read( pS );
+ *pS >> iMac;
+ if ( iMac )
+ {
+ rgkme = new Kme[ iMac ];
+ for( sal_Int32 index=0; index<iMac; ++index )
+ {
+ if ( !rgkme[ index ].Read( pS ) )
+ return false;
+ }
+ }
+ return true;
+ }
-
++
+ void PlfKme::Print( FILE* fp )
+ {
+ Indent a;
+ indent_printf(fp, "[ 0x%x ] PlfKme ( Tcg255SubStruct ) - dump\n", nOffSet );
+ indent_printf(fp, " contains %d Kme records\n", static_cast< int >( iMac ) );
+ for ( sal_Int32 count=0; count < iMac; ++count )
+ {
+ Indent b;
+ indent_printf(fp, "[%d] Kme\n", static_cast< int >( count ) );
+ rgkme[ count ].Print( fp );
+ }
-
++
+ }
+
+ TcgSttbf::TcgSttbf( bool bReadId ) : Tcg255SubStruct( bReadId )
+ {
+ }
+
-bool TcgSttbf::Read( SvStream *pS)
++bool TcgSttbf::Read( SvStream *pS)
+ {
+ OSL_TRACE("TcgSttbf::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ Tcg255SubStruct::Read( pS );
+ return sttbf.Read( pS );
+ }
+
+ void TcgSttbf::Print( FILE* fp )
+ {
+ Indent a;
+ indent_printf(fp,"[ 0x%x ] TcgSttbf - dump\n", nOffSet );
+ sttbf.Print( fp );
+ }
+
+ TcgSttbfCore::TcgSttbfCore() : fExtend( 0 )
+ ,cData( 0 )
+ ,cbExtra( 0 )
+ ,dataItems( NULL )
+ {
+ }
+
+ TcgSttbfCore::~TcgSttbfCore()
+ {
+ if ( dataItems )
+ delete[] dataItems;
+ }
+
+ bool TcgSttbfCore::Read( SvStream* pS )
+ {
+ OSL_TRACE("TcgSttbfCore::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ *pS >> fExtend >> cData >> cbExtra;
+ if ( cData )
+ {
+ dataItems = new SBBItem[ cData ];
+ for ( sal_Int32 index = 0; index < cData; ++index )
+ {
+ *pS >> dataItems[ index ].cchData;
+ dataItems[ index ].data = readUnicodeString( pS, dataItems[ index ].cchData );
+ *pS >> dataItems[ index ].extraData;
+ }
+ }
+ return true;
+ }
+
+ void TcgSttbfCore::Print( FILE* fp )
+ {
+ Indent a;
+ indent_printf( fp, "[ 0x%x ] TcgSttbfCore - dump\n");
+ indent_printf( fp, " fExtend 0x%x [expected 0xFFFF ]\n", fExtend );
+ indent_printf( fp, " cbExtra 0x%x [expected 0x02 ]\n", cbExtra );
+ indent_printf( fp, " cData no. or string data items %d (0x%x)\n", cData, cData );
-
++
+ if ( cData )
+ {
+ for ( sal_Int32 index = 0; index < cData; ++index )
+ indent_printf(fp," string dataItem[ %d(0x%x) ] has name %s and if referenced %d times.\n", static_cast< int >( index ), static_cast< unsigned int >( index ), rtl::OUStringToOString( dataItems[ index ].data, RTL_TEXTENCODING_UTF8 ).getStr(), dataItems[ index ].extraData );
+ }
+
+ }
+ MacroNames::MacroNames( bool bReadId ) : Tcg255SubStruct( bReadId )
+ ,iMac( 0 )
+ ,rgNames( NULL )
+ {
+ }
+
+ MacroNames::~MacroNames()
+ {
+ if ( rgNames )
+ delete[] rgNames;
+ }
+
+ bool MacroNames::Read( SvStream *pS)
+ {
+ OSL_TRACE("MacroNames::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ Tcg255SubStruct::Read( pS );
+ *pS >> iMac;
+ if ( iMac )
+ {
- rgNames = new MacroName[ iMac ];
++ rgNames = new MacroName[ iMac ];
+ for ( sal_Int32 index = 0; index < iMac; ++index )
+ {
+ if ( !rgNames[ index ].Read( pS ) )
+ return false;
+ }
+ }
+ return true;
+ }
+
+ void MacroNames::Print( FILE* fp )
+ {
+ Indent a;
+ indent_printf(fp, "[ 0x%x ] MacroNames ( Tcg255SubStruct ) - dump\n");
+ indent_printf(fp, " contains %d MacroName records\n", iMac );
+ for ( sal_Int32 count=0; count < iMac; ++count )
+ {
+ Indent b;
+ indent_printf(fp, "[%d] MacroName\n", static_cast<int>( count ) );
+ rgNames[ count ].Print( fp );
+ }
-
++
+ }
+
+ MacroName::MacroName():ibst(0)
+ {
+ }
+
+
+ bool MacroName::Read(SvStream *pS)
+ {
+ OSL_TRACE("MacroName::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ *pS >> ibst;
+ return xstz.Read( pS );
+ }
+
+ void MacroName::Print( FILE* fp )
+ {
+ Indent a;
+ indent_printf( fp, "[ 0x%x ] MacroName - dump");
+ indent_printf( fp," index - 0x%x has associated following record\n", ibst );
+ xstz.Print( fp );
+ }
+
+
+
+ Xstz::Xstz():chTerm(0)
+ {
+ }
+
-bool
++bool
+ Xstz::Read(SvStream *pS)
+ {
+ OSL_TRACE("Xstz::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ if ( !xst.Read( pS ) )
+ return false;
+ *pS >> chTerm;
- if ( chTerm != 0 ) // should be an assert
++ if ( chTerm != 0 ) // should be an assert
+ return false;
+ return true;
+ }
+
+ void Xstz::Print( FILE* fp )
+ {
+ Indent a;
+ indent_printf(fp,"[ 0x%x ] Xstz -- dump\n", nOffSet );
+ indent_printf(fp," Xst\n");
- xst.Print( fp );
++ xst.Print( fp );
+ indent_printf(fp," chterm 0x%x ( should be zero )\n", chTerm);
+ }
+
+ Kme::Kme() : reserved1(0)
+ ,reserved2(0)
+ ,kcm1(0)
+ ,kcm2(0)
+ ,kt(0)
+ ,param(0)
+ {
+ }
+
+ Kme::~Kme()
+ {
+ }
+
+ bool
+ Kme::Read(SvStream *pS)
+ {
+ OSL_TRACE("Kme::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ *pS >> reserved1 >> reserved2 >> kcm1 >> kcm2 >> kt >> param;
+ return true;
+ }
+
+ void Kme::Print( FILE* fp )
+ {
+ Indent a;
-
++
+ indent_printf( fp, "[ 0x%x ] Kme - dump\n", nOffSet );
+ indent_printf( fp, " reserved1 0x%x [expected 0x0 ]\n", reserved1 );
+ indent_printf( fp, " reserved2 0x%x [expected 0x0 ]\n", reserved2 );
+ indent_printf( fp, " kcm1 0x%x [shortcut key]\n", kcm1 );
+ indent_printf( fp, " kcm2 0x%x [shortcut key]\n", kcm2 );
+ indent_printf( fp, " kt 0x%x \n", kt );
+ indent_printf( fp, " param 0x%x \n", static_cast< unsigned int >( param ) );
+ }
+
+ Acd::Acd() : ibst( 0 )
+ , fciBasedOnABC( 0 )
+ {
+ }
+
+ bool Acd::Read(SvStream *pS)
+ {
+ OSL_TRACE("Acd::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ *pS >> ibst >> fciBasedOnABC;
+ return true;
+ }
+
+ void Acd::Print( FILE* fp )
+ {
+ Indent a;
+ indent_printf( fp,"[ 0x%x ] ACD - dump\n", nOffSet );
+ // #TODO flesh out interpretation of these values
+ indent_printf( fp," ibst 0x%x\n", ibst);
+ indent_printf( fp," fciBaseObABC 0x%x\n", fciBasedOnABC);
+ }
+
+ MCD::MCD() : reserved1(0x56)
+ ,reserved2( 0 )
+ ,ibst( 0 )
+ ,ibstName( 0 )
+ ,reserved3( 0xFFFF )
+ ,reserved4( 0 )
+ ,reserved5( 0 )
+ ,reserved6( 0 )
+ ,reserved7( 0 )
+ {
+ }
+
+ bool MCD::Read(SvStream *pS)
+ {
+ OSL_TRACE("MCD::Read() stream pos 0x%x", pS->Tell() );
+ nOffSet = pS->Tell();
+ *pS >> reserved1 >> reserved2 >> ibst >> ibstName >> reserved3;
+ *pS >> reserved4 >> reserved5 >> reserved6 >> reserved7;
+ return true;
+ }
+
+ void MCD::Print( FILE* fp )
+ {
+ Indent a;
+ indent_printf( fp, "[ 0x%x ] MCD - dump\n", nOffSet );
+ indent_printf( fp, " reserved1 0x%x [expected 0x56 ]\n", reserved1 );
+ indent_printf( fp, " reserved2 0x%x [expected 0x0 ]\n", reserved2 );
+ indent_printf( fp, " ibst 0x%x specifies macro with MacroName.xstz = 0x%x\n", ibst, ibst );
+ indent_printf( fp, " ibstName 0x%x index into command string table ( TcgSttbf.sttbf )\n", ibstName );
+
+ indent_printf( fp, " reserved3 0x%x [expected 0xFFFF ]\n", reserved3 );
+ indent_printf( fp, " reserved4 0x%x\n", static_cast< unsigned int >( reserved4 ) );
+ indent_printf( fp, " reserved5 0x%x [expected 0x0 ]\n", static_cast< unsigned int >( reserved5 ) );
+ indent_printf( fp, " reserved6 0x%x\n", static_cast< unsigned int >( reserved6 ) );
+ indent_printf( fp, " reserved7 0x%x\n", static_cast< unsigned int >( reserved7 ) );
+ }
-
diff --cc sw/source/filter/ww8/ww8toolbar.hxx
index 0000000,a8b3342..d89789b
mode 000000,100644..100644
--- a/sw/source/filter/ww8/ww8toolbar.hxx
+++ b/sw/source/filter/ww8/ww8toolbar.hxx
@@@ -1,0 -1,347 +1,347 @@@
+ #ifndef _WW8TOOLBAR_HXX
+ #define _WW8TOOLBAR_HXX
+
+ #include <filter/msfilter/mstoolbar.hxx>
+
+ namespace css = ::com::sun::star;
+
+ class Xst : public TBBase
+ {
+ rtl::OUString sString;
+ public:
+ Xst(){}
+ bool Read(SvStream *pS);
+ rtl::OUString getString() { return sString; }
+ void Print( FILE* fp );
+ };
+
+ class CTBWrapper;
+ class TBC : public TBBase
+ {
+ TBCHeader tbch;
+ boost::shared_ptr< sal_uInt32 > cid; // optional
+ boost::shared_ptr<TBCData> tbcd;
+ public:
+ TBC();
+ ~TBC();
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ bool ImportToolBarControl( CTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper&, bool );
+ rtl::OUString GetCustomText();
+ };
+
+ class CTB : public TBBase
+ {
+ Xst name;
+ sal_Int32 cbTBData;
+ TB tb;
+ std::vector<TBVisualData> rVisualData;
+ sal_Int32 iWCTBl;
+ sal_uInt16 reserved;
+ sal_uInt16 unused;
+ sal_Int32 cCtls;
+ std::vector< TBC > rTBC;
+
+ CTB(const CTB&);
+ CTB& operator = ( const CTB&);
+ public:
+ CTB();
+ ~CTB();
+ bool Read(SvStream *pS);
+ void Print( FILE* fp );
+ bool IsMenuToolbar();
+ bool ImportCustomToolBar( CTBWrapper&, CustomToolBarImportHelper& );
+ bool ImportMenuTB( CTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
+ rtl::OUString GetName() { return tb.getName().getString(); }
+ };
+
+ class TBDelta : public TBBase
+ {
+ sal_uInt8 doprfatendFlags;
+
+ sal_uInt8 ibts;
- sal_Int32 cidNext;
++ sal_Int32 cidNext;
+ sal_Int32 cid;
+ sal_Int32 fc;
+ sal_uInt16 CiTBDE; // careful of this ( endian matters etc. )
+ sal_uInt16 cbTBC;
+ public:
+ TBDelta();
+ ~TBDelta(){}
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ bool ControlIsModified();
+ bool ControlIsInserted();
+ bool ControlIsChanged();
+ bool ControlDropsToolBar();
+ sal_Int32 TBCStreamOffset();
+ sal_Int16 CustomizationIndex();
-
++
+ };
+
+ class Tcg255SubStruct : public TBBase
+ {
+ friend class Tcg255;
+ bool mbReadId;
+ Tcg255SubStruct(const Tcg255SubStruct&);
+ Tcg255SubStruct& operator = ( const Tcg255SubStruct&);
+ protected:
+ sal_uInt8 ch;
+ public:
+ Tcg255SubStruct( bool bReadId );
+ ~Tcg255SubStruct(){}
+ virtual sal_uInt8 id() const { return ch; }
+ bool Read(SvStream *pS);
+ };
+
+ class CTBWrapper;
+ class Customization : public TBBase
+ {
+ friend class CTBWrapper;
+ sal_Int32 tbidForTBD;
+ sal_uInt16 reserved1;
+ sal_Int16 ctbds;
+ CTBWrapper* pWrapper;
+ boost::shared_ptr< CTB > customizationDataCTB;
- std::vector< TBDelta > customizationDataTBDelta;
- bool bIsDroppedMenuTB;
++ std::vector< TBDelta > customizationDataTBDelta;
++ bool bIsDroppedMenuTB;
+ bool ImportMenu( CTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& );
-public:
++public:
+ Customization( CTBWrapper* rapper );
+ ~Customization();
+ bool Read(SvStream *pS);
+ bool ImportCustomToolBar( CTBWrapper&, CustomToolBarImportHelper& );
+ bool ImportMenu( CTBWrapper&, CustomToolBarImportHelper& );
+ void Print( FILE* );
+ sal_Int32 GetTBIDForTB(){ return tbidForTBD; }
+ CTB* GetCustomizationData() { return customizationDataCTB.get(); };
+ };
+
-class SfxObjectShell;
++class SfxObjectShell;
+
+ class CTBWrapper : public Tcg255SubStruct
+ {
+ // reserved1 is the ch field of Tcg255SubStruct
+ sal_uInt16 reserved2;
+ sal_uInt8 reserved3;
+ sal_uInt16 reserved4;
+ sal_uInt16 reserved5;
+
+ sal_Int16 cbTBD;
+ sal_Int16 cCust;
+
+ sal_Int32 cbDTBC;
+
- std::vector< TBC > rtbdc; //
++ std::vector< TBC > rtbdc; //
+ std::vector< Customization > rCustomizations; // array of Customizations
+ std::vector< sal_Int16 > dropDownMenuIndices; // array of indexes of Customization toolbars that are dropped by a menu
+ CTBWrapper(const CTBWrapper&);
+ CTBWrapper& operator = ( const CTBWrapper&);
+ public:
+ CTBWrapper( bool bReadId = true );
+ ~CTBWrapper();
+ void InsertDropIndex( sal_Int32 aIndex ) { dropDownMenuIndices.push_back( aIndex ); }
+ TBC* GetTBCAtOffset( sal_uInt32 nStreamOffset );
+ bool Read(SvStream *pS);
+ bool ImportCustomToolBar( SfxObjectShell& rDocSh );
+
+ Customization* GetCustomizaton( sal_Int16 index );
+ CTB* GetCustomizationData( const rtl::OUString& name );
+ void Print( FILE* );
+ };
+
+ class MCD : public TBBase
+ {
- sal_Int8 reserved1; // A signed integer that MUST be 0x56.
++ sal_Int8 reserved1; // A signed integer that MUST be 0x56.
+ sal_uInt8 reserved2; // MUST be 0.
+ sal_uInt16 ibst; // Unsigned integer that specifies the name of the macro. Macro name is specified by MacroName.xstz of the MacroName entry in the MacroNames such that MacroName.ibst equals ibst. MacroNames MUST contain such an entry.
+ sal_uInt16 ibstName; // An unsigned integer that specifies the index into the Command String Table (TcgSttbf.sttbf) where the macroâs name and arguments are specified.
+ sal_uInt16 reserved3; // An unsigned integer that MUST be 0xFFFF.
- sal_uInt32 reserved4; //MUST be ignored.
- sal_uInt32 reserved5; //MUST be 0.
- sal_uInt32 reserved6; //MUST be ignored.
- sal_uInt32 reserved7; //MUST be ignored
++ sal_uInt32 reserved4; //MUST be ignored.
++ sal_uInt32 reserved5; //MUST be 0.
++ sal_uInt32 reserved6; //MUST be ignored.
++ sal_uInt32 reserved7; //MUST be ignored
+
+ MCD(const MCD&);
+ MCD& operator = ( const MCD&);
+ public:
+ MCD();
+ ~MCD(){}
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ };
+
+ class PlfMcd : public Tcg255SubStruct
+ {
+ sal_Int32 iMac;
+ MCD* rgmcd; // array of MCD's
+ PlfMcd(const PlfMcd&);
+ PlfMcd& operator = ( const PlfMcd&);
+ public:
+ PlfMcd( bool bReadId = true );
+ ~PlfMcd();
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ };
+
+ class Acd : public TBBase
+ {
+ sal_Int16 ibst;
+ sal_uInt16 fciBasedOnABC; // fciBasedOn(13 bits) A(1bit)B(1bit)C(1Bit)
+ Acd(const Acd&);
+ Acd& operator = ( const Acd&);
+ public:
+ Acd();
+ ~Acd(){}
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ };
+
+ class PlfAcd: public Tcg255SubStruct
+ {
+ sal_Int32 iMac;
+ Acd* rgacd;
+ PlfAcd(const PlfAcd&);
+ PlfAcd& operator = ( const PlfAcd&);
+ public:
+ PlfAcd( bool bReadId = true );
+ ~PlfAcd();
+ bool Read(SvStream *pS);
+ void Print(FILE*);
+ };
+
+ class Kme : public TBBase
+ {
- sal_Int16 reserved1; //MUST be zero.
++ sal_Int16 reserved1; //MUST be zero.
+ sal_Int16 reserved2; //MUST be zero.
+ sal_uInt16 kcm1; //A Kcm that specifies the primary shortcut key.
+ sal_uInt16 kcm2; //A Kcm that specifies the secondary shortcut key, or 0x00FF if there is no secondary shortcut key.
- sal_uInt16 kt; //A Kt that specifies the type of action to be taken when the key combination is pressed.
++ sal_uInt16 kt; //A Kt that specifies the type of action to be taken when the key combination is pressed.
+ sal_uInt32 param; //The meaning of this field depends on the value of kt
+
+ Kme(const Kme&);
+ Kme& operator = ( const Kme&);
+ public:
+ Kme();
+ ~Kme();
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ };
+
+ class PlfKme : public Tcg255SubStruct
+ {
+ sal_Int32 iMac;
+ Kme* rgkme;
+ PlfKme(const PlfKme&);
+ PlfKme& operator = ( const PlfKme&);
+ public:
+ PlfKme( bool bReadId = true );
+ ~PlfKme();
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ };
+
+ class TcgSttbfCore : public TBBase
+ {
+ struct SBBItem
+ {
+ sal_uInt16 cchData;
- rtl::OUString data;
++ rtl::OUString data;
+ sal_uInt16 extraData;
+ SBBItem() : cchData(0), extraData(0){}
+ };
+ sal_uInt16 fExtend;
+ sal_uInt16 cData;
+ sal_uInt16 cbExtra;
+ SBBItem* dataItems;
+ TcgSttbfCore(const TcgSttbfCore&);
+ TcgSttbfCore& operator = ( const TcgSttbfCore&);
+ public:
+ TcgSttbfCore();
+ ~TcgSttbfCore();
+ bool Read(SvStream *pS);
+ void Print( FILE* fp );
+ };
+
+ class TcgSttbf : public Tcg255SubStruct
+ {
+ TcgSttbfCore sttbf;
+ TcgSttbf(const TcgSttbf&);
+ TcgSttbf& operator = ( const TcgSttbf&);
+ public:
+ TcgSttbf( bool bReadId = true );
+ ~TcgSttbf(){}
+ bool Read(SvStream *pS);
+ void Print( FILE* fp );
+ };
+
+ class Xstz : public TBBase
+ {
- Xst xst; //An Xst specifying the string with its pre-pended length.
++ Xst xst; //An Xst specifying the string with its pre-pended length.
+ sal_uInt16 chTerm;
+
+ Xstz(const Xstz&);
+ Xstz& operator = ( const Xstz&);
+ public:
+ Xstz();
+ ~Xstz(){}
+ bool Read(SvStream *pS);
+ void Print( FILE* fp );
+ };
+
+ class MacroName : public TBBase
+ {
+ sal_uInt16 ibst; //An unsigned integer that specifies the index of the current entry in the macro name table. MUST NOT be the same as the index of any other entry.
+ Xstz xstz;
+ MacroName(const MacroName&);
+ MacroName& operator = ( const MacroName&);
+ public:
+ MacroName();
+ ~MacroName(){}
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ };
+
+ class MacroNames : public Tcg255SubStruct
+ {
+ sal_uInt16 iMac; //An unsigned integer that specifies the number of MacroName structures in rgNames.
+ MacroName* rgNames;
+
+ MacroNames(const MacroNames&);
+ MacroNames& operator = ( const MacroNames&);
+ public:
+ MacroNames( bool bReadId = true );
+ ~MacroNames();
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ };
+
+ class Tcg255 : public TBBase
+ {
+ std::vector< Tcg255SubStruct* > rgtcgData; // array of sub structures
+ Tcg255(const Tcg255&);
+ Tcg255& operator = ( const Tcg255&);
+ bool processSubStruct( sal_uInt8 nId, SvStream* );
+ public:
+ Tcg255();
+ ~Tcg255();
+ bool Read(SvStream *pS);
+ void Print( FILE* );
+ bool ImportCustomToolBar( SfxObjectShell& rDocSh );
+ };
+
+ class Tcg: public TBBase
+ {
- sal_Int8 nTcgVer;
++ sal_Int8 nTcgVer;
+ std::auto_ptr< Tcg255 > tcg;
+ Tcg(const Tcg&);
+ Tcg& operator = ( const Tcg&);
+ public:
+ Tcg();
+ ~Tcg(){}
+ bool Read(SvStream *pS);
+ bool ImportCustomToolBar( SfxObjectShell& rDocSh );
+ void Print( FILE* );
+ };
+
+ #endif
diff --cc sw/source/ui/app/docsh2.cxx
index e84e78e,a485a67..e988220
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@@ -1,7 -1,7 +1,7 @@@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-- *
++ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@@ -307,9 -313,8 +300,8 @@@ USHORT SwDocShell::PrepareClose( BOOL b
using namespace com::sun::star::script::vba::VBAEventId;
uno::Sequence< uno::Any > aArgs;
xVbaEvents->processVbaEvent( DOCUMENT_CLOSE, aArgs );
-- }
-- }
- #endif
++ }
++ }
return nRet;
}
@@@ -1502,6 -1607,12 +1522,12 @@@ void SwDocShell::FillClass( SvGlobalNam
*pClipFormat = bTemplate ? SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE : SOT_FORMATSTR_ID_STARWRITER_8;
*pLongUserName = SW_RESSTR(STR_WRITER_DOCUMENT_FULLTYPE);
}
+ // #FIXME check with new Event handling
-#if 0
++#if 0
+ uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper = pDoc->GetVbaEventsHelper();
+ if( xVbaEventsHelper.is() )
+ lcl_processCompatibleSfxHint( xVbaEventsHelper, rHint );
+ #endif
*pUserName = SW_RESSTR(STR_HUMAN_SWDOC_NAME);
}
diff --cc sw/source/ui/uno/unotxdoc.cxx
index 4577cab,94a850b..6082257
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@@ -1,7 -1,7 +1,7 @@@
/*************************************************************************
-- *
++ *
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-- *
++ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@@ -174,6 -178,12 +174,12 @@@ using ::osl::FileBase
#define SW_CREATE_MARKER_TABLE 0x06
#define SW_CREATE_DRAW_DEFAULTS 0x07
-#include <comphelper/processfactory.hxx>
++#include <comphelper/processfactory.hxx>
+
+ /******************************************************************************
+ *
+ ******************************************************************************/
+
extern bool lcl_GetPostIts( IDocumentFieldsAccess* pIDFA, _SetGetExpFlds * pSrtLst );
SwPrintUIOptions * lcl_GetPrintUIOptions(
@@@ -188,11 -198,11 +194,11 @@@
const SwView * pSwView = dynamic_cast< const SwView * >(pView);
const bool bHasSelection = pSwView ? pSwView->HasSelection( sal_False ) : false; // check for any selection, not just text selection
const bool bHasPostIts = lcl_GetPostIts( pDocShell->GetDoc(), 0 );
--
++
// get default values to use in dialog from documents SwPrintData
const SwPrintData *pPrintData = pDocShell->GetDoc()->getPrintData();
DBG_ASSERT( pPrintData, "failed to get SwPrintData from document" );
--
++
return new SwPrintUIOptions( bWebDoc, bSwSrcView, bHasSelection, bHasPostIts, *pPrintData );
}
@@@ -241,6 -257,12 +247,12 @@@ sal_Int64 SAL_CALL SwXTextDocument::get
{
return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ));
}
+ if( rId.getLength() == 16
+ && 0 == rtl_compareMemory( SfxObjectShell::getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
++ rId.getConstArray(), 16 ) )
+ {
+ return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(pDocShell ));
+ }
sal_Int64 nRet = SfxBaseModel::getSomething( rId );
if ( nRet )
@@@ -270,7 -294,7 +282,7 @@@ Any SAL_CALL SwXTextDocument::queryInte
aRet <<= xTmp;
}
-- if ( !aRet.hasValue()
++ if ( !aRet.hasValue()
&& rType != ::getCppuType((Reference< com::sun::star::document::XDocumentEventBroadcaster>*)0)
&& rType != ::getCppuType((Reference< com::sun::star::frame::XController>*)0)
&& rType != ::getCppuType((Reference< com::sun::star::frame::XFrame>*)0)
@@@ -377,8 -411,13 +389,11 @@@ SwXTextDocument::SwXTextDocument(SwDocS
m_pPrintUIOptions( NULL ),
m_pRenderData( NULL )
{
+ uno::Reference< document::XDocumentProperties > xWriterProps( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.writer.DocumentProperties") ), uno::UNO_QUERY_THROW);
+
+ SfxBaseModel::setDocumentProperties( xWriterProps );
}
-/*-- 18.12.98 11:53:00---------------------------------------------------
- -----------------------------------------------------------------------*/
SwXTextDocument::~SwXTextDocument()
{
InitNewDoc();
@@@ -877,7 -979,7 +892,7 @@@ SwUnoCrsr* SwXTextDocument::FindAny(co
(FindRanges)eRanges, pReplaceColl );
}
else
-- {
++ {
//todo/mba: assuming that notes should be omitted
BOOL bSearchInNotes = FALSE;
BOOL bCancel;
@@@ -2011,6 -2183,9 +2026,9 @@@ Any SwXTextDocument::getPropertyValue(c
Any aAny;
switch(pEntry->nWID)
{
- case WID_DOC_ISTEMPLATEID :
- aAny <<= pDocShell->IsTemplate();
- break;
++ case WID_DOC_ISTEMPLATEID :
++ aAny <<= pDocShell->IsTemplate();
++ break;
case WID_DOC_CHAR_COUNT :
case WID_DOC_PARA_COUNT :
case WID_DOC_WORD_COUNT :
@@@ -2307,7 -2506,7 +2333,7 @@@ Any SAL_CALL SwXTextDocument::getProper
static OutputDevice * lcl_GetOutputDevice( const SwPrintUIOptions &rPrintUIOptions )
{
OutputDevice *pOut = 0;
--
++
uno::Any aAny( rPrintUIOptions.getValue( C2U( "RenderDevice" ) ));
uno::Reference< awt::XDevice > xRenderDevice;
aAny >>= xRenderDevice;
@@@ -2318,9 -2517,10 +2344,9 @@@
}
return pOut;
--}
-
++}
--static bool lcl_SeqHasProperty(
++static bool lcl_SeqHasProperty(
const uno::Sequence< beans::PropertyValue >& rOptions,
const sal_Char *pPropName )
{
@@@ -2331,13 -2531,14 +2357,13 @@@
{
if (pProps[i].Name.equalsAscii( pPropName ))
bRes = true;
-- }
++ }
return bRes;
--}
-
++}
--SfxViewShell * SwXTextDocument::GetRenderView(
-- bool &rbIsSwSrcView,
-- const uno::Sequence< beans::PropertyValue >& rOptions,
++SfxViewShell * SwXTextDocument::GetRenderView(
++ bool &rbIsSwSrcView,
++ const uno::Sequence< beans::PropertyValue >& rOptions,
bool bIsPDFExport )
{
// get view shell to use
@@@ -2352,11 -2553,11 +2378,11 @@@
for (sal_Int32 i = 0; i < nLen; ++i)
{
if (pProps[i].Name.equalsAscii( "View" ))
-- {
++ {
aTmp = pProps[i].Value;
break;
}
-- }
++ }
uno::Reference< frame::XController > xController;
if (aTmp >>= xController)
@@@ -2366,7 -2567,8 +2392,7 @@@
}
}
return pView;
--}
-
++}
/*
* GetRenderDoc:
@@@ -2376,9 -2578,10 +2402,9 @@@
* The rpView variable will be set (if not already done) to the used
* SfxViewShell.
*/
- SwDoc * SwXTextDocument::GetRenderDoc(
- SfxViewShell *&rpView,
- const uno::Any& rSelection,
-
-SwDoc * SwXTextDocument::GetRenderDoc(
- SfxViewShell *&rpView,
- const uno::Any& rSelection,
++SwDoc * SwXTextDocument::GetRenderDoc(
++ SfxViewShell *&rpView,
++ const uno::Any& rSelection,
bool bIsPDFExport )
{
SwDoc *pDoc = 0;
@@@ -2428,8 -2631,12 +2454,8 @@@
return pDoc;
}
- static void lcl_SavePrintUIOptionsToDocumentPrintData(
- SwDoc &rDoc,
-/* -----------------------------23.08.02 16:00--------------------------------
-
- ---------------------------------------------------------------------------*/
-
-static void lcl_SavePrintUIOptionsToDocumentPrintData(
- SwDoc &rDoc,
++static void lcl_SavePrintUIOptionsToDocumentPrintData(
++ SwDoc &rDoc,
const SwPrintUIOptions &rPrintUIOptions,
bool bIsPDFEXport )
{
@@@ -2439,9 -2646,9 +2465,9 @@@
rDoc.setPrintData ( *pTmpData );
delete pTmpData; // setPrintData does make its own copy!
}
--
++
SwPrintData *pDocPrintData = rDoc.getPrintData();
--
++
pDocPrintData->SetPrintGraphic( rPrintUIOptions.IsPrintGraphics() );
pDocPrintData->SetPrintTable( rPrintUIOptions.IsPrintTables() );
pDocPrintData->SetPrintDraw( rPrintUIOptions.IsPrintDrawings() );
@@@ -2461,7 -2668,8 +2487,7 @@@
pDocPrintData->SetPrintHiddenText( rPrintUIOptions.IsPrintHiddenText() );
pDocPrintData->SetPrintTextPlaceholder( rPrintUIOptions.IsPrintTextPlaceholders() );
}
--
+
sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
const uno::Any& rSelection,
const uno::Sequence< beans::PropertyValue >& rxOptions )
@@@ -2474,14 -2682,14 +2500,14 @@@
const bool bIsPDFExport = !lcl_SeqHasProperty( rxOptions, "IsPrinter" );
bool bIsSwSrcView = false;
SfxViewShell *pView = GetRenderView( bIsSwSrcView, rxOptions, bIsPDFExport );
--
++
if (!bIsSwSrcView && !m_pRenderData)
m_pRenderData = new SwRenderData;
if (!m_pPrintUIOptions)
m_pPrintUIOptions = lcl_GetPrintUIOptions( pDocShell, pView );
bool bFormat = m_pPrintUIOptions->processPropertiesAndCheckFormat( rxOptions );
// const bool bIsSkipEmptyPages = !m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport );
--
++
SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport );
DBG_ASSERT( pDoc && pView, "doc or view shell missing!" );
if (!pDoc || !pView)
@@@ -2519,7 -2727,7 +2545,7 @@@
// reformating the document for printing will show the changes in the view
// which is likely to produce many unwanted and not nice to view actions.
-- // We don't want that! Thus we disable updating of the view.
++ // We don't want that! Thus we disable updating of the view.
pWrtShell->StartAction();
const TypeId aSwViewTypeId = TYPE(SwView);
@@@ -2534,7 -2742,7 +2560,7 @@@
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list