summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2005-04-27 07:53:03 +0000
committerOliver Bolte <obo@openoffice.org>2005-04-27 07:53:03 +0000
commitf619590f8373eabfab4ece18481f59f948d91c14 (patch)
treea715e975591441190121909cf45f55443f5e05bc /fpicker
parent6b45c3ae2db3b250a17e0cdcc04f6a55a62a8abe (diff)
INTEGRATION: CWS mhu06 (1.3.12); FILE MERGED
2005/04/22 11:45:48 mhu 1.3.12.1: #i47753# Adapted to moved resources (from 'svt' to 'fps_office').
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/unx/gnome/resourceprovider.cxx45
1 files changed, 37 insertions, 8 deletions
diff --git a/fpicker/source/unx/gnome/resourceprovider.cxx b/fpicker/source/unx/gnome/resourceprovider.cxx
index 57eacf310e07..8a527a43b927 100644
--- a/fpicker/source/unx/gnome/resourceprovider.cxx
+++ b/fpicker/source/unx/gnome/resourceprovider.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: resourceprovider.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: obo $ $Date: 2005-03-18 09:49:44 $
+ * last change: $Author: obo $ $Date: 2005-04-27 08:53:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -110,7 +110,8 @@ using namespace ::com::sun::star::ui::dialogs::CommonFilePickerElementIds;
//
//------------------------------------------------------------
-#define RES_NAME svt
+#define RES_NAME fps_office
+#define OTHER_RES_NAME svt
//------------------------------------------------------------
// we have to translate control ids to resource ids
@@ -136,13 +137,18 @@ _Entry CtrlIdToResIdTable[] = {
{ CHECKBOX_SELECTION, STR_SVT_FILEPICKER_SELECTION },
{ FOLDERPICKER_TITLE, STR_SVT_FOLDERPICKER_DEFAULT_TITLE },
{ FOLDER_PICKER_DEF_DESCRIPTION, STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION },
+ { FILE_PICKER_OVERWRITE, STR_SVT_ALREADYEXISTOVERWRITE }
+};
+
+_Entry OtherCtrlIdToResIdTable[] = {
{ FILE_PICKER_TITLE_OPEN, STR_FILEDLG_OPEN },
{ FILE_PICKER_TITLE_SAVE, STR_FILEDLG_SAVE },
{ FILE_PICKER_FILE_TYPE, STR_FILEDLG_TYPE },
- { FILE_PICKER_OVERWRITE, STR_SVT_ALREADYEXISTOVERWRITE }
};
+
const sal_Int32 SIZE_TABLE = sizeof( CtrlIdToResIdTable ) / sizeof( _Entry );
+const sal_Int32 OTHER_SIZE_TABLE = sizeof( OtherCtrlIdToResIdTable ) / sizeof( _Entry );
//------------------------------------------------------------
//
@@ -164,6 +170,22 @@ sal_Int16 CtrlIdToResId( sal_Int32 aControlId )
return aResId;
}
+sal_Int16 OtherCtrlIdToResId( sal_Int32 aControlId )
+{
+ sal_Int16 aResId = -1;
+
+ for ( sal_Int32 i = 0; i < OTHER_SIZE_TABLE; i++ )
+ {
+ if ( OtherCtrlIdToResIdTable[i].ctrlId == aControlId )
+ {
+ aResId = OtherCtrlIdToResIdTable[i].resId;
+ break;
+ }
+ }
+
+ return aResId;
+}
+
//------------------------------------------------------------
//
//------------------------------------------------------------
@@ -179,6 +201,7 @@ public:
CResourceProvider_Impl( )
{
m_ResMgr = CREATEVERSIONRESMGR( RES_NAME );
+ m_OtherResMgr = CREATEVERSIONRESMGR( OTHER_RES_NAME );
}
//-------------------------------------
@@ -188,6 +211,7 @@ public:
~CResourceProvider_Impl( )
{
delete m_ResMgr;
+ delete m_OtherResMgr;
}
//-------------------------------------
@@ -203,16 +227,20 @@ public:
try
{
- OSL_ASSERT( m_ResMgr );
+ OSL_ASSERT( m_ResMgr && m_OtherResMgr );
// translate the control id to a resource id
sal_Int16 aResId = CtrlIdToResId( aId );
-
if ( aResId > -1 )
- {
aResString = String( ResId( aResId, m_ResMgr ) );
+ else
+ {
+ aResId = OtherCtrlIdToResId( aId );
+ if ( aResId > -1 )
+ aResString = String( ResId( aResId, m_OtherResMgr ) );
+ }
+ if ( aResId > -1 )
aResOUString = OUString( aResString );
- }
}
catch(...)
{
@@ -223,6 +251,7 @@ public:
public:
ResMgr* m_ResMgr;
+ ResMgr* m_OtherResMgr;
};
//------------------------------------------------------------