Index: framework/inc/xml/menudocumenthandler.hxx
===================================================================
RCS file: /cvs/framework/framework/inc/xml/menudocumenthandler.hxx,v
retrieving revision 1.5
diff -u -p -u -r1.5 menudocumenthandler.hxx
--- framework/inc/xml/menudocumenthandler.hxx	19 Jun 2006 11:09:05 -0000	1.5
+++ framework/inc/xml/menudocumenthandler.hxx	26 Aug 2006 18:21:57 -0000
@@ -144,6 +144,16 @@ class ReadMenuDocumentHandlerBase : publ
 
 		::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > m_xLocator;
 		::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler> m_xReader;
+		void initPropertyCommon( com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > &rProps,
+								 const rtl::OUString &rCommandURL, const rtl::OUString &rHelpId,
+								 const rtl::OUString &rLabel);
+	private:
+		rtl::OUString m_aType;
+		rtl::OUString m_aLabel;
+		rtl::OUString m_aContainer;
+		rtl::OUString m_aHelpURL;
+		rtl::OUString m_aCommandURL;
+		::com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > m_aItemProp;
 };
 
 
Index: framework/inc/xml/toolboxdocumenthandler.hxx
===================================================================
RCS file: /cvs/framework/framework/inc/xml/toolboxdocumenthandler.hxx,v
retrieving revision 1.7
diff -u -p -u -r1.7 toolboxdocumenthandler.hxx
--- framework/inc/xml/toolboxdocumenthandler.hxx	9 Sep 2005 00:54:13 -0000	1.7
+++ framework/inc/xml/toolboxdocumenthandler.hxx	26 Aug 2006 18:21:57 -0000
@@ -178,12 +178,12 @@ class OReadToolBoxDocumentHandler : publ
 				}
 		};
 
-		sal_Bool																	    m_bToolBarStartFound;
-		sal_Bool																	    m_bToolBarEndFound;
-		sal_Bool																	    m_bToolBarItemStartFound;
-		sal_Bool																	    m_bToolBarSpaceStartFound;
-		sal_Bool																	    m_bToolBarBreakStartFound;
-		sal_Bool																	    m_bToolBarSeparatorStartFound;
+		sal_Bool																	    m_bToolBarStartFound : 1;
+		sal_Bool																	    m_bToolBarEndFound : 1;
+		sal_Bool																	    m_bToolBarItemStartFound : 1;
+		sal_Bool																	    m_bToolBarSpaceStartFound : 1;
+		sal_Bool																	    m_bToolBarBreakStartFound : 1;
+		sal_Bool																	    m_bToolBarSeparatorStartFound : 1;
 		ToolBoxHashMap																    m_aToolBoxMap;
         com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer >    m_rItemContainer;
 		::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >	    m_xLocator;
@@ -195,6 +195,12 @@ class OReadToolBoxDocumentHandler : publ
 		sal_Int32																	    m_nHashCode_Style_DropDown;
 		sal_Int32																	    m_nHashCode_Style_Repeat;
         sal_Int32                                                                       m_nHashCode_Style_DropDownOnly;
+		rtl::OUString                                                                   m_aType;
+		rtl::OUString                                                                   m_aLabel;
+		rtl::OUString                                                                   m_aStyle;
+		rtl::OUString                                                                   m_aHelpURL;
+		rtl::OUString                                                                   m_aIsVisible;
+		rtl::OUString                                                                   m_aCommandURL;
 };
 
 
Index: framework/source/xml/menudocumenthandler.cxx
===================================================================
RCS file: /cvs/framework/framework/source/xml/menudocumenthandler.cxx,v
retrieving revision 1.7
diff -u -p -u -r1.7 menudocumenthandler.cxx
--- framework/source/xml/menudocumenthandler.cxx	19 Jun 2006 11:46:17 -0000	1.7
+++ framework/source/xml/menudocumenthandler.cxx	26 Aug 2006 18:21:57 -0000
@@ -186,7 +186,12 @@ static void ExtractMenuParameters( const
 
 ReadMenuDocumentHandlerBase::ReadMenuDocumentHandlerBase() :
 	m_xLocator( 0 ),
-	m_xReader( 0 )
+	m_xReader( 0 ),
+	m_aType( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE )),
+	m_aLabel( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL )),
+	m_aContainer( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER )),
+	m_aHelpURL( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL )),
+	m_aCommandURL( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_COMMANDURL ))
 {
 }
 
@@ -239,6 +244,24 @@ throw(	SAXException, RuntimeException )
 		return OUString();
 }
 
