openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arie...@apache.org
Subject svn commit: r1417851 - in /openoffice/trunk/main/framework: inc/framework/addonsoptions.hxx source/fwe/classes/addonsoptions.cxx
Date Thu, 06 Dec 2012 13:29:05 GMT
Author: arielch
Date: Thu Dec  6 13:29:05 2012
New Revision: 1417851

URL: http://svn.apache.org/viewvc?rev=1417851&view=rev
Log:
#i121442# - Read Statusbar merging configuration

Modified:
    openoffice/trunk/main/framework/inc/framework/addonsoptions.hxx
    openoffice/trunk/main/framework/source/fwe/classes/addonsoptions.cxx

Modified: openoffice/trunk/main/framework/inc/framework/addonsoptions.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/framework/inc/framework/addonsoptions.hxx?rev=1417851&r1=1417850&r2=1417851&view=diff
==============================================================================
--- openoffice/trunk/main/framework/inc/framework/addonsoptions.hxx (original)
+++ openoffice/trunk/main/framework/inc/framework/addonsoptions.hxx Thu Dec  6 13:29:05 2012
@@ -52,6 +52,10 @@
 #define ADDONSMENUITEM_STRING_CONTROLTYPE               "ControlType"
 #define ADDONSMENUITEM_STRING_WIDTH                     "Width"
 
+#define STATUSBARITEM_STRING_ALIGN                      "Alignment"
+#define STATUSBARITEM_STRING_AUTOSIZE                   "AutoSize"
+#define STATUSBARITEM_STRING_OWNERDRAW                  "OwnerDraw"
+
 #define ADDONSMENUITEM_URL_LEN                          3
 #define ADDONSMENUITEM_TITLE_LEN                        5
 #define ADDONSMENUITEM_TARGET_LEN                       6
@@ -68,6 +72,10 @@
 #define ADDONSMENUITEM_PROPERTYNAME_CONTROLTYPE         ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ADDONSMENUITEM_STRING_CONTROLTYPE
    ))
 #define ADDONSMENUITEM_PROPERTYNAME_WIDTH               ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ADDONSMENUITEM_STRING_WIDTH
          ))
 
+#define STATUSBARITEM_PROPERTYNAME_ALIGN                ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STATUSBARITEM_STRING_ALIGN
           ))
+#define STATUSBARITEM_PROPERTYNAME_AUTOSIZE             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STATUSBARITEM_STRING_AUTOSIZE
        ))
+#define STATUSBARITEM_PROPERTYNAME_OWNERDRAW            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STATUSBARITEM_STRING_OWNERDRAW
       ))
+
 #define ADDONSPOPUPMENU_URL_PREFIX_STR                  "private:menu/Addon"
 
 #define ADDONSPOPUPMENU_URL_PREFIX                      ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
ADDONSPOPUPMENU_URL_PREFIX_STR ))
@@ -101,6 +109,18 @@ struct FWE_DLLPUBLIC MergeToolbarInstruc
 
 typedef ::std::vector< MergeToolbarInstruction > MergeToolbarInstructionContainer;
 
+struct FWE_DLLPUBLIC MergeStatusbarInstruction
+{
+    ::rtl::OUString     aMergePoint;
+    ::rtl::OUString     aMergeCommand;
+    ::rtl::OUString     aMergeCommandParameter;
+    ::rtl::OUString     aMergeFallback;
+    ::rtl::OUString     aMergeContext;
+    ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue
> > aMergeStatusbarItems;
+};
+
+typedef ::std::vector< MergeStatusbarInstruction > MergeStatusbarInstructionContainer;
+
 //_________________________________________________________________________________________________________________
 //  forward declarations
 //_________________________________________________________________________________________________________________
@@ -284,6 +304,8 @@ class FWE_DLLPUBLIC AddonsOptions
         *//*-*****************************************************************************************************/
         bool GetMergeToolbarInstructions( const ::rtl::OUString& rToolbarName, MergeToolbarInstructionContainer&
rToolbar ) const;
 
