You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ja...@apache.org on 2013/02/03 14:24:38 UTC
svn commit: r1441909 [16/45] - in /openoffice/branches/l10n: ./
ext_libraries/apr-util/ ext_libraries/apr/ ext_libraries/hunspell/
ext_sources/ extras/l10n/source/ast/ extras/l10n/source/da/
extras/l10n/source/eu/ extras/l10n/source/gd/ extras/l10n/sou...
Modified: openoffice/branches/l10n/main/framework/source/fwe/classes/addonsoptions.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/framework/source/fwe/classes/addonsoptions.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/framework/source/fwe/classes/addonsoptions.cxx (original)
+++ openoffice/branches/l10n/main/framework/source/fwe/classes/addonsoptions.cxx Sun Feb 3 13:23:59 2013
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_framework.hxx"
@@ -44,7 +42,7 @@
#include <comphelper/processfactory.hxx>
#include <vcl/graph.hxx>
#include <svtools/filter.hxx>
-
+#include <vcl/dibtools.hxx>
#include <hash_map>
#include <algorithm>
#include <vector>
@@ -64,9 +62,11 @@ using namespace ::com::sun::star::lang ;
// const
//_________________________________________________________________________________________________________________
+#define STR_TOOLBARITEMS "ToolBarItems"
+
#define ROOTNODE_ADDONMENU ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Addons" ))
#define PATHDELIMITER ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/" ))
-#define TOOLBARITEMS ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ToolBarItems" ))
+#define TOOLBARITEMS ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STR_TOOLBARITEMS))
#define SEPARATOR_URL_STR "private:separator"
#define SEPARATOR_URL_LEN 17
#define SEPARATOR_URL ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SEPARATOR_URL_STR ))
@@ -79,6 +79,11 @@ using namespace ::com::sun::star::lang ;
#define PROPERTYNAME_SUBMENU ADDONSMENUITEM_PROPERTYNAME_SUBMENU
#define PROPERTYNAME_CONTROLTYPE ADDONSMENUITEM_PROPERTYNAME_CONTROLTYPE
#define PROPERTYNAME_WIDTH ADDONSMENUITEM_PROPERTYNAME_WIDTH
+#define PROPERTYNAME_TOOLBARITEMS TOOLBARITEMS
+
+#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" ))
@@ -106,18 +111,29 @@ using namespace ::com::sun::star::lang ;
#define PROPERTYNAME_MERGETOOLBAR_MERGECOMMANDPARAMETER ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MergeCommandParameter" ))
#define PROPERTYNAME_MERGETOOLBAR_MERGEFALLBACK ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MergeFallback" ))
#define PROPERTYNAME_MERGETOOLBAR_MERGECONTEXT ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MergeContext" ))
-#define PROPERTYNAME_MERGETOOLBAR_TOOLBARITEMS ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ToolBarItems" ))
+#define PROPERTYNAME_MERGETOOLBAR_TOOLBARITEMS ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(STR_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 INDEX_TOOLBARITEMS 11
+#define PROPERTYCOUNT_INDEX 12
// The following order is mandatory. Please add properties at the end!
#define PROPERTYCOUNT_MENUITEM 6
@@ -136,6 +152,11 @@ using namespace ::com::sun::star::lang ;
#define OFFSET_POPUPMENU_URL 3 // Used for property set
// The following order is mandatory. Please add properties at the end!
+#define PROPERTYCOUNT_TOOLBAR 2
+#define OFFSET_TOOLBAR_TITLE 0
+#define OFFSET_TOOLBAR_TOOLBARITEMS 1
+
+// The following order is mandatory. Please add properties at the end!
#define PROPERTYCOUNT_TOOLBARITEM 7
#define OFFSET_TOOLBARITEM_URL 0
#define OFFSET_TOOLBARITEM_TITLE 1
@@ -146,6 +167,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 +206,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 );
@@ -263,11 +303,12 @@ class AddonsOptions_Impl : public Config
const Sequence< Sequence< PropertyValue > >& GetAddonsMenuBarPart () const ;
const Sequence< Sequence< PropertyValue > >& GetAddonsToolBarPart ( sal_uInt32 nIndex ) const ;
const ::rtl::OUString GetAddonsToolbarResourceName( sal_uInt32 nIndex ) const;
+ const ::rtl::OUString GetAddonsToolbarUIName( sal_uInt32 nIndex ) const;
const Sequence< Sequence< PropertyValue > >& GetAddonsHelpMenu () const ;
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();
//-------------------------------------------------------------------------------------------------------------
@@ -315,19 +356,24 @@ 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 ReadOfficeToolBarSet( AddonToolBars& rAddonOfficeToolBars,
+ std::vector< rtl::OUString >& rAddonOfficeToolBarResNames,
+ std::vector< rtl::OUString >& rAddonOfficeToolBarUINames );
+ 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 );
@@ -342,7 +388,9 @@ class AddonsOptions_Impl : public Config
Sequence< ::rtl::OUString > GetPropertyNamesMergeMenuInstruction( const ::rtl::OUString& aPropertyRootName ) const;
Sequence< ::rtl::OUString > GetPropertyNamesMenuItem( const ::rtl::OUString& aPropertyRootNode ) const;
Sequence< ::rtl::OUString > GetPropertyNamesPopupMenu( const ::rtl::OUString& aPropertyRootNode ) const;
+ Sequence< ::rtl::OUString > GetPropertyNamesToolBar( 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 +406,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;
@@ -367,12 +416,14 @@ class AddonsOptions_Impl : public Config
Sequence< Sequence< PropertyValue > > m_aCachedMenuBarPartProperties;
AddonToolBars m_aCachedToolBarPartProperties;
std::vector< rtl::OUString > m_aCachedToolBarPartResourceNames;
+ std::vector< rtl::OUString > m_aCachedToolBarPartUINames;
Sequence< Sequence< PropertyValue > > m_aCachedHelpMenuProperties;
Reference< com::sun::star::util::XMacroExpander > m_xMacroExpander;
ImageManager m_aImageManager;
Sequence< Sequence< PropertyValue > > m_aEmptyAddonToolBar;
MergeMenuInstructionContainer m_aCachedMergeMenuInsContainer;
ToolbarMergingInstructions m_aCachedToolbarMergingInstructions;
+ MergeStatusbarInstructionContainer m_aCachedStatusbarMergingInstructions;
};
//_________________________________________________________________________________________________________________
@@ -400,6 +451,10 @@ 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;
+ m_aPropNames[ INDEX_TOOLBARITEMS ] = PROPERTYNAME_TOOLBARITEMS;
// initialize array with fixed images property names
m_aPropImagesNames[ OFFSET_IMAGES_SMALL ] = PROPERTYNAME_IMAGESMALL;
@@ -427,6 +482,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;
@@ -466,19 +528,25 @@ void AddonsOptions_Impl::ReadConfigurati
m_aCachedToolBarPartProperties = AddonToolBars();
m_aCachedHelpMenuProperties = Sequence< Sequence< PropertyValue > >();
m_aCachedToolBarPartResourceNames.clear();
+ m_aCachedToolBarPartUINames.clear();
m_aImageManager = ImageManager();
ReadAddonMenuSet( m_aCachedMenuProperties );
ReadOfficeMenuBarSet( m_aCachedMenuBarPartProperties );
- ReadOfficeToolBarSet( m_aCachedToolBarPartProperties, m_aCachedToolBarPartResourceNames );
+ ReadOfficeToolBarSet( m_aCachedToolBarPartProperties,
+ m_aCachedToolBarPartResourceNames,
+ m_aCachedToolBarPartUINames );
+
ReadOfficeHelpSet( m_aCachedHelpMenuProperties );
ReadImages( m_aImageManager );
m_aCachedMergeMenuInsContainer.clear();
m_aCachedToolbarMergingInstructions.clear();
+ m_aCachedStatusbarMergingInstructions.clear();
ReadMenuMergeInstructions( m_aCachedMergeMenuInsContainer );
ReadToolbarMergeInstructions( m_aCachedToolbarMergingInstructions );
+ ReadStatusbarMergeInstructions( m_aCachedStatusbarMergingInstructions );
}
//*****************************************************************************************************************
@@ -559,6 +627,15 @@ const ::rtl::OUString AddonsOptions_Impl
return rtl::OUString();
}
+
+const ::rtl::OUString AddonsOptions_Impl::GetAddonsToolbarUIName( sal_uInt32 nIndex ) const
+{
+ if ( nIndex < m_aCachedToolBarPartUINames.size() )
+ return m_aCachedToolBarPartUINames[nIndex];
+ else
+ return rtl::OUString();
+}
+
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
@@ -592,6 +669,11 @@ bool AddonsOptions_Impl::GetMergeToolbar
return false;
}
+const MergeStatusbarInstructionContainer& AddonsOptions_Impl::GetMergeStatusbarInstructions() const
+{
+ return m_aCachedStatusbarMergingInstructions;
+}
+
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
@@ -758,7 +840,10 @@ sal_Bool AddonsOptions_Impl::ReadOfficeM
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
-sal_Bool AddonsOptions_Impl::ReadOfficeToolBarSet( AddonToolBars& rAddonOfficeToolBars, std::vector< rtl::OUString >& rAddonOfficeToolBarResNames )
+sal_Bool AddonsOptions_Impl::ReadOfficeToolBarSet(
+ AddonToolBars& rAddonOfficeToolBars,
+ std::vector< rtl::OUString >& rAddonOfficeToolBarResNames,
+ std::vector< rtl::OUString >& rAddonOfficeToolBarUINames )
{
// Read the OfficeToolBar set and fill property sequences
::rtl::OUString aAddonToolBarNodeName( RTL_CONSTASCII_USTRINGPARAM( "AddonUI/OfficeToolBar" ));
@@ -769,10 +854,24 @@ sal_Bool AddonsOptions_Impl::ReadOfficeT
for ( sal_uInt32 n = 0; n < nCount; n++ )
{
- ::rtl::OUString aToolBarItemNode( aAddonToolBarNode + aAddonToolBarNodeSeq[n] );
+ ::rtl::OUString aToolBarNode( aAddonToolBarNode + aAddonToolBarNodeSeq[n] + m_aPathDelimiter );
rAddonOfficeToolBarResNames.push_back( aAddonToolBarNodeSeq[n] );
rAddonOfficeToolBars.push_back( m_aEmptyAddonToolBar );
- ReadToolBarItemSet( aToolBarItemNode, rAddonOfficeToolBars[n] );
+
+ Sequence< Any > aToolBarNodeValues = GetProperties( GetPropertyNamesToolBar( aToolBarNode ) );
+
+ rtl::OUString aUIName;
+ aToolBarNodeValues[OFFSET_TOOLBAR_TITLE] >>= aUIName;
+ rAddonOfficeToolBarUINames.push_back( aUIName );
+
+ Reference < XInterface > xToolbarItems;
+ if ( ( aToolBarNodeValues[OFFSET_TOOLBAR_TOOLBARITEMS] >>= xToolbarItems ) && xToolbarItems.is() )
+ {
+ ::rtl::OUStringBuffer aBuffer;
+ aBuffer.append( aToolBarNode );
+ aBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( STR_TOOLBARITEMS ) );
+ ReadToolBarItemSet( aBuffer.makeStringAndClear(), rAddonOfficeToolBars[n] );
+ }
}
return ( !rAddonOfficeToolBars.empty() );
@@ -847,6 +946,7 @@ void AddonsOptions_Impl::InsertToolBarSe
rAddonOfficeToolBarSeq[nToolBarItemCount] = aToolBarItem;
}
+
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
@@ -1094,6 +1194,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
//*****************************************************************************************************************
@@ -1547,7 +1783,7 @@ sal_Bool AddonsOptions_Impl::CreateImage
SvMemoryStream aMemStream( rBitmapDataSeq.getArray(), rBitmapDataSeq.getLength(), STREAM_STD_READ );
BitmapEx aBitmapEx;
- aMemStream >> aBitmapEx;
+ ReadDIBBitmapEx(aBitmapEx, aMemStream);
// Scale bitmap to fit the correct size for the menu/toolbar. Use best quality
if ( aBitmapEx.GetSizePixel() != aSize )
@@ -1618,6 +1854,17 @@ Sequence< ::rtl::OUString > AddonsOption
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
+Sequence< ::rtl::OUString > AddonsOptions_Impl::GetPropertyNamesToolBar( const ::rtl::OUString& aPropertyRootNode ) const
+{
+ Sequence< ::rtl::OUString > lResult( PROPERTYCOUNT_TOOLBAR );
+
+ // Create property names dependent from the root node name
+ lResult[OFFSET_TOOLBAR_TITLE] = ::rtl::OUString( aPropertyRootNode + m_aPropNames[ INDEX_TITLE ] );
+ lResult[OFFSET_TOOLBAR_TOOLBARITEMS] = ::rtl::OUString( aPropertyRootNode + m_aPropNames[ INDEX_TOOLBARITEMS ] );
+
+ return lResult;
+}
+
Sequence< ::rtl::OUString > AddonsOptions_Impl::GetPropertyNamesToolBarItem( const ::rtl::OUString& aPropertyRootNode ) const
{
Sequence< ::rtl::OUString > lResult( PROPERTYCOUNT_TOOLBARITEM );
@@ -1634,6 +1881,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
//*****************************************************************************************************************
@@ -1761,6 +2024,12 @@ const ::rtl::OUString AddonsOptions::Get
return m_pDataContainer->GetAddonsToolbarResourceName( nIndex );
}
+const ::rtl::OUString AddonsOptions::GetAddonsToolbarUIName( sal_uInt32 nIndex ) const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->GetAddonsToolbarUIName( nIndex );
+}
+
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
@@ -1791,6 +2060,12 @@ bool AddonsOptions::GetMergeToolbarInstr
rToolbarName, rToolbarInstructions );
}
+const MergeStatusbarInstructionContainer& AddonsOptions::GetMergeStatusbarInstructions() const
+{
+ MutexGuard aGuard( GetOwnStaticMutex() );
+ return m_pDataContainer->GetMergeStatusbarInstructions();
+}
+
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
Modified: openoffice/branches/l10n/main/framework/source/fwe/classes/imagewrapper.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/framework/source/fwe/classes/imagewrapper.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/framework/source/fwe/classes/imagewrapper.cxx (original)
+++ openoffice/branches/l10n/main/framework/source/fwe/classes/imagewrapper.cxx Sun Feb 3 13:23:59 2013
@@ -31,6 +31,7 @@
#include <vcl/bitmapex.hxx>
#include <tools/stream.hxx>
#include <cppuhelper/typeprovider.hxx>
+#include <vcl/dibtools.hxx>
using namespace com::sun::star::lang;
using namespace com::sun::star::uno;
@@ -78,7 +79,7 @@ Sequence< sal_Int8 > SAL_CALL ImageWrapp
vos::OGuard aGuard( Application::GetSolarMutex() );
SvMemoryStream aMem;
- aMem << m_aImage.GetBitmapEx().GetBitmap();
+ WriteDIB(m_aImage.GetBitmapEx().GetBitmap(), aMem, false, true);
return Sequence< sal_Int8 >( (sal_Int8*) aMem.GetData(), aMem.Tell() );
}
@@ -90,13 +91,13 @@ Sequence< sal_Int8 > SAL_CALL ImageWrapp
if ( aBmpEx.IsAlpha() )
{
SvMemoryStream aMem;
- aMem << aBmpEx.GetAlpha().GetBitmap();
+ WriteDIB(aBmpEx.GetAlpha().GetBitmap(), aMem, false, true);
return Sequence< sal_Int8 >( (sal_Int8*) aMem.GetData(), aMem.Tell() );
}
else if ( aBmpEx.IsTransparent() )
{
SvMemoryStream aMem;
- aMem << aBmpEx.GetMask();
+ WriteDIB(aBmpEx.GetMask(), aMem, false, true);
return Sequence< sal_Int8 >( (sal_Int8*) aMem.GetData(), aMem.Tell() );
}
Modified: openoffice/branches/l10n/main/framework/source/fwe/helper/actiontriggerhelper.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/framework/source/fwe/helper/actiontriggerhelper.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/framework/source/fwe/helper/actiontriggerhelper.cxx (original)
+++ openoffice/branches/l10n/main/framework/source/fwe/helper/actiontriggerhelper.cxx Sun Feb 3 13:23:59 2013
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_framework.hxx"
#include <framework/actiontriggerhelper.hxx>
@@ -36,7 +34,7 @@
#include <tools/stream.hxx>
#include <cppuhelper/weak.hxx>
#include <comphelper/processfactory.hxx>
-
+#include <vcl/dibtools.hxx>
const sal_uInt16 START_ITEMID = 1000;
@@ -196,7 +194,7 @@ void InsertSubMenuItems( Menu* pSubMenu,
{
aDIBSeq = xBitmap->getDIB();
SvMemoryStream aMem( (void *)aDIBSeq.getConstArray(), aDIBSeq.getLength(), STREAM_READ );
- aMem >> aBitmap;
+ ReadDIB(aBitmap, aMem, true);
}
aDIBSeq = xBitmap->getMaskDIB();
@@ -204,7 +202,7 @@ void InsertSubMenuItems( Menu* pSubMenu,
{
Bitmap aMaskBitmap;
SvMemoryStream aMem( (void *)aDIBSeq.getConstArray(), aDIBSeq.getLength(), STREAM_READ );
- aMem >> aMaskBitmap;
+ ReadDIB(aMaskBitmap, aMem, true);
aImage = Image( aBitmap, aMaskBitmap );
}
else
Modified: openoffice/branches/l10n/main/framework/source/jobs/shelljob.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/framework/source/jobs/shelljob.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/framework/source/jobs/shelljob.cxx (original)
+++ openoffice/branches/l10n/main/framework/source/jobs/shelljob.cxx Sun Feb 3 13:23:59 2013
@@ -44,8 +44,6 @@
//_______________________________________________
// include interfaces
-#include <com/sun/star/system/XSystemShellExecute.hpp>
-#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/util/XStringSubstitution.hpp>
//_______________________________________________
Modified: openoffice/branches/l10n/main/framework/source/layoutmanager/toolbarlayoutmanager.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/framework/source/layoutmanager/toolbarlayoutmanager.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/framework/source/layoutmanager/toolbarlayoutmanager.cxx (original)
+++ openoffice/branches/l10n/main/framework/source/layoutmanager/toolbarlayoutmanager.cxx Sun Feb 3 13:23:59 2013
@@ -1004,7 +1004,10 @@ void ToolbarLayoutManager::implts_create
catch ( uno::Exception& ) {}
}
- ::rtl::OUString aGenericAddonTitle = implts_generateGenericAddonToolbarTitle( i+1 );
+ ::rtl::OUString aAddonUIName = m_pAddonOptions->GetAddonsToolbarUIName( i );
+ const bool bAddonUIName = aAddonUIName.getLength();
+ ::rtl::OUString aAddonTitle = bAddonUIName ?
+ aAddonUIName : implts_generateGenericAddonToolbarTitle( i+1 );
if ( aElement.m_aName.getLength() > 0 )
{
@@ -1012,9 +1015,9 @@ void ToolbarLayoutManager::implts_create
// UI changes for this document.
implts_setElementData( aElement, xDockWindow );
aElement.m_xUIElement = xUIElement;
- if ( aElement.m_aUIName.getLength() == 0 )
+ if ( aElement.m_aUIName.getLength() == 0 && !bAddonUIName)
{
- aElement.m_aUIName = aGenericAddonTitle;
+ aElement.m_aUIName = aAddonTitle;
implts_writeWindowStateData( aElement );
}
}
@@ -1025,9 +1028,9 @@ void ToolbarLayoutManager::implts_create
aNewToolbar.m_bFloating = true;
implts_readWindowStateData( aAddonToolBarName, aNewToolbar );
implts_setElementData( aNewToolbar, xDockWindow );
- if ( aNewToolbar.m_aUIName.getLength() == 0 )
+ if ( aNewToolbar.m_aUIName.getLength() == 0 && !bAddonUIName)
{
- aNewToolbar.m_aUIName = aGenericAddonTitle;
+ aNewToolbar.m_aUIName = aAddonTitle;
implts_writeWindowStateData( aNewToolbar );
}
implts_insertToolbar( aNewToolbar );
@@ -1040,7 +1043,7 @@ void ToolbarLayoutManager::implts_create
vos::OGuard aGuard( Application::GetSolarMutex() );
Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
if ( pWindow->GetText().Len() == 0 )
- pWindow->SetText( aGenericAddonTitle );
+ pWindow->SetText( aAddonTitle );
if ( pWindow->GetType() == WINDOW_TOOLBOX )
{
ToolBox* pToolbar = (ToolBox *)pWindow;
@@ -1696,7 +1699,7 @@ void ToolbarLayoutManager::implts_writeW
{
try
{
- uno::Sequence< beans::PropertyValue > aWindowState( 8 );
+ uno::Sequence< beans::PropertyValue > aWindowState( 9 );
aWindowState[0].Name = ::rtl::OUString::createFromAscii( WINDOWSTATE_PROPERTY_DOCKED );
aWindowState[0].Value = ::uno::makeAny( sal_Bool( !rElementData.m_bFloating ));
@@ -1725,6 +1728,8 @@ void ToolbarLayoutManager::implts_writeW
aWindowState[6].Value = uno::makeAny( rElementData.m_aUIName );
aWindowState[7].Name = ::rtl::OUString::createFromAscii( WINDOWSTATE_PROPERTY_LOCKED );
aWindowState[7].Value = uno::makeAny( rElementData.m_aDockedData.m_bLocked );
+ aWindowState[8].Name = ::rtl::OUString::createFromAscii( WINDOWSTATE_PROPERTY_STYLE );
+ aWindowState[8].Value = uno::makeAny( rElementData.m_nStyle );
::rtl::OUString aName = rElementData.m_aName;
if ( xPersistentWindowState->hasByName( aName ))
Modified: openoffice/branches/l10n/main/framework/source/register/registerservices.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/framework/source/register/registerservices.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/framework/source/register/registerservices.cxx (original)
+++ openoffice/branches/l10n/main/framework/source/register/registerservices.cxx Sun Feb 3 13:23:59 2013
@@ -93,11 +93,8 @@
#include <uifactory/statusbarfactory.hxx>
#include <uiconfiguration/uicategorydescription.hxx>
#include <services/sessionlistener.hxx>
-//#include <uielement/logoimagestatusbarcontroller.hxx>
-//#include <uielement/logotextstatusbarcontroller.hxx>
//#include <uielement/newmenucontroller.hxx>
#include <services/taskcreatorsrv.hxx>
-//#include <uielement/simpletextstatusbarcontroller.hxx>
//#include <services/uriabbreviation.hxx>
#include <uielement/langselectionstatusbarcontroller.hxx>
@@ -154,11 +151,8 @@ COMPONENTGETFACTORY ( IFFACTORY( ::frame
IFFACTORY( ::framework::SessionListener ) else
IFFACTORY( ::framework::StatusbarControllerFactory ) else
IFFACTORY( ::framework::SessionListener ) else
- //IFFACTORY( ::framework::LogoImageStatusbarController ) else
- //IFFACTORY( ::framework::LogoTextStatusbarController ) else
IFFACTORY( ::framework::TaskCreatorService ) else
//IFFACTORY( ::framework::NewMenuController ) else
- //IFFACTORY( ::framework::SimpleTextStatusbarController ) else
//IFFACTORY( ::framework::UriAbbreviation ) else
//IFFACTORY( ::framework::PopupMenuDispatcher ) else
IFFACTORY( ::framework::ImageManager ) else
Modified: openoffice/branches/l10n/main/framework/source/register/registertemp.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/framework/source/register/registertemp.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/framework/source/register/registertemp.cxx (original)
+++ openoffice/branches/l10n/main/framework/source/register/registertemp.cxx Sun Feb 3 13:23:59 2013
@@ -58,9 +58,6 @@
#include <recording/dispatchrecordersupplier.hxx>
#include <services/license.hxx>
#include <services/uriabbreviation.hxx>
-#include <uielement/simpletextstatusbarcontroller.hxx>
-#include <uielement/logoimagestatusbarcontroller.hxx>
-#include <uielement/logotextstatusbarcontroller.hxx>
#include <uielement/fontmenucontroller.hxx>
#include <uielement/fontsizemenucontroller.hxx>
#include <uielement/footermenucontroller.hxx>
@@ -76,14 +73,11 @@ COMPONENTGETIMPLEMENTATIONENVIRONMENT
COMPONENTGETFACTORY ( IFFACTORY( ::framework::MediaTypeDetectionHelper )
IFFACTORY( ::framework::MailToDispatcher ) else
IFFACTORY( ::framework::ServiceHandler ) else
- IFFACTORY( ::framework::LogoTextStatusbarController ) else
- IFFACTORY( ::framework::LogoImageStatusbarController ) else
IFFACTORY( ::framework::License ) else
IFFACTORY( ::framework::PopupMenuDispatcher ) else
IFFACTORY( ::framework::DispatchHelper ) else
IFFACTORY( ::framework::DispatchRecorder ) else
IFFACTORY( ::framework::DispatchRecorderSupplier ) else
- IFFACTORY( ::framework::SimpleTextStatusbarController ) else
IFFACTORY( ::framework::ToolbarsMenuController ) else
IFFACTORY( ::framework::FontMenuController ) else
IFFACTORY( ::framework::MacrosMenuController ) else
Modified: openoffice/branches/l10n/main/framework/source/services/backingwindow.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/framework/source/services/backingwindow.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/framework/source/services/backingwindow.cxx (original)
+++ openoffice/branches/l10n/main/framework/source/services/backingwindow.cxx Sun Feb 3 13:23:59 2013
@@ -54,7 +54,7 @@
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/container/XNameAccess.hpp"
-#include "com/sun/star/system/XSystemShellExecute.hpp"
+#include "com/sun/star/system/SystemShellExecute.hpp"
#include "com/sun/star/system/SystemShellExecuteFlags.hpp"
#include "com/sun/star/task/XJobExecutor.hpp"
#include "com/sun/star/util/XStringWidth.hpp"
@@ -697,6 +697,8 @@ void BackingWindow::layoutButton(
void BackingWindow::Paint( const Rectangle& )
{
+ Resize();
+
Wallpaper aBack( GetSettings().GetStyleSettings().GetWorkspaceGradient() );
Region aClip( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) );
Rectangle aBmpRect(maControlRect);
@@ -884,6 +886,9 @@ void BackingWindow::Resize()
nYPos += nB2Delta - nDiff;
maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) );
maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) );
+
+ if( !IsInPaint())
+ Invalidate();
}
IMPL_LINK( BackingWindow, ToolboxHdl, void*, EMPTYARG )
@@ -966,9 +971,8 @@ IMPL_LINK( BackingWindow, ToolboxHdl, vo
sURL = aURLObj.GetMainURL( INetURLObject::NO_DECODE );
Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute(
- comphelper::getProcessServiceFactory()->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ),
- UNO_QUERY_THROW);
+ com::sun::star::system::SystemShellExecute::create(
+ ::comphelper::getProcessComponentContext() ) );
//throws css::lang::IllegalArgumentException, css::system::SystemShellExecuteException
xSystemShellExecute->execute( sURL, rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS);
}
Modified: openoffice/branches/l10n/main/framework/source/uielement/controlmenucontroller.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/framework/source/uielement/controlmenucontroller.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/framework/source/uielement/controlmenucontroller.cxx (original)
+++ openoffice/branches/l10n/main/framework/source/uielement/controlmenucontroller.cxx Sun Feb 3 13:23:59 2013
@@ -346,7 +346,7 @@ void ControlMenuController::impl_select(
}
}
-void SAL_CALL ControlMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
+void SAL_CALL ControlMenuController::itemActivated( const css::awt::MenuEvent& ) throw (RuntimeException)
{
osl::ResettableMutexGuard aLock( m_aMutex );
Modified: openoffice/branches/l10n/main/framework/source/uielement/fontmenucontroller.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/framework/source/uielement/fontmenucontroller.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/framework/source/uielement/fontmenucontroller.cxx (original)
+++ openoffice/branches/l10n/main/framework/source/uielement/fontmenucontroller.cxx Sun Feb 3 13:23:59 2013
@@ -187,7 +187,7 @@ void FontMenuController::impl_select(con
_xDispatch->dispatch( aTargetURL, aArgs );
}
-void SAL_CALL FontMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
+void SAL_CALL FontMenuController::itemActivated( const css::awt::MenuEvent& ) throw (RuntimeException)
{
osl::MutexGuard aLock( m_aMutex );
Modified: openoffice/branches/l10n/main/framework/source/uielement/langselectionmenucontroller.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/framework/source/uielement/langselectionmenucontroller.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/framework/source/uielement/langselectionmenucontroller.cxx (original)
+++ openoffice/branches/l10n/main/framework/source/uielement/langselectionmenucontroller.cxx Sun Feb 3 13:23:59 2013
@@ -54,7 +54,6 @@
#ifndef _VCL_MNEMONIC_HXX_
#include <vcl/mnemonic.hxx>
#endif
-#include <com/sun/star/awt/XMenuExtended.hpp>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/document/XDocumentLanguages.hpp>
Modified: openoffice/branches/l10n/main/framework/source/uielement/langselectionstatusbarcontroller.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/framework/source/uielement/langselectionstatusbarcontroller.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/framework/source/uielement/langselectionstatusbarcontroller.cxx (original)
+++ openoffice/branches/l10n/main/framework/source/uielement/langselectionstatusbarcontroller.cxx Sun Feb 3 13:23:59 2013
@@ -32,9 +32,6 @@
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <vcl/status.hxx>
-#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
-#include <toolkit/unohlp.hxx>
-#endif
#include <toolkit/helper/convert.hxx>
#include <com/sun/star/frame/XPopupMenuController.hpp>
@@ -60,7 +57,7 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <comphelper/processfactory.hxx>
-#include <toolkit/unohlp.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
#include <tools/gen.hxx>
#include <com/sun/star/awt/Command.hpp>
#include <svl/languageoptions.hxx>
@@ -69,6 +66,8 @@
#include "helper/mischelper.hxx"
+#include <rtl/ustrbuf.hxx>
+
#include <map>
#include <set>
@@ -81,13 +80,12 @@ using namespace ::com::sun::star::i18n;
using namespace ::com::sun::star::document;
using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
namespace framework
{
-////////////////////////////////////////////////////////////
-
DEFINE_XSERVICEINFO_MULTISERVICE ( LangSelectionStatusbarController ,
OWeakObject ,
SERVICENAME_STATUSBARCONTROLLER ,
@@ -104,23 +102,6 @@ LangSelectionStatusbarController::LangSe
{
}
-// XInterface
-Any SAL_CALL LangSelectionStatusbarController::queryInterface( const Type& rType )
-throw ( RuntimeException )
-{
- return svt::StatusbarController::queryInterface( rType );
-}
-
-void SAL_CALL LangSelectionStatusbarController::acquire() throw ()
-{
- svt::StatusbarController::acquire();
-}
-
-void SAL_CALL LangSelectionStatusbarController::release() throw ()
-{
- svt::StatusbarController::release();
-}
-
void SAL_CALL LangSelectionStatusbarController::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
@@ -129,59 +110,14 @@ throw (::com::sun::star::uno::Exception,
svt::StatusbarController::initialize( aArguments );
- if ( m_xParentWindow.is() && m_nID > 0 )
+ if ( m_xStatusbarItem.is() )
{
- Window* pWindow = VCLUnoHelper::GetWindow( m_xParentWindow );
- if ( pWindow && ( pWindow->GetType() == WINDOW_STATUSBAR ))
- {
- StatusBar* pStatusBar = (StatusBar *)pWindow;
- pStatusBar->SetItemText( m_nID, FwkResId( STR_LANGSTATUS_MULTIPLE_LANGUAGES ) );
- }
+ m_xStatusbarItem->setText( String( FwkResId( STR_LANGSTATUS_MULTIPLE_LANGUAGES ) ) );
}
}
-// XComponent
-void SAL_CALL LangSelectionStatusbarController::dispose()
-throw (::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::dispose" );
- svt::StatusbarController::dispose();
-}
-
-// XEventListener
-void SAL_CALL LangSelectionStatusbarController::disposing( const com::sun::star::lang::EventObject& Source )
-throw ( RuntimeException )
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::disposing" );
- svt::StatusbarController::disposing( Source );
-}
-
-// XStatusbarController
-::sal_Bool SAL_CALL LangSelectionStatusbarController::mouseButtonDown(
- const ::com::sun::star::awt::MouseEvent& )
-throw (::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::mouseButtonDown" );
- return sal_False;
-}
-
-::sal_Bool SAL_CALL LangSelectionStatusbarController::mouseMove(
- const ::com::sun::star::awt::MouseEvent& )
-throw (::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::mouseMove" );
- return sal_False;
-}
-
-::sal_Bool SAL_CALL LangSelectionStatusbarController::mouseButtonUp(
- const ::com::sun::star::awt::MouseEvent& )
-throw (::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::mouseButtonUp" );
- return sal_False;
-}
-
-void LangSelectionStatusbarController::LangMenu()
+void LangSelectionStatusbarController::LangMenu(
+ const ::com::sun::star::awt::Point& aPos )
throw (::com::sun::star::uno::RuntimeException)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::LangMenu" );
@@ -195,7 +131,7 @@ throw (::com::sun::star::uno::RuntimeExc
Reference< awt::XPopupMenu > subPopupMenu(m_xServiceManager->createInstance( s_sPopupMenu ), UNO_QUERY );
SvtLanguageTable aLanguageTable;
-
+
// get languages to be displayed in the menu
std::set< OUString > aLangItems;
FillLangItems( aLangItems, aLanguageTable, m_xFrame, m_aLangGuessHelper,
@@ -218,7 +154,7 @@ throw (::com::sun::star::uno::RuntimeExc
{
DBG_ASSERT( MID_LANG_SEL_1 <= nItemId && nItemId <= MID_LANG_SEL_9,
"nItemId outside of expected range!" );
- xPopupMenu->insertItem( nItemId, rStr, css::awt::MenuItemStyle::RADIOCHECK, nItemId );
+ xPopupMenu->insertItem( nItemId, rStr, 0, nItemId );
if ( rStr == m_aCurLang )
{
//make a sign for the current language
@@ -228,9 +164,9 @@ throw (::com::sun::star::uno::RuntimeExc
++nItemId;
}
}
- xPopupMenu->insertItem( MID_LANG_SEL_NONE, String( FwkResId( STR_LANGSTATUS_NONE )), css::awt::MenuItemStyle::RADIOCHECK, MID_LANG_SEL_NONE );
- xPopupMenu->insertItem( MID_LANG_SEL_RESET, String( FwkResId( STR_RESET_TO_DEFAULT_LANGUAGE )), css::awt::MenuItemStyle::RADIOCHECK, MID_LANG_SEL_RESET );
- xPopupMenu->insertItem( MID_LANG_SEL_MORE, String( FwkResId( STR_LANGSTATUS_MORE )), css::awt::MenuItemStyle::RADIOCHECK, MID_LANG_SEL_MORE );
+ xPopupMenu->insertItem( MID_LANG_SEL_NONE, String( FwkResId( STR_LANGSTATUS_NONE )), 0, MID_LANG_SEL_NONE );
+ xPopupMenu->insertItem( MID_LANG_SEL_RESET, String( FwkResId( STR_RESET_TO_DEFAULT_LANGUAGE )), 0, MID_LANG_SEL_RESET );
+ xPopupMenu->insertItem( MID_LANG_SEL_MORE, String( FwkResId( STR_LANGSTATUS_MORE )), 0, MID_LANG_SEL_MORE );
//
// add entries to submenu ('set language for paragraph')
@@ -245,20 +181,20 @@ throw (::com::sun::star::uno::RuntimeExc
{
DBG_ASSERT( MID_LANG_PARA_1 <= nItemId && nItemId <= MID_LANG_PARA_9,
"nItemId outside of expected range!" );
- subPopupMenu->insertItem( nItemId, rStr, css::awt::MenuItemStyle::RADIOCHECK, nItemId );
+ subPopupMenu->insertItem( nItemId, rStr, 0, nItemId );
aLangMap[nItemId] = rStr;
++nItemId;
}
}
- subPopupMenu->insertItem( MID_LANG_PARA_NONE, String( FwkResId( STR_LANGSTATUS_NONE )), css::awt::MenuItemStyle::RADIOCHECK, MID_LANG_PARA_NONE );
- subPopupMenu->insertItem( MID_LANG_PARA_RESET, String( FwkResId( STR_RESET_TO_DEFAULT_LANGUAGE )), css::awt::MenuItemStyle::RADIOCHECK, MID_LANG_PARA_RESET );
- subPopupMenu->insertItem( MID_LANG_PARA_MORE, String( FwkResId( STR_LANGSTATUS_MORE )), css::awt::MenuItemStyle::RADIOCHECK, MID_LANG_PARA_MORE );
+ subPopupMenu->insertItem( MID_LANG_PARA_NONE, String( FwkResId( STR_LANGSTATUS_NONE )), 0, MID_LANG_PARA_NONE );
+ subPopupMenu->insertItem( MID_LANG_PARA_RESET, String( FwkResId( STR_RESET_TO_DEFAULT_LANGUAGE )), 0, MID_LANG_PARA_RESET );
+ subPopupMenu->insertItem( MID_LANG_PARA_MORE, String( FwkResId( STR_LANGSTATUS_MORE )), 0, MID_LANG_PARA_MORE );
//
// add last two entries to main menu
//
xPopupMenu->insertSeparator( MID_LANG_PARA_SEPERATOR );
- xPopupMenu->insertItem( MID_LANG_PARA_STRING, String( FwkResId( STR_SET_LANGUAGE_FOR_PARAGRAPH )), css::awt::MenuItemStyle::RADIOCHECK, MID_LANG_PARA_STRING );
+ xPopupMenu->insertItem( MID_LANG_PARA_STRING, String( FwkResId( STR_SET_LANGUAGE_FOR_PARAGRAPH )), 0, MID_LANG_PARA_STRING );
xPopupMenu->setPopupMenu( MID_LANG_PARA_STRING, subPopupMenu );
@@ -267,79 +203,62 @@ throw (::com::sun::star::uno::RuntimeExc
//
Reference< awt::XWindowPeer > xParent( m_xParentWindow, UNO_QUERY );
-
- com::sun::star::awt::Rectangle aRectangle;
- Window* pWindow = VCLUnoHelper::GetWindow( m_xParentWindow );
- const Point mMousePos = pWindow->GetPointerPosPixel();
- aRectangle.X = mMousePos.X();
- aRectangle.Y = mMousePos.Y();
- sal_Int16 nId = xPopupMenu->execute( xParent, aRectangle, com::sun::star::awt::PopupMenuDirection::EXECUTE_UP+16 );
+ sal_Int16 nId = xPopupMenu->execute( xParent, aPos, com::sun::star::awt::PopupMenuDirection::EXECUTE_UP+16 );
//click "More..."
if ( nId && m_xFrame.is() )
{
- uno::Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
- util::URL aURL;
+ OUStringBuffer aBuff;
+ //set selected language as current language for selection
+ const OUString aSelectedLang = aLangMap[nId];
if (MID_LANG_SEL_1 <= nId && nId <= MID_LANG_SEL_9)
{
- //set selected language as current language for selection
- String aSelectedLang = aLangMap[nId];
- aURL.Complete += OUString::createFromAscii(".uno:LanguageStatus?Language:string=Current_");
- aURL.Complete += aSelectedLang;
+ aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( (".uno:LanguageStatus?Language:string=Current_") ));
+ aBuff.append( aSelectedLang );
}
else if (nId == MID_LANG_SEL_NONE)
{
//set None as current language for selection
- aURL.Complete += OUString::createFromAscii(".uno:LanguageStatus?Language:string=Current_LANGUAGE_NONE");
+ aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( (".uno:LanguageStatus?Language:string=Current_LANGUAGE_NONE") ));
}
else if (nId == MID_LANG_SEL_RESET)
{
// reset language attributes for selection
- aURL.Complete += OUString::createFromAscii(".uno:LanguageStatus?Language:string=Current_RESET_LANGUAGES");
+ aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( (".uno:LanguageStatus?Language:string=Current_RESET_LANGUAGES") ));
}
else if (nId == MID_LANG_SEL_MORE)
{
//open the dialog "format/character" for current selection
- aURL.Complete += OUString::createFromAscii(".uno:FontDialog?Language:string=*");
+ aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( (".uno:FontDialog?Language:string=*") ));
}
else if (MID_LANG_PARA_1 <= nId && nId <= MID_LANG_PARA_9)
{
- //set selected language for current paragraph
- String aSelectedLang = aLangMap[nId];
- aURL.Complete += OUString::createFromAscii(".uno:LanguageStatus?Language:string=Paragraph_");
- aURL.Complete += aSelectedLang;
+ aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( (".uno:LanguageStatus?Language:string=Paragraph_") ));
+ aBuff.append( aSelectedLang );
}
else if (nId == MID_LANG_PARA_NONE)
{
//set None as language for current paragraph
- aURL.Complete += OUString::createFromAscii(".uno:LanguageStatus?Language:string=Paragraph_LANGUAGE_NONE");
+ aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( (".uno:LanguageStatus?Language:string=Paragraph_LANGUAGE_NONE") ));
}
else if (nId == MID_LANG_PARA_RESET)
{
// reset language attributes for paragraph
- aURL.Complete += OUString::createFromAscii(".uno:LanguageStatus?Language:string=Paragraph_RESET_LANGUAGES");
+ aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( (".uno:LanguageStatus?Language:string=Paragraph_RESET_LANGUAGES") ));
}
else if (nId == MID_LANG_PARA_MORE)
{
//open the dialog "format/character" for current paragraph
- aURL.Complete += OUString::createFromAscii(".uno:FontDialogForParagraph");
+ aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( (".uno:FontDialogForParagraph") ));
}
- uno::Reference< util::XURLTransformer > xURLTransformer( m_xServiceManager->createInstance( OUString::createFromAscii("com.sun.star.util.URLTransformer" )), uno::UNO_QUERY );
- xURLTransformer->parseStrict( aURL );
- uno::Reference< XDispatch > xDispatch = xDispatchProvider->queryDispatch(aURL, OUString(), 0);
- if( xDispatch.is() )
- {
- uno::Sequence< beans::PropertyValue > aPV;
- if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
- UiEventLogHelper( OUString::createFromAscii("ButtonToolbarController")).log(m_xServiceManager, m_xFrame, aURL, aPV);
- xDispatch->dispatch( aURL, aPV);
- }
+ const Sequence< beans::PropertyValue > aDummyArgs;
+ execute( aBuff.makeStringAndClear(), aDummyArgs );
}
}
void SAL_CALL LangSelectionStatusbarController::command(
- const ::com::sun::star::awt::Point& /*aPos*/,
+ const ::com::sun::star::awt::Point& aPos,
::sal_Int32 nCommand,
::sal_Bool /*bMouseEvent*/,
const ::com::sun::star::uno::Any& /*aData*/ )
@@ -348,33 +267,16 @@ throw (::com::sun::star::uno::RuntimeExc
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::command" );
if ( nCommand & ::awt::Command::CONTEXTMENU )
{
- LangMenu();
+ LangMenu( aPos );
}
}
-void SAL_CALL LangSelectionStatusbarController::paint(
- const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
- const ::com::sun::star::awt::Rectangle& rOutputRectangle,
- ::sal_Int32 nItemId,
- ::sal_Int32 nStyle )
-throw (::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::paint" );
- svt::StatusbarController::paint( xGraphics, rOutputRectangle, nItemId, nStyle );
-}
-
-void SAL_CALL LangSelectionStatusbarController::click()
+void SAL_CALL LangSelectionStatusbarController::click(
+ const ::com::sun::star::awt::Point& aPos )
throw (::com::sun::star::uno::RuntimeException)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::click" );
- LangMenu();
-}
-
-void SAL_CALL LangSelectionStatusbarController::doubleClick()
-throw (::com::sun::star::uno::RuntimeException)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "LangSelectionStatusbarController::doubleClick" );
- svt::StatusbarController::doubleClick();
+ LangMenu( aPos );
}
// XStatusListener
@@ -395,26 +297,25 @@ throw ( RuntimeException )
return;
m_bShowMenu = sal_True;
-
m_nScriptType = LS_SCRIPT_LATIN | LS_SCRIPT_ASIAN | LS_SCRIPT_COMPLEX; //set the default value
- Window* pWindow = VCLUnoHelper::GetWindow( m_xParentWindow );
- if ( pWindow && pWindow->GetType() == WINDOW_STATUSBAR && m_nID != 0 )
+
+ if ( m_xStatusbarItem.is() )
{
- OUString aStrValue;
+ OUString aStrValue;
Sequence< OUString > aSeq;
- StatusBar* pStatusBar = (StatusBar *)pWindow;
if ( Event.State >>= aStrValue )
- pStatusBar->SetItemText( m_nID, aStrValue );
+ m_xStatusbarItem->setText( aStrValue );
else if ( Event.State >>= aSeq )
{
if ( aSeq.getLength() == 4 )
{
- const String aMultipleLangText( FwkResId( STR_LANGSTATUS_MULTIPLE_LANGUAGES ) );
OUString aStatusText = aSeq[0];
- if ( 0 == aStatusText.compareToAscii( "*" ))
- aStatusText = aMultipleLangText;
- pStatusBar->SetItemText( m_nID, aStatusText );
+ if ( 0 == aStatusText.compareToAscii( RTL_CONSTASCII_STRINGPARAM("*") ))
+ {
+ aStatusText = String( FwkResId( STR_LANGSTATUS_MULTIPLE_LANGUAGES ) );
+ }
+ m_xStatusbarItem->setText( aStatusText );
// Retrieve all other values from the sequence and
// store it members!
@@ -426,7 +327,7 @@ throw ( RuntimeException )
}
else if ( !Event.State.hasValue() )
{
- pStatusBar->SetItemText( m_nID, String() );
+ m_xStatusbarItem->setText( OUString() );
m_bShowMenu = sal_False; // no language -> no menu
}
}
Modified: openoffice/branches/l10n/main/framework/source/uielement/newmenucontroller.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/framework/source/uielement/newmenucontroller.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/framework/source/uielement/newmenucontroller.cxx (original)
+++ openoffice/branches/l10n/main/framework/source/uielement/newmenucontroller.cxx Sun Feb 3 13:23:59 2013
@@ -412,7 +412,7 @@ void SAL_CALL NewMenuController::statusC
}
// XMenuListener
-void SAL_CALL NewMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
+void SAL_CALL NewMenuController::itemSelected( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
{
Reference< css::awt::XPopupMenu > xPopupMenu;
Reference< XDispatch > xDispatch;
@@ -470,7 +470,7 @@ void SAL_CALL NewMenuController::select(
}
}
-void SAL_CALL NewMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
+void SAL_CALL NewMenuController::itemActivated( const css::awt::MenuEvent& ) throw (RuntimeException)
{
vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
if ( m_xFrame.is() && m_xPopupMenu.is() )
Modified: openoffice/branches/l10n/main/framework/source/uielement/popupmenucontroller.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/framework/source/uielement/popupmenucontroller.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/framework/source/uielement/popupmenucontroller.cxx (original)
+++ openoffice/branches/l10n/main/framework/source/uielement/popupmenucontroller.cxx Sun Feb 3 13:23:59 2013
@@ -211,7 +211,7 @@ Reference< awt::XWindow > SAL_CALL Popup
if( !mxPopupMenu.is() )
{
- mxPopupMenu = Reference< awt::XPopupMenu >( getServiceManager()->createInstance( DECLARE_ASCII( "stardiv.Toolkit.VCLXPopupMenu" ) ), UNO_QUERY_THROW );
+ mxPopupMenu = Reference< awt::XPopupMenu >( getServiceManager()->createInstance( DECLARE_ASCII( "com.sun.star.awt.PopupMenu" ) ), UNO_QUERY_THROW );
mxPopupMenuController->setPopupMenu( mxPopupMenu );
}
else
@@ -221,7 +221,7 @@ Reference< awt::XWindow > SAL_CALL Popup
}
pToolBox->SetItemDown( nItemId, sal_True );
Reference< awt::XWindowPeer > xPeer( getParent(), UNO_QUERY_THROW );
- mxPopupMenu->execute( xPeer, VCLUnoHelper::ConvertToAWTRect( aRect ), 0 );
+ mxPopupMenu->execute( xPeer, awt::Point( aRect.getX(), aRect.getY() ), 0 );
pToolBox->SetItemDown( nItemId, sal_False );
}
catch( Exception& )
Modified: openoffice/branches/l10n/main/framework/source/uielement/recentfilesmenucontroller.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/framework/source/uielement/recentfilesmenucontroller.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/framework/source/uielement/recentfilesmenucontroller.cxx (original)
+++ openoffice/branches/l10n/main/framework/source/uielement/recentfilesmenucontroller.cxx Sun Feb 3 13:23:59 2013
@@ -301,20 +301,18 @@ void SAL_CALL RecentFilesMenuController:
m_bDisabled = !Event.IsEnabled;
}
-void SAL_CALL RecentFilesMenuController::select( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
+void SAL_CALL RecentFilesMenuController::itemSelected( const css::awt::MenuEvent& rEvent ) throw (RuntimeException)
{
- Reference< css::awt::XPopupMenu > xPopupMenu;
- Reference< css::awt::XMenuExtended > xMenuExt;
+ Reference< css::awt::XPopupMenu > xPopupMenu;
osl::ClearableMutexGuard aLock( m_aMutex );
- xPopupMenu = m_xPopupMenu;
- xMenuExt = Reference< css::awt::XMenuExtended >( m_xPopupMenu, UNO_QUERY );
+ xPopupMenu = m_xPopupMenu;
aLock.clear();
- if ( xMenuExt.is() )
+ if ( xPopupMenu.is() )
{
- const rtl::OUString aCommand( xMenuExt->getCommand( rEvent.MenuId ) );
- OSL_TRACE( "RecentFilesMenuController::select() - Command : %s",
+ const rtl::OUString aCommand( xPopupMenu->getCommand( rEvent.MenuId ) );
+ OSL_TRACE( "RecentFilesMenuController::itemSelected() - Command : %s",
rtl::OUStringToOString( aCommand, RTL_TEXTENCODING_UTF8 ).getStr() );
if ( aCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( CMD_CLEAR_LIST ) ) )
@@ -324,7 +322,7 @@ void SAL_CALL RecentFilesMenuController:
}
}
-void SAL_CALL RecentFilesMenuController::activate( const css::awt::MenuEvent& ) throw (RuntimeException)
+void SAL_CALL RecentFilesMenuController::itemActivated( const css::awt::MenuEvent& ) throw (RuntimeException)
{
osl::MutexGuard aLock( m_aMutex );
impl_setPopupMenu();