+void ReadMenuDocumentHandlerBase::initPropertyCommon(
+	Sequence< PropertyValue > &rProps, const rtl::OUString &rCommandURL,
+	const rtl::OUString &rHelpId, const rtl::OUString &rLabel)
+{
+	rProps[0].Name = m_aCommandURL;
+	rProps[1].Name = m_aHelpURL;
+	rProps[2].Name = m_aContainer;
+	rProps[3].Name = m_aLabel;
+	rProps[4].Name = m_aType;
+
+	// Common values
+	rProps[0].Value <<= rCommandURL;
+	rProps[1].Value <<= rHelpId;
+	rProps[2].Value <<= Reference< XIndexContainer >();
+	rProps[3].Value <<= rLabel;
+	rProps[4].Value <<= ::com::sun::star::ui::ItemType::DEFAULT;
+}
+
 // -----------------------------------------------------------------------------
 
 OReadMenuDocumentHandler::OReadMenuDocumentHandler(
@@ -420,17 +443,8 @@ throw( SAXException, RuntimeException )
 		    if ( aCommandId.getLength() > 0 )
 		    {
                 Sequence< PropertyValue > aSubMenuProp( 5 );
-                aSubMenuProp[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_COMMANDURL ));
-                aSubMenuProp[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL ));
-                aSubMenuProp[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER ));
-                aSubMenuProp[3].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL ));
-                aSubMenuProp[4].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ));
-			    
-                aSubMenuProp[0].Value <<= aCommandId;
-                aSubMenuProp[1].Value <<= aHelpId;
-                aSubMenuProp[2].Value <<= xSubItemContainer;
-                aSubMenuProp[3].Value <<= aLabel;
-                aSubMenuProp[4].Value <<= ::com::sun::star::ui::ItemType::DEFAULT;
+				initPropertyCommon( aSubMenuProp, aCommandId, aHelpId, aLabel );
+				aSubMenuProp[2].Value <<= xSubItemContainer;
 
                 m_xMenuBarContainer->insertByIndex( m_xMenuBarContainer->getCount(), makeAny( aSubMenuProp ) );
 		    }
@@ -601,7 +615,6 @@ void SAL_CALL OReadMenuPopupHandler::end
 {
 }
 
-
 void SAL_CALL OReadMenuPopupHandler::startElement(
 	const OUString& rName, const Reference< XAttributeList > &xAttrList )
 throw( SAXException, RuntimeException )
@@ -644,17 +657,8 @@ throw( SAXException, RuntimeException )
 		if ( aCommandId.getLength() > 0 )
 		{
             Sequence< PropertyValue > aSubMenuProp( 5 );
-            aSubMenuProp[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_COMMANDURL ));
-            aSubMenuProp[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL ));
-            aSubMenuProp[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER ));
-            aSubMenuProp[3].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL ));
-            aSubMenuProp[4].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ));
-			
-            aSubMenuProp[0].Value <<= aCommandId;
-            aSubMenuProp[1].Value <<= aHelpId;
-            aSubMenuProp[2].Value <<= xSubItemContainer;
-            aSubMenuProp[3].Value <<= aLabel;
-            aSubMenuProp[4].Value <<= ::com::sun::star::ui::ItemType::DEFAULT;
+			initPropertyCommon( aSubMenuProp, aCommandId, aHelpId, aLabel );
+			aSubMenuProp[2].Value <<= xSubItemContainer;
 
             m_xMenuContainer->insertByIndex( m_xMenuContainer->getCount(), makeAny( aSubMenuProp ) );
 		}
@@ -690,17 +694,8 @@ throw( SAXException, RuntimeException )
 		if ( aCommandId.getLength() > 0 )
 		{
             Sequence< PropertyValue > aMenuItem( 5 );
-            aMenuItem[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_COMMANDURL ));
-            aMenuItem[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL ));
-            aMenuItem[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_CONTAINER ));
-            aMenuItem[3].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL ));
-            aMenuItem[4].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ));
-			
-            aMenuItem[0].Value <<= aCommandId;
-            aMenuItem[1].Value <<= aHelpId;
-            aMenuItem[2].Value <<= Reference< XIndexContainer >();
-            aMenuItem[3].Value <<= aLabel;
-            aMenuItem[4].Value <<= ::com::sun::star::ui::ItemType::DEFAULT;
+			initPropertyCommon( aMenuItem, aCommandId, aHelpId, aLabel );
+			aMenuItem[2].Value <<= Reference< XIndexContainer >();
 
             m_xMenuContainer->insertByIndex( m_xMenuContainer->getCount(), makeAny( aMenuItem ) );
 		}