+        const MergeStatusbarInstructionContainer& GetMergeStatusbarInstructions() const;
+
         /*-****************************************************************************************************//**
             @short      Gets the Add-On help menu part of all addon components registered

             @descr      -

Modified: openoffice/trunk/main/framework/source/fwe/classes/addonsoptions.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/framework/source/fwe/classes/addonsoptions.cxx?rev=1417851&r1=1417850&r2=1417851&view=diff
==============================================================================
--- openoffice/trunk/main/framework/source/fwe/classes/addonsoptions.cxx (original)
+++ openoffice/trunk/main/framework/source/fwe/classes/addonsoptions.cxx Thu Dec  6 13:29:05
2012
@@ -80,6 +80,10 @@ using namespace ::com::sun::star::lang	;
 #define PROPERTYNAME_CONTROLTYPE                        ADDONSMENUITEM_PROPERTYNAME_CONTROLTYPE
 #define PROPERTYNAME_WIDTH                              ADDONSMENUITEM_PROPERTYNAME_WIDTH
 
+#define PROPERTYNAME_ALIGN                              STATUSBARITEM_PROPERTYNAME_ALIGN
+#define PROPERTYNAME_AUTOSIZE                           STATUSBARITEM_PROPERTYNAME_AUTOSIZE
+#define PROPERTYNAME_OWNERDRAW                          STATUSBARITEM_PROPERTYNAME_OWNERDRAW
+
 #define PROPERTYNAME_IMAGESMALL							::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ImageSmall"
))
 #define PROPERTYNAME_IMAGEBIG							::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ImageBig"
))
 #define PROPERTYNAME_IMAGESMALLHC						::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ImageSmallHC"
))
@@ -108,16 +112,26 @@ using namespace ::com::sun::star::lang	;
 #define PROPERTYNAME_MERGETOOLBAR_MERGECONTEXT          ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MergeContext"
))
 #define PROPERTYNAME_MERGETOOLBAR_TOOLBARITEMS          ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ToolBarItems"
))
 
+#define PROPERTYNAME_MERGESTATUSBAR_MERGEPOINT               ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MergePoint"
))
+#define PROPERTYNAME_MERGESTATUSBAR_MERGECOMMAND             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MergeCommand"
))
+#define PROPERTYNAME_MERGESTATUSBAR_MERGECOMMANDPARAMETER    ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MergeCommandParameter"
))
+#define PROPERTYNAME_MERGESTATUSBAR_MERGEFALLBACK            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MergeFallback"
))
+#define PROPERTYNAME_MERGESTATUSBAR_MERGECONTEXT             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MergeContext"
))
+#define PROPERTYNAME_MERGESTATUSBAR_STATUSBARITEMS           ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StatusBarItems"
))
+
 // The following order is mandatory. Please add properties at the end!
-#define INDEX_URL             0
-#define INDEX_TITLE           1
-#define INDEX_IMAGEIDENTIFIER 2
-#define INDEX_TARGET		  3
-#define INDEX_CONTEXT		  4
-#define INDEX_SUBMENU		  5
-#define INDEX_CONTROLTYPE     6
-#define INDEX_WIDTH           7
-#define PROPERTYCOUNT_INDEX   8
+#define INDEX_URL               0
+#define INDEX_TITLE             1
+#define INDEX_IMAGEIDENTIFIER   2
+#define INDEX_TARGET            3
+#define INDEX_CONTEXT           4
+#define INDEX_SUBMENU           5
+#define INDEX_CONTROLTYPE       6
+#define INDEX_WIDTH             7
+#define INDEX_ALIGN             8
+#define INDEX_AUTOSIZE          9
+#define INDEX_OWNERDRAW         10
+#define PROPERTYCOUNT_INDEX     11
 
 // The following order is mandatory. Please add properties at the end!
 #define PROPERTYCOUNT_MENUITEM							6
@@ -146,6 +160,17 @@ using namespace ::com::sun::star::lang	;
 #define OFFSET_TOOLBARITEM_WIDTH                        6
 
 // The following order is mandatory. Please add properties at the end!
+#define PROPERTYCOUNT_STATUSBARITEM                     7
+#define OFFSET_STATUSBARITEM_URL                        0
+#define OFFSET_STATUSBARITEM_TITLE                      1
+#define OFFSET_STATUSBARITEM_CONTEXT                    2
+#define OFFSET_STATUSBARITEM_ALIGN                      3
+#define OFFSET_STATUSBARITEM_AUTOSIZE                   4
+#define OFFSET_STATUSBARITEM_OWNERDRAW                  5
+#define OFFSET_STATUSBARITEM_WIDTH                      6
+
+
+// The following order is mandatory. Please add properties at the end!
 #define PROPERTYCOUNT_IMAGES							8
 #define PROPERTYCOUNT_EMBEDDED_IMAGES                   4
 #define OFFSET_IMAGES_SMALL								0
@@ -174,6 +199,14 @@ using namespace ::com::sun::star::lang	;
 #define OFFSET_MERGETOOLBAR_MERGECONTEXT                5
 #define OFFSET_MERGETOOLBAR_TOOLBARITEMS                6
 
+#define PROPERTYCOUNT_MERGE_STATUSBAR                   6
+#define OFFSET_MERGESTATUSBAR_MERGEPOINT                0
+#define OFFSET_MERGESTATUSBAR_MERGECOMMAND              1
+#define OFFSET_MERGESTATUSBAR_MERGECOMMANDPARAMETER     2
+#define OFFSET_MERGESTATUSBAR_MERGEFALLBACK             3
+#define OFFSET_MERGESTATUSBAR_MERGECONTEXT              4
+#define OFFSET_MERGESTATUSBAR_STATUSBARITEMS            5
+
 #define EXPAND_PROTOCOL                                 "vnd.sun.star.expand:"
 
 const Size  aImageSizeSmall( 16, 16 );
@@ -267,7 +300,7 @@ class AddonsOptions_Impl : public Config
 		Image											GetImageFromURL( const rtl::OUString& aURL, sal_Bool bBig, sal_Bool
bHiContrast, sal_Bool bNoScale ) const;
         const MergeMenuInstructionContainer&            GetMergeMenuInstructions() const;
         bool                                            GetMergeToolbarInstructions( const
::rtl::OUString& rToolbarName, MergeToolbarInstructionContainer& rToolbarInstructions
) const;
-
+        const MergeStatusbarInstructionContainer&       GetMergeStatusbarInstructions()
const;
         void                                            ReadConfigurationData();
 
 	//-------------------------------------------------------------------------------------------------------------
@@ -316,18 +349,21 @@ class AddonsOptions_Impl : public Config
 		sal_Bool			 ReadAddonMenuSet( Sequence< Sequence< PropertyValue > >& aAddonMenuSeq
);
 		sal_Bool			 ReadOfficeMenuBarSet( Sequence< Sequence< PropertyValue > >&
aAddonOfficeMenuBarSeq );
         sal_Bool			 ReadOfficeToolBarSet( AddonToolBars& rAddonOfficeToolBars, std::vector<
rtl::OUString >& rAddonOfficeToolBarResNames );
-		sal_Bool			 ReadToolBarItemSet( const rtl::OUString rToolBarItemSetNodeName, Sequence<
Sequence< PropertyValue > >& aAddonOfficeToolBarSeq );
+        sal_Bool			 ReadToolBarItemSet( const rtl::OUString rToolBarItemSetNodeName, Sequence<
Sequence< PropertyValue > >& aAddonOfficeToolBarSeq );
 		sal_Bool			 ReadOfficeHelpSet( Sequence< Sequence< PropertyValue > >& aAddonOfficeHelpMenuSeq
);
 		sal_Bool			 ReadImages( ImageManager& aImageManager );
         sal_Bool             ReadMenuMergeInstructions( MergeMenuInstructionContainer&
rContainer );
         sal_Bool             ReadToolbarMergeInstructions( ToolbarMergingInstructions&
rToolbarMergeMap );
+        sal_Bool             ReadStatusbarMergeInstructions( MergeStatusbarInstructionContainer&
rContainer );
 
         sal_Bool             ReadMergeMenuData( const ::rtl::OUString& aMergeAddonInstructionBase,
Sequence< Sequence< PropertyValue > >& rMergeMenu );
         sal_Bool             ReadMergeToolbarData( const ::rtl::OUString& aMergeAddonInstructionBase,
Sequence< Sequence< PropertyValue > >& rMergeToolbarItems );
+        sal_Bool             ReadMergeStatusbarData( const ::rtl::OUString& aMergeAddonInstructionBase,
Sequence< Sequence< PropertyValue > >& rMergeStatusbar );
 		sal_Bool			 ReadMenuItem( const ::rtl::OUString& aMenuItemNodeName, Sequence< PropertyValue
>& aMenuItem, sal_Bool bIgnoreSubMenu = sal_False );
 		sal_Bool			 ReadPopupMenu( const ::rtl::OUString& aPopupMenuNodeName, Sequence<
PropertyValue >& aPopupMenu );
         sal_Bool             AppendPopupMenu( Sequence< PropertyValue >& aTargetPopupMenu,
const Sequence< PropertyValue >& rSourcePopupMenu );
 		sal_Bool			 ReadToolBarItem( const ::rtl::OUString& aToolBarItemNodeName, Sequence<
PropertyValue >& aToolBarItem );
+        sal_Bool             ReadStatusBarItem( const ::rtl::OUString& aStatusbarItemNodeName,
Sequence< PropertyValue >& aStatusbarItem );
 		sal_Bool			 ReadImagesItem( const ::rtl::OUString& aImagesItemNodeName, Sequence<
PropertyValue >& aImagesItem );
 		ImageEntry*			 ReadImageData( const ::rtl::OUString& aImagesNodeName );
 		void                 ReadAndAssociateImages( const ::rtl::OUString& aURL, const ::rtl::OUString&
aImageId );
@@ -343,6 +379,7 @@ class AddonsOptions_Impl : public Config
         Sequence< ::rtl::OUString > GetPropertyNamesMenuItem( const ::rtl::OUString&
aPropertyRootNode ) const;
 		Sequence< ::rtl::OUString > GetPropertyNamesPopupMenu( const ::rtl::OUString&
aPropertyRootNode ) const;
 		Sequence< ::rtl::OUString > GetPropertyNamesToolBarItem( const ::rtl::OUString&
aPropertyRootNode ) const;
+        Sequence< ::rtl::OUString > GetPropertyNamesStatusbarItem( const ::rtl::OUString&
aPropertyRootNode ) const;
 		Sequence< ::rtl::OUString > GetPropertyNamesImages( const ::rtl::OUString& aPropertyRootNode
) const;
 		sal_Bool			 CreateImageFromSequence( Image& rImage, sal_Bool bBig, Sequence< sal_Int8
>& rBitmapDataSeq ) const;
 
@@ -358,6 +395,7 @@ class AddonsOptions_Impl : public Config
 		::rtl::OUString                                          m_aPropImagesNames[PROPERTYCOUNT_IMAGES];
         ::rtl::OUString                                          m_aPropMergeMenuNames[PROPERTYCOUNT_MERGE_MENUBAR];
         ::rtl::OUString                                          m_aPropMergeToolbarNames[PROPERTYCOUNT_MERGE_TOOLBAR];
+        ::rtl::OUString                                          m_aPropMergeStatusbarNames[PROPERTYCOUNT_MERGE_STATUSBAR];
 		::rtl::OUString                                          m_aEmpty;
 		::rtl::OUString                                          m_aPathDelimiter;
 		::rtl::OUString                                          m_aSeparator;
@@ -373,6 +411,7 @@ class AddonsOptions_Impl : public Config
         Sequence< Sequence< PropertyValue > >             m_aEmptyAddonToolBar;
         MergeMenuInstructionContainer                     m_aCachedMergeMenuInsContainer;
         ToolbarMergingInstructions                        m_aCachedToolbarMergingInstructions;
+        MergeStatusbarInstructionContainer                m_aCachedStatusbarMergingInstructions;
 };
 
 //_________________________________________________________________________________________________________________
@@ -400,6 +439,9 @@ AddonsOptions_Impl::AddonsOptions_Impl()
 	m_aPropNames[ INDEX_SUBMENU			] = PROPERTYNAME_SUBMENU; // Submenu set!
     m_aPropNames[ INDEX_CONTROLTYPE     ] = PROPERTYNAME_CONTROLTYPE;
     m_aPropNames[ INDEX_WIDTH           ] = PROPERTYNAME_WIDTH;
+    m_aPropNames[ INDEX_ALIGN           ] = PROPERTYNAME_ALIGN;
+    m_aPropNames[ INDEX_AUTOSIZE        ] = PROPERTYNAME_AUTOSIZE;
+    m_aPropNames[ INDEX_OWNERDRAW       ] = PROPERTYNAME_OWNERDRAW;
 
 	// initialize array with fixed images property names
 	m_aPropImagesNames[ OFFSET_IMAGES_SMALL			] = PROPERTYNAME_IMAGESMALL;
@@ -427,6 +469,13 @@ AddonsOptions_Impl::AddonsOptions_Impl()
     m_aPropMergeToolbarNames[ OFFSET_MERGETOOLBAR_MERGECONTEXT          ] = PROPERTYNAME_MERGETOOLBAR_MERGECONTEXT;
     m_aPropMergeToolbarNames[ OFFSET_MERGETOOLBAR_TOOLBARITEMS          ] = PROPERTYNAME_MERGETOOLBAR_TOOLBARITEMS;
 
+    m_aPropMergeStatusbarNames[ OFFSET_MERGESTATUSBAR_MERGEPOINT            ] = PROPERTYNAME_MERGESTATUSBAR_MERGEPOINT;
+    m_aPropMergeStatusbarNames[ OFFSET_MERGESTATUSBAR_MERGECOMMAND          ] = PROPERTYNAME_MERGESTATUSBAR_MERGECOMMAND;
+    m_aPropMergeStatusbarNames[ OFFSET_MERGESTATUSBAR_MERGECOMMANDPARAMETER ] = PROPERTYNAME_MERGESTATUSBAR_MERGECOMMANDPARAMETER;
+    m_aPropMergeStatusbarNames[ OFFSET_MERGESTATUSBAR_MERGEFALLBACK         ] = PROPERTYNAME_MERGESTATUSBAR_MERGEFALLBACK;
+    m_aPropMergeStatusbarNames[ OFFSET_MERGESTATUSBAR_MERGECONTEXT          ] = PROPERTYNAME_MERGESTATUSBAR_MERGECONTEXT;
+    m_aPropMergeStatusbarNames[ OFFSET_MERGESTATUSBAR_STATUSBARITEMS        ] = PROPERTYNAME_MERGESTATUSBAR_STATUSBARITEMS;
+
     Reference< XComponentContext > xContext;
     Reference< com::sun::star::beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(),
UNO_QUERY );
     xProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext"
))) >>= xContext;
@@ -471,14 +520,17 @@ void AddonsOptions_Impl::ReadConfigurati
     ReadAddonMenuSet( m_aCachedMenuProperties );
 	ReadOfficeMenuBarSet( m_aCachedMenuBarPartProperties );
 	ReadOfficeToolBarSet( m_aCachedToolBarPartProperties, m_aCachedToolBarPartResourceNames
);
+
 	ReadOfficeHelpSet( m_aCachedHelpMenuProperties );
 	ReadImages( m_aImageManager );
 
     m_aCachedMergeMenuInsContainer.clear();
     m_aCachedToolbarMergingInstructions.clear();
+    m_aCachedStatusbarMergingInstructions.clear();
 
     ReadMenuMergeInstructions( m_aCachedMergeMenuInsContainer );
     ReadToolbarMergeInstructions( m_aCachedToolbarMergingInstructions );
+    ReadStatusbarMergeInstructions( m_aCachedStatusbarMergingInstructions );
 }
 
 //*****************************************************************************************************************
@@ -592,6 +644,11 @@ bool AddonsOptions_Impl::GetMergeToolbar
         return false;
 }
 
+const MergeStatusbarInstructionContainer& AddonsOptions_Impl::GetMergeStatusbarInstructions()
const
+{
+    return m_aCachedStatusbarMergingInstructions;
+}
+
 //*****************************************************************************************************************
 //	public method
 //*****************************************************************************************************************
@@ -847,6 +904,7 @@ void AddonsOptions_Impl::InsertToolBarSe
 	rAddonOfficeToolBarSeq[nToolBarItemCount] = aToolBarItem;
 }
 
+
 //*****************************************************************************************************************
 //	private method
 //*****************************************************************************************************************
@@ -1094,6 +1152,142 @@ sal_Bool AddonsOptions_Impl::ReadMergeTo
     return ReadToolBarItemSet( aMergeToolbarBaseNode, rMergeToolbarItems );
 }
 
+
+sal_Bool AddonsOptions_Impl::ReadStatusbarMergeInstructions( MergeStatusbarInstructionContainer&
aContainer )
+{
+    const ::rtl::OUString aStatusbarMergeRootName( RTL_CONSTASCII_USTRINGPARAM( "AddonUI/OfficeStatusbarMerging/"
));
+
+    Sequence< ::rtl::OUString > aAddonMergeNodesSeq = GetNodeNames( aStatusbarMergeRootName
);
+    ::rtl::OUString aAddonMergeNode( aStatusbarMergeRootName );
+    sal_uInt32  nCount = aAddonMergeNodesSeq.getLength();
+
+    Sequence< ::rtl::OUString > aNodePropNames( 5 );
+    ::rtl::OUString aURL;
+
+    for ( sal_uInt32 i = 0; i < nCount; i++ )
+    {
+        ::rtl::OUString aMergeAddonInstructions( aAddonMergeNode + aAddonMergeNodesSeq[i]
);
+
+        Sequence< ::rtl::OUString > aAddonInstMergeNodesSeq = GetNodeNames( aMergeAddonInstructions
);
+        sal_uInt32 nCountAddons = aAddonInstMergeNodesSeq.getLength();
+
+        for ( sal_uInt32 j = 0; j < nCountAddons; j++ )
+        {
+            ::rtl::OUStringBuffer aMergeAddonInstructionBase( aMergeAddonInstructions );
+            aMergeAddonInstructionBase.append( m_aPathDelimiter );
+            aMergeAddonInstructionBase.append( aAddonInstMergeNodesSeq[j] );
+            aMergeAddonInstructionBase.append( m_aPathDelimiter );
+
+            // Create sequence for data access
+            ::rtl::OUStringBuffer aBuffer( aMergeAddonInstructionBase );
+            aBuffer.append( m_aPropMergeMenuNames[ OFFSET_MERGESTATUSBAR_MERGEPOINT ] );
+            aNodePropNames[0] = aBuffer.makeStringAndClear();
+
+            aBuffer = aMergeAddonInstructionBase;
+            aBuffer.append( m_aPropMergeMenuNames[ OFFSET_MERGESTATUSBAR_MERGECOMMAND ] );
+            aNodePropNames[1] = aBuffer.makeStringAndClear();
+
+            aBuffer = aMergeAddonInstructionBase;
+            aBuffer.append( m_aPropMergeMenuNames[ OFFSET_MERGESTATUSBAR_MERGECOMMANDPARAMETER
] );
+            aNodePropNames[2] = aBuffer.makeStringAndClear();
+
+            aBuffer = aMergeAddonInstructionBase;
+            aBuffer.append( m_aPropMergeMenuNames[ OFFSET_MERGESTATUSBAR_MERGEFALLBACK ]
);
+            aNodePropNames[3] = aBuffer.makeStringAndClear();
+
+            aBuffer = aMergeAddonInstructionBase;
+            aBuffer.append( m_aPropMergeMenuNames[ OFFSET_MERGESTATUSBAR_MERGECONTEXT ] );
+            aNodePropNames[4] = aBuffer.makeStringAndClear();
+
+            Sequence< Any > aNodePropValues = GetProperties( aNodePropNames );
+
+            MergeStatusbarInstruction aMergeStatusbarInstruction;
+            aNodePropValues[0] >>= aMergeStatusbarInstruction.aMergePoint;
+            aNodePropValues[1] >>= aMergeStatusbarInstruction.aMergeCommand;
+            aNodePropValues[2] >>= aMergeStatusbarInstruction.aMergeCommandParameter;
+            aNodePropValues[3] >>= aMergeStatusbarInstruction.aMergeFallback;
+            aNodePropValues[4] >>= aMergeStatusbarInstruction.aMergeContext;
+
+            ReadMergeStatusbarData( aMergeAddonInstructionBase.makeStringAndClear(),
+                                    aMergeStatusbarInstruction.aMergeStatusbarItems );
+
+            aContainer.push_back( aMergeStatusbarInstruction );
+        }
+    }
+
+    return sal_True;
+}
+
+sal_Bool AddonsOptions_Impl::ReadMergeStatusbarData(
+    const ::rtl::OUString& aMergeAddonInstructionBase,
+    Sequence< Sequence< PropertyValue > >& rMergeStatusbarItems )
+{
+    sal_uInt32 nStatusbarItemCount = rMergeStatusbarItems.getLength();
+
+    ::rtl::OUStringBuffer aBuffer( aMergeAddonInstructionBase );
+    aBuffer.append( m_aPropMergeStatusbarNames[ OFFSET_MERGESTATUSBAR_STATUSBARITEMS ] );
+    ::rtl::OUString aMergeStatusbarBaseNode = aBuffer.makeStringAndClear();
+
+    ::rtl::OUString aAddonStatusbarItemSetNode( aMergeStatusbarBaseNode + m_aPathDelimiter
);
+    Sequence< ::rtl::OUString > aAddonStatusbarItemSetNodeSeq = GetNodeNames( aMergeStatusbarBaseNode
);
+
+    Sequence< PropertyValue > aStatusbarItem( PROPERTYCOUNT_STATUSBARITEM );
+    aStatusbarItem[ OFFSET_STATUSBARITEM_URL       ].Name = m_aPropNames[ INDEX_URL     
 ];
+    aStatusbarItem[ OFFSET_STATUSBARITEM_TITLE     ].Name = m_aPropNames[ INDEX_TITLE   
 ];
+    aStatusbarItem[ OFFSET_STATUSBARITEM_CONTEXT   ].Name = m_aPropNames[ INDEX_CONTEXT 
 ];
+    aStatusbarItem[ OFFSET_STATUSBARITEM_ALIGN     ].Name = m_aPropNames[ INDEX_ALIGN   
 ];
+    aStatusbarItem[ OFFSET_STATUSBARITEM_AUTOSIZE  ].Name = m_aPropNames[ INDEX_AUTOSIZE
 ];
+    aStatusbarItem[ OFFSET_STATUSBARITEM_OWNERDRAW ].Name = m_aPropNames[ INDEX_OWNERDRAW
];
+    aStatusbarItem[ OFFSET_STATUSBARITEM_WIDTH     ].Name = m_aPropNames[ INDEX_WIDTH   
 ];
+
+    sal_uInt32 nCount = aAddonStatusbarItemSetNodeSeq.getLength();
+    for ( sal_uInt32 n = 0; n < nCount; n++ )
+    {
+        ::rtl::OUString aStatusbarItemNode( aAddonStatusbarItemSetNode + aAddonStatusbarItemSetNodeSeq[n]
);
+
+        if ( ReadStatusBarItem( aStatusbarItemNode, aStatusbarItem ) )
+        {
+            sal_uInt32 nAddonCount = rMergeStatusbarItems.getLength();
+            rMergeStatusbarItems.realloc( nAddonCount+1 );
+            rMergeStatusbarItems[nAddonCount] = aStatusbarItem;
+        }
+    }
+
+    return ( (sal_uInt32)rMergeStatusbarItems.getLength() > nStatusbarItemCount );
+}
+
+sal_Bool AddonsOptions_Impl::ReadStatusBarItem(
+    const ::rtl::OUString& aStatusarItemNodeName,
+    Sequence< PropertyValue >& aStatusbarItem )
+{
+    sal_Bool bResult( sal_False );
+    ::rtl::OUString aURL;
+    ::rtl::OUString aAddonStatusbarItemTreeNode( aStatusarItemNodeName + m_aPathDelimiter
);
+    Sequence< Any > aStatusbarItemNodePropValues;
+
+    aStatusbarItemNodePropValues = GetProperties( GetPropertyNamesStatusbarItem( aAddonStatusbarItemTreeNode
) );
+
+    // Command URL is required
+    if (( aStatusbarItemNodePropValues[ OFFSET_STATUSBARITEM_URL ] >>= aURL ) &&
aURL.getLength() > 0 )
+    {
+        aStatusbarItem[ OFFSET_STATUSBARITEM_URL        ].Value <<= aURL;
+        aStatusbarItem[ OFFSET_STATUSBARITEM_TITLE      ].Value <<= aStatusbarItemNodePropValues[
OFFSET_STATUSBARITEM_TITLE     ];
+        aStatusbarItem[ OFFSET_STATUSBARITEM_CONTEXT    ].Value <<= aStatusbarItemNodePropValues[
OFFSET_STATUSBARITEM_CONTEXT   ];
+        aStatusbarItem[ OFFSET_STATUSBARITEM_ALIGN      ].Value <<= aStatusbarItemNodePropValues[
OFFSET_STATUSBARITEM_ALIGN     ];
+        aStatusbarItem[ OFFSET_STATUSBARITEM_AUTOSIZE   ].Value <<= aStatusbarItemNodePropValues[
OFFSET_STATUSBARITEM_AUTOSIZE  ];;
+        aStatusbarItem[ OFFSET_STATUSBARITEM_OWNERDRAW  ].Value <<= aStatusbarItemNodePropValues[
OFFSET_STATUSBARITEM_OWNERDRAW ];
+
+        // Configuration uses hyper for long. Therefore transform into sal_Int32
+        sal_Int64 nValue( 0 );
+        aStatusbarItemNodePropValues[ OFFSET_STATUSBARITEM_WIDTH ] >>= nValue;
+        aStatusbarItem[ OFFSET_STATUSBARITEM_WIDTH ].Value <<= sal_Int32( nValue );
+
+        bResult = sal_True;
+    }
+
+    return bResult;
+}
+
 //*****************************************************************************************************************
 //	private method
 //*****************************************************************************************************************
@@ -1634,6 +1828,22 @@ Sequence< ::rtl::OUString > AddonsOption
 	return lResult;
 }
 
+Sequence< ::rtl::OUString > AddonsOptions_Impl::GetPropertyNamesStatusbarItem(
+    const ::rtl::OUString& aPropertyRootNode ) const
+{
+    Sequence< ::rtl::OUString > lResult( PROPERTYCOUNT_STATUSBARITEM );
+
+    lResult[0] = ::rtl::OUString( aPropertyRootNode + m_aPropNames[ INDEX_URL       ] );
+    lResult[1] = ::rtl::OUString( aPropertyRootNode + m_aPropNames[ INDEX_TITLE     ] );
+    lResult[2] = ::rtl::OUString( aPropertyRootNode + m_aPropNames[ INDEX_CONTEXT   ] );
+    lResult[3] = ::rtl::OUString( aPropertyRootNode + m_aPropNames[ INDEX_ALIGN     ] );
+    lResult[4] = ::rtl::OUString( aPropertyRootNode + m_aPropNames[ INDEX_AUTOSIZE  ] );
+    lResult[5] = ::rtl::OUString( aPropertyRootNode + m_aPropNames[ INDEX_OWNERDRAW ] );
+    lResult[6] = ::rtl::OUString( aPropertyRootNode + m_aPropNames[ INDEX_WIDTH     ] );
+
+    return lResult;
+}
+
 //*****************************************************************************************************************
 //	private method
 //*****************************************************************************************************************
@@ -1791,6 +2001,12 @@ bool AddonsOptions::GetMergeToolbarInstr
         rToolbarName, rToolbarInstructions );
 }
 
+const MergeStatusbarInstructionContainer& AddonsOptions::GetMergeStatusbarInstructions()
const
+{
+    MutexGuard aGuard( GetOwnStaticMutex() );
+    return m_pDataContainer->GetMergeStatusbarInstructions();
+}
+
 //*****************************************************************************************************************
 //	public method
 //*****************************************************************************************************************



Mime
View raw message