[ooo-build-commit] patches/dev300 patches/vba
Pei Feng Lin
pflin at kemper.freedesktop.org
Mon Aug 3 02:19:06 PDT 2009
patches/dev300/apply | 2
patches/vba/vba-commandbar-toolbar-fix.diff | 67 ++++++++++++++++++++++++++++
2 files changed, 69 insertions(+)
New commits:
commit 537114a3900d097da75e9390903e81d607c11ad0
Author: Fong Lin <pflin at novell.com>
Date: Mon Aug 3 17:19:26 2009 +0800
fix for find the toolbar creating during importing
* patches/dev300/apply:
* patches/vba/vba-commandbar-toolbar-fix.diff:
diff --git a/patches/dev300/apply b/patches/dev300/apply
index de462ac..b271d2f 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -1898,6 +1898,8 @@ vba-commandbarcontrol-enabled.diff, n#520228, Fong
vba-commandbar-document-scope.diff, Fong
# fix for dim a variable as vba constant
vba-dim-as-contants-fix.diff, n#521820, Fong
+# fix for find the toolbar creating during importing
+vba-commandbar-toolbar-fix.diff, Fong
# fix for set involving an automation object ( in vba mode )
vba-automation-set-fix.diff, n#507501, iz#103859
# various improvements, handle tooltip, handle seperators, fix bug where
diff --git a/patches/vba/vba-commandbar-toolbar-fix.diff b/patches/vba/vba-commandbar-toolbar-fix.diff
new file mode 100644
index 0000000..712905f
--- /dev/null
+++ b/patches/vba/vba-commandbar-toolbar-fix.diff
@@ -0,0 +1,67 @@
+diff --git vbahelper/source/vbahelper/vbacommandbarhelper.cxx vbahelper/source/vbahelper/vbacommandbarhelper.cxx
+index cb87814..b82578d 100644
+--- vbahelper/source/vbahelper/vbacommandbarhelper.cxx
++++ vbahelper/source/vbahelper/vbacommandbarhelper.cxx
+@@ -197,10 +197,22 @@ uno::Reference< frame::XLayoutManager > VbaCommandBarHelper::getLayoutManager()
+ return xLayoutManager;
+ }
+
++sal_Bool VbaCommandBarHelper::hasToolbar( const rtl::OUString& sResourceUrl, const rtl::OUString& sName ) throw (css::uno::RuntimeException)
++{
++ if( m_xDocCfgMgr->hasSettings( sResourceUrl ) )
++ {
++ rtl::OUString sUIName;
++ uno::Reference< beans::XPropertySet > xPropertySet( m_xDocCfgMgr->getSettings( sResourceUrl, sal_False ), uno::UNO_QUERY_THROW );
++ xPropertySet->getPropertyValue( rtl::OUString::createFromAscii(ITEM_DESCRIPTOR_UINAME) ) >>= sUIName;
++ if( sName.equalsIgnoreAsciiCase( sUIName ) )
++ return sal_True;
++ }
++ return sal_False;
++}
++
+ // return the resource url if found
+ rtl::OUString VbaCommandBarHelper::findToolbarByName( const css::uno::Reference< css::container::XNameAccess >& xNameAccess, const rtl::OUString& sName ) throw (css::uno::RuntimeException)
+ {
+- rtl::OUString sUIName;
+ rtl::OUString sResourceUrl;
+
+ // check if it is an buildin toolbar
+@@ -214,17 +226,17 @@ rtl::OUString VbaCommandBarHelper::findToolbarByName( const css::uno::Reference<
+ sResourceUrl = allNames[i];
+ if(sResourceUrl.indexOf( rtl::OUString::createFromAscii( ITEM_TOOLBAR_URL ) ) == 0 )
+ {
+- //OSL_TRACE("VbaCommandBarHelper::findToolbarByName, toolbar resource url: %s", rtl::OUStringToOString( sResourceUrl, RTL_TEXTENCODING_UTF8 ).getStr() );
+- if( m_xDocCfgMgr->hasSettings( sResourceUrl ) )
+- {
+- uno::Reference< beans::XPropertySet > xPropertySet( m_xDocCfgMgr->getSettings( sResourceUrl, sal_False ), uno::UNO_QUERY_THROW );
+- xPropertySet->getPropertyValue( rtl::OUString::createFromAscii(ITEM_DESCRIPTOR_UINAME) ) >>= sUIName;
+- // OSL_TRACE("VbaCommandBarHelper::findToolbarByName, toolbar ui name: %s", rtl::OUStringToOString( sUIName, RTL_TEXTENCODING_UTF8 ).getStr() );
+- if( sName.equalsIgnoreAsciiCase( sUIName ) )
+- return sResourceUrl;
+- }
++ if( hasToolbar( sResourceUrl, sName ) )
++ return sResourceUrl;
+ }
+ }
++
++ // the customize toolbars creating during importing, shoud found there.
++ static rtl::OUString sToolbarPrefix( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/custom_" ) );
++ sResourceUrl = sToolbarPrefix.concat( sName );
++ if( hasToolbar( sResourceUrl, sName ) )
++ return sResourceUrl;
++
+ return rtl::OUString();
+ }
+
+diff --git vbahelper/source/vbahelper/vbacommandbarhelper.hxx vbahelper/source/vbahelper/vbacommandbarhelper.hxx
+index 22ea158..e6b0358 100644
+--- vbahelper/source/vbahelper/vbacommandbarhelper.hxx
++++ vbahelper/source/vbahelper/vbacommandbarhelper.hxx
+@@ -76,6 +76,7 @@ private:
+ rtl::OUString maModuleId;
+
+ void Init() throw (css::uno::RuntimeException);
++ sal_Bool hasToolbar( const rtl::OUString& sResourceUrl, const rtl::OUString& sName ) throw (css::uno::RuntimeException);
+ public:
+ VbaCommandBarHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::frame::XModel >& xModel ) throw( css::uno::RuntimeException );
+
More information about the ooo-build-commit
mailing list