Index: framework/source/xml/toolboxdocumenthandler.cxx
===================================================================
RCS file: /cvs/framework/framework/source/xml/toolboxdocumenthandler.cxx,v
retrieving revision 1.9
diff -u -p -u -r1.9 toolboxdocumenthandler.cxx
--- framework/source/xml/toolboxdocumenthandler.cxx	19 Jun 2006 11:47:28 -0000	1.9
+++ framework/source/xml/toolboxdocumenthandler.cxx	26 Aug 2006 18:21:57 -0000
@@ -161,8 +161,14 @@ ToolBarEntryProperty ToolBoxEntries[ORea
 OReadToolBoxDocumentHandler::OReadToolBoxDocumentHandler( const Reference< XIndexContainer >& rItemContainer ) :
 	ThreadHelpBase( &Application::GetSolarMutex() ), 
     ::cppu::OWeakObject(), 	
-    m_rItemContainer( rItemContainer )
-{
+    m_rItemContainer( rItemContainer ),
+    m_aType( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE )),
+    m_aLabel( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL )),
+    m_aStyle( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_STYLE )),
+    m_aHelpURL( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL )),
+    m_aIsVisible( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_VISIBLE )),
+    m_aCommandURL( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_COMMANDURL ))
+ {
 	OUString aNamespaceToolBar( RTL_CONSTASCII_USTRINGPARAM( XMLNS_TOOLBAR ));
 	OUString aNamespaceXLink( RTL_CONSTASCII_USTRINGPARAM( XMLNS_XLINK ));
 	OUString aSeparator( RTL_CONSTASCII_USTRINGPARAM( XMLNS_FILTER_SEPARATOR ));
@@ -442,12 +448,12 @@ throw(	SAXException, RuntimeException )
 		        if ( aCommandURL.getLength() > 0 )
 		        {
                     Sequence< PropertyValue > aToolbarItemProp( 6 );
-                    aToolbarItemProp[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_COMMANDURL ));
-                    aToolbarItemProp[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_HELPURL ));
-                    aToolbarItemProp[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL ));
-                    aToolbarItemProp[3].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ));
-                    aToolbarItemProp[4].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_STYLE ));
-                    aToolbarItemProp[5].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_VISIBLE ));
+                    aToolbarItemProp[0].Name = m_aCommandURL;
+                    aToolbarItemProp[1].Name = m_aHelpURL;
+                    aToolbarItemProp[2].Name = m_aLabel;
+                    aToolbarItemProp[3].Name = m_aType;
+                    aToolbarItemProp[4].Name = m_aStyle;
+                    aToolbarItemProp[5].Name = m_aIsVisible;
     			    
                     aToolbarItemProp[0].Value = makeAny( aCommandURL );
                     aToolbarItemProp[1].Value = makeAny( aHelpURL );
@@ -476,8 +482,8 @@ throw(	SAXException, RuntimeException )
 				m_bToolBarSpaceStartFound = sal_True;
 
                 Sequence< PropertyValue > aToolbarItemProp( 2 );
-                aToolbarItemProp[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_COMMANDURL ));
-                aToolbarItemProp[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ));
+                aToolbarItemProp[0].Name = m_aCommandURL;
+                aToolbarItemProp[1].Name = m_aType;
                 
                 aToolbarItemProp[0].Value <<= rtl::OUString();
                 aToolbarItemProp[1].Value <<= ::com::sun::star::ui::ItemType::SEPARATOR_SPACE;
@@ -501,8 +507,8 @@ throw(	SAXException, RuntimeException )
 				m_bToolBarBreakStartFound = sal_True;
 
                 Sequence< PropertyValue > aToolbarItemProp( 2 );
-                aToolbarItemProp[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_COMMANDURL ));
-                aToolbarItemProp[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ));
+                aToolbarItemProp[0].Name = m_aCommandURL;
+                aToolbarItemProp[1].Name = m_aType;
                 
                 aToolbarItemProp[0].Value <<= rtl::OUString();
                 aToolbarItemProp[1].Value <<= ::com::sun::star::ui::ItemType::SEPARATOR_LINEBREAK;
@@ -526,8 +532,8 @@ throw(	SAXException, RuntimeException )
 				m_bToolBarSeparatorStartFound = sal_True;
                 
                 Sequence< PropertyValue > aToolbarItemProp( 2 );
-                aToolbarItemProp[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_COMMANDURL ));
-                aToolbarItemProp[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE ));
+                aToolbarItemProp[0].Name = m_aCommandURL;
+                aToolbarItemProp[1].Name = m_aType;
                 
                 aToolbarItemProp[0].Value <<= rtl::OUString();
                 aToolbarItemProp[1].Value <<= ::com::sun::star::ui::ItemType::SEPARATOR_LINE;
