[ooo-build-commit] Branch 'ooo/master' - 4 commits - basctl/inc basctl/sdi basctl/source basctl/uiconfig extensions/source setup_native/source wizards/source
Jan Holesovsky
kendy at kemper.freedesktop.org
Fri Sep 11 19:25:55 PDT 2009
basctl/inc/basidesh.hrc | 9
basctl/sdi/baside.sdi | 6
basctl/source/basicide/baside2.cxx | 14
basctl/source/basicide/baside2.hxx | 1
basctl/source/basicide/baside3.cxx | 408 +++++++++-
basctl/source/basicide/basides3.cxx | 10
basctl/source/basicide/basidesh.src | 42 +
basctl/source/inc/baside3.hxx | 5
basctl/source/inc/basidesh.hxx | 3
basctl/uiconfig/basicide/toolbar/dialogbar.xml | 5
basctl/uiconfig/basicide/toolbar/macrobar.xml | 6
extensions/source/oooimprovecore/makefile.mk | 3
extensions/source/oooimprovement/errormail.cxx | 6
extensions/source/oooimprovement/makefile.mk | 4
setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx | 20
wizards/source/euro/Init.xba | 65 +
wizards/source/euro/euro.src | 17
wizards/source/importwizard/ImportDialog.xdl | 2
wizards/source/schedule/LocalHolidays.xba | 4
19 files changed, 609 insertions(+), 21 deletions(-)
New commits:
commit 211de8808b4d2d657c77e46cc368233c5aa676d3
Author: Kurt Zenker <kz at openoffice.org>
Date: Fri Sep 11 16:49:12 2009 +0000
CWS-TOOLING: integrate CWS extras320
2009-09-09 07:44:31 +0200 jsk r275963 : #i104797# - changed number of currencies from 13 to 16
2009-08-20 10:20:49 +0200 va r275169 : #i99047# Added Font Hinting
2009-08-18 12:50:42 +0200 va r275092 : #i99047# Added Font Hinting
2009-08-18 10:44:16 +0200 va r275083 : #i104220# French Holiday: Added Whit Sunday
2009-08-14 11:46:39 +0200 va r274973 : #i104220# Corrected French Holidays
2009-08-11 17:51:29 +0200 va r274872 : #i98254# Button for Logfile expanded.
2009-08-11 17:28:09 +0200 va r274870 : #i103011# Added latest 3 Euro Countries
2009-08-11 17:27:48 +0200 va r274869 : #i103011# Added latest 3 Euro Countries
2009-08-11 17:17:41 +0200 va r274868 : #i102567# Updated AutoCorrection
2009-08-11 17:16:59 +0200 va r274867 : #i102567# Updated AutoCorrection
2009-08-11 17:16:27 +0200 va r274866 : #i102567# Updated AutoCorrection
diff --git a/wizards/source/euro/Init.xba b/wizards/source/euro/Init.xba
index baedb65..45fdafd 100644
--- a/wizards/source/euro/Init.xba
+++ b/wizards/source/euro/Init.xba
@@ -68,6 +68,9 @@ Public sCurrAUSTRIAN as String
Public sCurrFINNISH as String
Public sCurrGREEK as String
Public sCurrSLOVENIAN as String
+Public sCurrCYPRIOT as String
+Public sCurrMALTESE as String
+Public sCurrSLOVAK as String
Public sCurrUNKNOWN as String
Public sCurrSYSUNKNOWN as String
@@ -76,7 +79,7 @@ Public sPrgsCONVERTING as String
Public sPrgsUNPROTECT as String
Public sInclusiveSubDir as String
-Public Const SBCOUNTRYCOUNT = 12
+Public Const SBCOUNTRYCOUNT = 15
Public CurMimeType as String
Public CurCellCount as Long
Public oSheets as Object
@@ -112,8 +115,8 @@ Public CurExtension(2) as String
Public Currfactor as Double
Public CurrSymbolList(2) as String
Public CurrLanguage as String
-Public CurrValue(12,5)
-Public LangIDValue(12,2,2) as String
+Public CurrValue(15,5)
+Public LangIDValue(15,2,2) as String
Public PreName as String
Public Separator as String
Public BitmapDir as String
@@ -189,8 +192,11 @@ Dim LocWorkPath as String
sCurrFINNISH = GetResText(1510)
sCurrGREEK = GetResText(1511)
sCurrSLOVENIAN = GetResText(1512)
- sCurrUNKNOWN = GetResText(1513)
- sCurrSYSUNKNOWN = GetResText(1514)
+ sCurrCYPRIOT = GetResText(1513)
+ sCurrMALTESE = GetResText(1514)
+ sCurrSLOVAK = GetResText(1515)
+ sCurrUNKNOWN = GetResText(1516)
+ sCurrSYSUNKNOWN = GetResText(1517)
.cmdCancel.Label = sCANCEL
.cmdHelp.Label = sHELP
.cmdBack.Label = GetResText(1002)
@@ -299,6 +305,10 @@ Sub InitializeLanguages()
LangIDValue(7,0,1) = "IE"
LangIDValue(7,0,2) = "-1809"
+ LangIDValue(7,1,0) = "ga"
+ LangIDValue(7,1,1) = "IE"
+ LangIDValue(7,1,2) = "-83C"
+
' CURRENCIES_LUXEMBOURG
LangIDValue(8,0,0) = "fr"
LangIDValue(8,0,1) = "LU"
@@ -330,7 +340,23 @@ Sub InitializeLanguages()
' CURRENCIES_SLOVENIAN
LangIDValue(12,0,0) = "sl"
LangIDValue(12,0,1) = "SI"
- LangIDValue(12,0,2) = "-408"
+ LangIDValue(12,0,2) = "-424"
+
+' CURRENCIES_CYPRIOT
+ LangIDValue(13,0,0) = "el"
+ LangIDValue(13,0,1) = "CY"
+ LangIDValue(13,0,2) = "-408"
+
+' CURRENCIES_MALTESE
+ LangIDValue(14,0,0) = "mt"
+ LangIDValue(14,0,1) = "MT"
+ LangIDValue(14,0,2) = "-43A"
+
+' CURRENCIES_SLOVAK
+ LangIDValue(15,0,0) = "sk"
+ LangIDValue(15,0,1) = "SK"
+ LangIDValue(15,0,2) = "-41B"
+
End Sub
@@ -456,6 +482,33 @@ Dim i as Integer
CurrValue(12,4) = "SIT"
CurrValue(12,5) = "SIT"
+ CurrValue(13,0) = sCurrCYPRIOT
+ ' real conversion rate
+ CurrValue(13,1) = 0.585274
+ ' rounded conversion rate
+ CurrValue(13,2) = 0.6
+ CurrValue(13,3) = "£C"
+ CurrValue(13,4) = "£"
+ CurrValue(13,5) = "CYP"
+
+ CurrValue(14,0) = sCurrMALTESE
+ ' real conversion rate
+ CurrValue(14,1) = 0.429300
+ ' rounded conversion rate
+ CurrValue(14,2) = 0.4
+ CurrValue(14,3) = chr(8356)
+ CurrValue(14,4) = "Lm"
+ CurrValue(14,5) = "MTL"
+
+ CurrValue(15,0) = sCurrSLOVAK
+ ' real conversion rate
+ CurrValue(15,1) = 30.1260
+ ' rounded conversion rate
+ CurrValue(15,2) = 30
+ CurrValue(15,3) = "Sk"
+ CurrValue(15,4) = "Sk"
+ CurrValue(15,5) = "SKK"
+
i = -1
CurrSymbolList(0) = ""
CurrSymbolList(1) = ""
diff --git a/wizards/source/euro/euro.src b/wizards/source/euro/euro.src
index e39a0d3..da6bad8 100644
--- a/wizards/source/euro/euro.src
+++ b/wizards/source/euro/euro.src
@@ -429,11 +429,26 @@ Text [ en-US ] = "Slovenian Tolar";
String CURRENCIES + 13
{
-Text [ en-US ] = "The currency set for the document is not a European currency!";
+Text [ en-US ] = "Cypriot Pound";
};
String CURRENCIES + 14
{
+Text [ en-US ] = "Maltese Lira";
+};
+
+String CURRENCIES + 15
+{
+Text [ en-US ] = "Slovak Koruna";
+};
+
+String CURRENCIES + 16
+{
+Text [ en-US ] = "The currency set for the document is not a European currency!";
+};
+
+String CURRENCIES + 17
+{
Text [ en-US ] = "The language set for your operating system is not a language of the European Monetary Union.";
};
diff --git a/wizards/source/importwizard/ImportDialog.xdl b/wizards/source/importwizard/ImportDialog.xdl
index dbc7e11..082c06b 100644
--- a/wizards/source/importwizard/ImportDialog.xdl
+++ b/wizards/source/importwizard/ImportDialog.xdl
@@ -89,7 +89,7 @@
<dlg:fixedline dlg:id="hlnDocuments" dlg:tab-index="42" dlg:left="6" dlg:top="110" dlg:width="258" dlg:height="8" dlg:page="2" dlg:value="hlnDocuments"/>
<dlg:fixedline dlg:id="FixedLine1" dlg:tab-index="43" dlg:left="6" dlg:top="181" dlg:width="258" dlg:height="6"/>
<dlg:fixedline dlg:id="hlnProgress" dlg:tab-index="44" dlg:left="6" dlg:top="55" dlg:width="258" dlg:height="8" dlg:page="4" dlg:value="hlnProgress"/>
- <dlg:button dlg:id="cmdShowLogFile" dlg:tab-index="45" dlg:disabled="true" dlg:left="105" dlg:top="142" dlg:width="60" dlg:height="14" dlg:page="4" dlg:value="cmdShowLogFile">
+ <dlg:button dlg:id="cmdShowLogFile" dlg:tab-index="45" dlg:disabled="true" dlg:left="75" dlg:top="142" dlg:width="120" dlg:height="14" dlg:page="4" dlg:value="cmdShowLogFile">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.FilesModul.OpenLogDocument?language=Basic&location=application" script:language="Script"/>
</dlg:button>
</dlg:bulletinboard>
diff --git a/wizards/source/schedule/LocalHolidays.xba b/wizards/source/schedule/LocalHolidays.xba
index 7c7d46c..0b347c0 100644
--- a/wizards/source/schedule/LocalHolidays.xba
+++ b/wizards/source/schedule/LocalHolidays.xba
@@ -13,8 +13,10 @@ Dim lDate&
CalInsertBankholiday(DateSerial(YearInt, 1, 1), "Jour de l'an", cHolidayType_Full)
lEasterDate = CalEasterTable(YearInt)
CalInsertBankholiday(lEasterDate, "Pâques", cHolidayType_Full)
- CalInsertBankholiday(lEasterDate + 10, "Pentecôte", cHolidayType_Full)
+ CalInsertBankholiday(lEasterDate + 1, "Lundi de Pâques", cHolidayType_Full)
CalInsertBankholiday(lEasterDate + 39, "Ascension", cHolidayType_Full)
+ CalInsertBankholiday(lEasterDate + 49, "Pentecôte", cHolidayType_Full)
+ CalInsertBankholiday(lEasterDate + 50, "Lundi de Pentecôte", cHolidayType_Full)
CalInsertBankholiday(DateSerial(YearInt, 5, 1), "Fête du travail", cHolidayType_Full)
CalInsertBankholiday(DateSerial(YearInt, 5, 8), "Victoire 1945", cHolidayType_Full)
CalInsertBankholiday(DateSerial(YearInt, 7, 14), "Fête Nationale", cHolidayType_Full)
commit 8a8f86ee144e0a9909cf0e579c238b85b093853d
Author: Kurt Zenker <kz at openoffice.org>
Date: Fri Sep 11 11:51:21 2009 +0000
CWS-TOOLING: integrate CWS dv14
2009-09-10 15:16:32 +0200 sg r276035 : #160513# updated wfs scheme to accept ports
2009-09-10 07:41:47 +0200 dv r276019 : #i104942# Better renaming algorithmen
2009-08-31 13:41:11 +0200 dv r275604 : #160505# Setting APP1PRODUCTNAME must not overwrite APP1PRODUCTDEF
diff --git a/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx b/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx
index 0cab3d8..bd3e69f 100644
--- a/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx
@@ -194,6 +194,18 @@ extern "C" UINT __stdcall RenamePrgFolder( MSIHANDLE handle )
// MessageBox(NULL, sRenameSrc.c_str(), "OFFICEINSTALLLOCATION", MB_OK);
bool bSuccess = MoveFile( sRenameSrc.c_str(), sRenameDst.c_str() );
+ if ( !bSuccess )
+ {
+ TCHAR sAppend[2] = TEXT("0");
+ for ( int i = 0; i < 10; i++ )
+ {
+ sRenameDst = sOfficeInstallPath + TEXT("program_old") + sAppend;
+ bSuccess = MoveFile( sRenameSrc.c_str(), sRenameDst.c_str() );
+ if ( bSuccess )
+ break;
+ sAppend[0] += 1;
+ }
+ }
#if 0
if ( !bSuccess )
@@ -214,6 +226,14 @@ extern "C" UINT __stdcall RemovePrgFolder( MSIHANDLE handle )
bool bSuccess = RemoveCompleteDirectory( sRemoveDir );
+ TCHAR sAppend[2] = TEXT("0");
+ for ( int i = 0; i < 10; i++ )
+ {
+ sRemoveDir = sOfficeInstallPath + TEXT("program_old") + sAppend;
+ bSuccess = RemoveCompleteDirectory( sRemoveDir );
+ sAppend[0] += 1;
+ }
+
#if 0
if ( bSuccess )
MessageBox(NULL, "Removing folder successful", "RemovePrgFolder", MB_OK);
commit f34db03d785abc3414bd7a678121f2c36cc6abaa
Author: Kurt Zenker <kz at openoffice.org>
Date: Fri Sep 11 09:40:28 2009 +0000
CWS-TOOLING: integrate CWS ab70
2009-09-10 15:12:54 +0200 jsk r276034 : #i85434# - mandatory automatic update test
2009-09-10 15:11:06 +0200 jsk r276033 : #i85434# - mandatory automatic update test
2009-09-02 09:49:24 +0200 ab r275698 : #i85434# Dialog Import
diff --git a/basctl/inc/basidesh.hrc b/basctl/inc/basidesh.hrc
index a4e944b..e499563 100644
--- a/basctl/inc/basidesh.hrc
+++ b/basctl/inc/basidesh.hrc
@@ -176,6 +176,15 @@
#define RID_STR_EXPORTBASIC ( RID_BASICIDE_START + 101 )
#define RID_STR_PACKAGE_BUNDLE ( RID_BASICIDE_START + 102 )
+#define RID_STR_DLGIMP_CLASH_RENAME ( RID_BASICIDE_START + 110 )
+#define RID_STR_DLGIMP_CLASH_REPLACE ( RID_BASICIDE_START + 111 )
+#define RID_STR_DLGIMP_CLASH_TITLE ( RID_BASICIDE_START + 112 )
+#define RID_STR_DLGIMP_CLASH_TEXT ( RID_BASICIDE_START + 113 )
+#define RID_STR_DLGIMP_MISMATCH_ADD ( RID_BASICIDE_START + 114 )
+#define RID_STR_DLGIMP_MISMATCH_OMIT ( RID_BASICIDE_START + 115 )
+#define RID_STR_DLGIMP_MISMATCH_TITLE ( RID_BASICIDE_START + 116 )
+#define RID_STR_DLGIMP_MISMATCH_TEXT ( RID_BASICIDE_START + 117 )
+
#endif // _SVX_NOIDERESIDS
#endif // _BASIDESH_HRC
diff --git a/basctl/sdi/baside.sdi b/basctl/sdi/baside.sdi
index 727ac88..469f770 100644
--- a/basctl/sdi/baside.sdi
+++ b/basctl/sdi/baside.sdi
@@ -416,6 +416,12 @@ shell BasicIDEShell
StateMethod = GetState;
]
+ SID_IMPORT_DIALOG
+ [
+ ExecMethod = ExecuteDialog;
+ StateMethod = GetState;
+ ]
+
SID_DIALOG_TESTMODE
[
ExecMethod = ExecuteDialog;
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index d5b3852..3b330d7 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -538,6 +538,15 @@ BOOL ModulWindow::SaveBasicSource()
return bDone;
}
+BOOL implImportDialog( Window* pWin, const String& rCurPath, const ScriptDocument& rDocument, const String& aLibName );
+
+BOOL ModulWindow::ImportDialog()
+{
+ const ScriptDocument& rDocument = GetDocument();
+ String aLibName = GetLibName();
+ BOOL bRet = implImportDialog( this, aCurPath, rDocument, aLibName );
+ return bRet;
+}
BOOL ModulWindow::ToggleBreakPoint( ULONG nLine )
{
@@ -1016,6 +1025,11 @@ void __EXPORT ModulWindow::ExecuteCommand( SfxRequest& rReq )
SaveBasicSource();
}
break;
+ case SID_IMPORT_DIALOG:
+ {
+ ImportDialog();
+ }
+ break;
case SID_BASICIDE_MATCHGROUP:
{
if ( !GetEditView()->MatchGroup() )
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index f16c94c..7b507c3 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -403,6 +403,7 @@ public:
BOOL LoadBasic();
BOOL SaveBasicSource();
+ BOOL ImportDialog();
void EditMacro( const String& rMacroName );
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index 9e261a5..caceda3 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -46,6 +46,7 @@
#include <ide_pch.hxx>
+#include <vector>
#include <basidesh.hrc>
#include <baside3.hxx>
#include <localizationmgr.hxx>
@@ -63,6 +64,7 @@
#include <helpid.hrc>
#include <bastype2.hxx>
#include <svx/svdview.hxx>
+#include <svx/unolingu.hxx>
#include <tools/diagnose_ex.h>
#include <tools/urlobj.hxx>
#include <comphelper/processfactory.hxx>
@@ -73,6 +75,7 @@
#include <com/sun/star/script/XLibraryContainer2.hpp>
#endif
#include <svtools/ehdl.hxx>
+#include <svtools/langtab.hxx>
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
@@ -638,6 +641,10 @@ void __EXPORT DialogWindow::ExecuteCommand( SfxRequest& rReq )
case SID_EXPORT_DIALOG:
SaveDialog();
break;
+
+ case SID_IMPORT_DIALOG:
+ ImportDialog();
+ break;
}
rReq.Done();
@@ -859,7 +866,406 @@ BOOL DialogWindow::SaveDialog()
return bDone;
}
-
+extern bool localesAreEqual( const ::com::sun::star::lang::Locale& rLocaleLeft,
+ const ::com::sun::star::lang::Locale& rLocaleRight );
+
+std::vector< lang::Locale > implGetLanguagesOnlyContainedInFirstSeq
+ ( Sequence< lang::Locale > aFirstSeq, Sequence< lang::Locale > aSecondSeq )
+{
+ std::vector< lang::Locale > avRet;
+
+ const lang::Locale* pFirst = aFirstSeq.getConstArray();
+ const lang::Locale* pSecond = aSecondSeq.getConstArray();
+ sal_Int32 nFirstCount = aFirstSeq.getLength();
+ sal_Int32 nSecondCount = aSecondSeq.getLength();
+
+ for( sal_Int32 iFirst = 0 ; iFirst < nFirstCount ; iFirst++ )
+ {
+ const lang::Locale& rFirstLocale = pFirst[ iFirst ];
+
+ bool bAlsoContainedInSecondSeq = false;
+ for( sal_Int32 iSecond = 0 ; iSecond < nSecondCount ; iSecond++ )
+ {
+ const lang::Locale& rSecondLocale = pSecond[ iSecond ];
+
+ bool bMatch = localesAreEqual( rFirstLocale, rSecondLocale );
+ if( bMatch )
+ {
+ bAlsoContainedInSecondSeq = true;
+ break;
+ }
+ }
+
+ if( !bAlsoContainedInSecondSeq )
+ avRet.push_back( rFirstLocale );
+ }
+
+ return avRet;
+}
+
+
+class NameClashQueryBox : public MessBox
+{
+public:
+ NameClashQueryBox( Window* pParent,
+ const XubString& rTitle, const XubString& rMessage );
+};
+
+NameClashQueryBox::NameClashQueryBox( Window* pParent,
+ const XubString& rTitle, const XubString& rMessage )
+ : MessBox( pParent, 0, rTitle, rMessage )
+{
+ if ( rTitle.Len() )
+ SetText( rTitle );
+
+ maMessText = rMessage;
+
+ AddButton( String( IDEResId( RID_STR_DLGIMP_CLASH_RENAME ) ), RET_YES,
+ BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
+ AddButton( String( IDEResId( RID_STR_DLGIMP_CLASH_REPLACE ) ), RET_NO, 0 );
+ AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
+
+ SetImage( GetSettings().GetStyleSettings().GetDialogColor().IsDark() ?
+ QueryBox::GetStandardImageHC() : QueryBox::GetStandardImage() );
+}
+
+
+class LanguageMismatchQueryBox : public MessBox
+{
+public:
+ LanguageMismatchQueryBox( Window* pParent,
+ const XubString& rTitle, const XubString& rMessage );
+};
+
+LanguageMismatchQueryBox::LanguageMismatchQueryBox( Window* pParent,
+ const XubString& rTitle, const XubString& rMessage )
+ : MessBox( pParent, 0, rTitle, rMessage )
+{
+ if ( rTitle.Len() )
+ SetText( rTitle );
+
+ maMessText = rMessage;
+ AddButton( String( IDEResId( RID_STR_DLGIMP_MISMATCH_ADD ) ), RET_YES,
+ BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
+ AddButton( String( IDEResId( RID_STR_DLGIMP_MISMATCH_OMIT ) ), RET_NO, 0 );
+ AddButton( BUTTON_CANCEL, RET_CANCEL, BUTTONDIALOG_CANCELBUTTON );
+ AddButton( BUTTON_HELP, BUTTONID_HELP, BUTTONDIALOG_HELPBUTTON, 4 );
+
+ SetImage( GetSettings().GetStyleSettings().GetDialogColor().IsDark() ?
+ QueryBox::GetStandardImageHC() : QueryBox::GetStandardImage() );
+}
+
+BOOL implImportDialog( Window* pWin, const String& rCurPath, const ScriptDocument& rDocument, const String& aLibName )
+{
+ BOOL bDone = FALSE;
+
+ Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() );
+ Reference < XFilePicker > xFP;
+ if( xMSF.is() )
+ {
+ Sequence <Any> aServiceType(1);
+ aServiceType[0] <<= TemplateDescription::FILEOPEN_SIMPLE;
+ xFP = Reference< XFilePicker >( xMSF->createInstanceWithArguments(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ), aServiceType ), UNO_QUERY );
+ }
+
+ Reference< XFilePickerControlAccess > xFPControl(xFP, UNO_QUERY);
+ xFPControl->enableControl(ExtendedFilePickerElementIds::CHECKBOX_PASSWORD, sal_False);
+ Any aValue;
+ aValue <<= (sal_Bool) sal_True;
+ xFPControl->setValue(ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, 0, aValue);
+
+ String aCurPath( rCurPath );
+ if ( aCurPath.Len() )
+ xFP->setDisplayDirectory ( aCurPath );
+
+ String aDialogStr( IDEResId( RID_STR_STDDIALOGNAME ) );
+ Reference< XFilterManager > xFltMgr(xFP, UNO_QUERY);
+ xFltMgr->appendFilter( aDialogStr, String( RTL_CONSTASCII_USTRINGPARAM( "*.xdl" ) ) );
+ xFltMgr->appendFilter( String( IDEResId( RID_STR_FILTER_ALLFILES ) ), String( RTL_CONSTASCII_USTRINGPARAM( FILTERMASK_ALL ) ) );
+ xFltMgr->setCurrentFilter( aDialogStr );
+
+ if( xFP->execute() == RET_OK )
+ {
+ Sequence< ::rtl::OUString > aPaths = xFP->getFiles();
+ aCurPath = aPaths[0];
+
+ ::rtl::OUString aBasePath;
+ ::rtl::OUString aOUCurPath( aCurPath );
+ sal_Int32 iSlash = aOUCurPath.lastIndexOf( '/' );
+ if( iSlash != -1 )
+ aBasePath = aOUCurPath.copy( 0, iSlash + 1 );
+
+ try
+ {
+ // create dialog model
+ Reference< container::XNameContainer > xDialogModel( xMSF->createInstance
+ ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialogModel" ) ) ), UNO_QUERY_THROW );
+
+ Reference< XSimpleFileAccess > xSFI( xMSF->createInstance
+ ( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY_THROW );
+
+ Reference< XInputStream > xInput;
+ if( xSFI->exists( aCurPath ) )
+ xInput = xSFI->openFileRead( aCurPath );
+
+ Reference< XComponentContext > xContext;
+ Reference< beans::XPropertySet > xProps( xMSF, UNO_QUERY );
+ OSL_ASSERT( xProps.is() );
+ OSL_VERIFY( xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext );
+ ::xmlscript::importDialogModel( xInput, xDialogModel, xContext );
+
+ String aXmlDlgName;
+ Reference< beans::XPropertySet > xDialogModelPropSet( xDialogModel, UNO_QUERY );
+ if( xDialogModelPropSet.is() )
+ {
+ try
+ {
+ Any aXmlDialogNameAny = xDialogModelPropSet->getPropertyValue( DLGED_PROP_NAME );
+ ::rtl::OUString aOUXmlDialogName;
+ aXmlDialogNameAny >>= aOUXmlDialogName;
+ aXmlDlgName = aOUXmlDialogName;
+ }
+ catch( beans::UnknownPropertyException& )
+ {}
+ }
+ bool bValidName = (aXmlDlgName.Len() != 0);
+ OSL_ASSERT( bValidName );
+ if( !bValidName )
+ return bDone;
+
+ bool bDialogAlreadyExists = rDocument.hasDialog( aLibName, aXmlDlgName );
+
+ String aNewDlgName = aXmlDlgName;
+ enum NameClashMode
+ {
+ NO_CLASH,
+ CLASH_OVERWRITE_DIALOG,
+ CLASH_RENAME_DIALOG,
+ };
+ NameClashMode eNameClashMode = NO_CLASH;
+ if( bDialogAlreadyExists )
+ {
+ String aQueryBoxTitle( IDEResId( RID_STR_DLGIMP_CLASH_TITLE ) );
+ String aQueryBoxText( IDEResId( RID_STR_DLGIMP_CLASH_TEXT ) );
+ aQueryBoxText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "$(ARG1)" ) ), aXmlDlgName );
+
+ NameClashQueryBox aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
+ USHORT nRet = aQueryBox.Execute();
+ if( RET_YES == nRet )
+ {
+ // RET_YES == Rename, see NameClashQueryBox::NameClashQueryBox
+ eNameClashMode = CLASH_RENAME_DIALOG;
+
+ aNewDlgName = rDocument.createObjectName( E_DIALOGS, aLibName );
+ }
+ else if( RET_NO == nRet )
+ {
+ // RET_NO == Replace, see NameClashQueryBox::NameClashQueryBox
+ eNameClashMode = CLASH_OVERWRITE_DIALOG;
+ }
+ else if( RET_CANCEL == nRet )
+ {
+ return bDone;
+ }
+ }
+
+ BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
+ if( pIDEShell == NULL )
+ {
+ OSL_ASSERT( pIDEShell != NULL );
+ return bDone;
+ }
+
+ // Resource?
+ ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale();
+ Reference< task::XInteractionHandler > xDummyHandler;
+ bool bReadOnly = true;
+ Reference< XStringResourceWithLocation > xImportStringResource =
+ StringResourceWithLocation::create( xContext, aBasePath, bReadOnly,
+ aLocale, aXmlDlgName, ::rtl::OUString(), xDummyHandler );
+
+ Sequence< lang::Locale > aImportLocaleSeq = xImportStringResource->getLocales();
+ sal_Int32 nImportLocaleCount = aImportLocaleSeq.getLength();
+
+ Reference< container::XNameContainer > xDialogLib( rDocument.getLibrary( E_DIALOGS, aLibName, TRUE ) );
+ Reference< resource::XStringResourceManager > xLibStringResourceManager = LocalizationMgr::getStringResourceFromDialogLibrary( xDialogLib );
+ sal_Int32 nLibLocaleCount = 0;
+ Sequence< lang::Locale > aLibLocaleSeq;
+ if( xLibStringResourceManager.is() )
+ {
+ aLibLocaleSeq = xLibStringResourceManager->getLocales();
+ nLibLocaleCount = aLibLocaleSeq.getLength();
+ }
+
+ // Check language matches
+ std::vector< lang::Locale > aOnlyInImportLanguages =
+ implGetLanguagesOnlyContainedInFirstSeq( aImportLocaleSeq, aLibLocaleSeq );
+ int nOnlyInImportLanguageCount = aOnlyInImportLanguages.size();
+
+ // For now: Keep languages from lib
+ bool bLibLocalized = (nLibLocaleCount > 0);
+ bool bImportLocalized = (nImportLocaleCount > 0);
+
+ bool bAddDialogLanguagesToLib = false;
+ if( nOnlyInImportLanguageCount > 0 )
+ {
+ String aQueryBoxTitle( IDEResId( RID_STR_DLGIMP_MISMATCH_TITLE ) );
+ String aQueryBoxText( IDEResId( RID_STR_DLGIMP_MISMATCH_TEXT ) );
+ LanguageMismatchQueryBox aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
+ USHORT nRet = aQueryBox.Execute();
+ if( RET_YES == nRet )
+ {
+ // RET_YES == Add, see LanguageMismatchQueryBox::LanguageMismatchQueryBox
+ bAddDialogLanguagesToLib = true;
+ }
+ // RET_NO == Omit, see LanguageMismatchQueryBox::LanguageMismatchQueryBox
+ // -> nothing to do here
+ //else if( RET_NO == nRet )
+ //{
+ //}
+ else if( RET_CANCEL == nRet )
+ {
+ return bDone;
+ }
+ }
+
+ if( bImportLocalized )
+ {
+ bool bCopyResourcesForDialog = true;
+ if( bAddDialogLanguagesToLib )
+ {
+ LocalizationMgr* pCurMgr = pIDEShell->GetCurLocalizationMgr();
+
+ lang::Locale aFirstLocale;
+ aFirstLocale = aOnlyInImportLanguages[0];
+ if( nOnlyInImportLanguageCount > 1 )
+ {
+ // Check if import default belongs to only import languages and use it then
+ lang::Locale aImportDefaultLocale = xImportStringResource->getDefaultLocale();
+ lang::Locale aTmpLocale;
+ for( int i = 0 ; i < nOnlyInImportLanguageCount ; ++i )
+ {
+ aTmpLocale = aOnlyInImportLanguages[i];
+ if( localesAreEqual( aImportDefaultLocale, aTmpLocale ) )
+ {
+ aFirstLocale = aImportDefaultLocale;
+ break;
+ }
+ }
+ }
+
+ Sequence< lang::Locale > aFirstLocaleSeq( 1 );
+ aFirstLocaleSeq[0] = aFirstLocale;
+ pCurMgr->handleAddLocales( aFirstLocaleSeq );
+
+ if( nOnlyInImportLanguageCount > 1 )
+ {
+ Sequence< lang::Locale > aRemainingLocaleSeq( nOnlyInImportLanguageCount - 1 );
+ lang::Locale aTmpLocale;
+ int iSeq = 0;
+ for( int i = 0 ; i < nOnlyInImportLanguageCount ; ++i )
+ {
+ aTmpLocale = aOnlyInImportLanguages[i];
+ if( !localesAreEqual( aFirstLocale, aTmpLocale ) )
+ aRemainingLocaleSeq[iSeq++] = aTmpLocale;
+ }
+ pCurMgr->handleAddLocales( aRemainingLocaleSeq );
+ }
+ }
+ else if( !bLibLocalized )
+ {
+ Reference< resource::XStringResourceManager > xImportStringResourceManager( xImportStringResource, UNO_QUERY );
+ LocalizationMgr::resetResourceForDialog( xDialogModel, xImportStringResourceManager );
+ bCopyResourcesForDialog = false;
+ }
+
+ if( bCopyResourcesForDialog )
+ {
+ Reference< resource::XStringResourceResolver > xImportStringResourceResolver( xImportStringResource, UNO_QUERY );
+ LocalizationMgr::copyResourceForDroppedDialog( xDialogModel, aXmlDlgName,
+ xLibStringResourceManager, xImportStringResourceResolver );
+ }
+ }
+ else if( bLibLocalized )
+ {
+ LocalizationMgr::setResourceIDsForDialog( xDialogModel, xLibStringResourceManager );
+ }
+
+
+ LocalizationMgr::setStringResourceAtDialog( rDocument, aLibName, aNewDlgName, xDialogModel );
+
+ if( eNameClashMode == CLASH_OVERWRITE_DIALOG )
+ {
+ if ( BasicIDE::RemoveDialog( rDocument, aLibName, aNewDlgName ) )
+ {
+ IDEBaseWindow* pDlgWin = pIDEShell->FindDlgWin( rDocument, aLibName, aNewDlgName, FALSE, TRUE );
+ if( pDlgWin != NULL )
+ pIDEShell->RemoveWindow( pDlgWin, TRUE );
+ BasicIDE::MarkDocumentModified( rDocument );
+ }
+ else
+ {
+ // TODO: Assertion?
+ return bDone;
+ }
+ }
+
+ if( eNameClashMode == CLASH_RENAME_DIALOG )
+ {
+ bool bRenamed = false;
+ if( xDialogModelPropSet.is() )
+ {
+ try
+ {
+ Any aXmlDialogNameAny;
+ aXmlDialogNameAny <<= ::rtl::OUString( aNewDlgName );
+ xDialogModelPropSet->setPropertyValue( DLGED_PROP_NAME, aXmlDialogNameAny );
+ bRenamed = true;
+ }
+ catch( beans::UnknownPropertyException& )
+ {}
+ }
+
+
+ if( bRenamed )
+ {
+ LocalizationMgr::renameStringResourceIDs( rDocument, aLibName, aNewDlgName, xDialogModel );
+ }
+ else
+ {
+ // TODO: Assertion?
+ return bDone;
+ }
+ }
+
+ Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext );
+ bool bSuccess = rDocument.insertDialog( aLibName, aNewDlgName, xISP );
+ if( bSuccess )
+ {
+ DialogWindow* pNewDlgWin = pIDEShell->CreateDlgWin( rDocument, aLibName, aNewDlgName );
+ pIDEShell->SetCurWindow( pNewDlgWin, TRUE );
+ }
+
+ bDone = TRUE;
+ }
+ catch( Exception& )
+ {}
+ }
+
+ return bDone;
+}
+
+BOOL DialogWindow::ImportDialog()
+{
+ DBG_CHKTHIS( DialogWindow, 0 );
+
+ const ScriptDocument& rDocument = GetDocument();
+ String aLibName = GetLibName();
+ BOOL bRet = implImportDialog( this, aCurPath, rDocument, aLibName );
+ return bRet;
+}
+
DlgEdModel* DialogWindow::GetModel() const
{
return pEditor ? pEditor->GetModel() : NULL;
diff --git a/basctl/source/basicide/basides3.cxx b/basctl/source/basicide/basides3.cxx
index 2133561..e29d67e 100644
--- a/basctl/source/basicide/basides3.cxx
+++ b/basctl/source/basicide/basides3.cxx
@@ -41,6 +41,7 @@
#define _SOLAR__PRIVATE 1
#include <basidesh.hxx>
+#include <baside2.hxx>
#include <baside3.hxx>
#include <basobj.hxx>
#include <localizationmgr.hxx>
@@ -170,9 +171,10 @@ SdrView* BasicIDEShell::GetCurDlgView() const
// Nur wenn Dialogfenster oben:
void __EXPORT BasicIDEShell::ExecuteDialog( SfxRequest& rReq )
{
- if ( !pCurWin || !pCurWin->IsA( TYPE( DialogWindow ) ) )
- return;
-
- pCurWin->ExecuteCommand( rReq );
+ if ( pCurWin && ( pCurWin->IsA( TYPE( DialogWindow) ) ||
+ (rReq.GetSlot() == SID_IMPORT_DIALOG &&pCurWin->IsA( TYPE( ModulWindow) ) ) ) )
+ {
+ pCurWin->ExecuteCommand( rReq );
+ }
}
diff --git a/basctl/source/basicide/basidesh.src b/basctl/source/basicide/basidesh.src
index 097d4df..4eb1e53 100644
--- a/basctl/source/basicide/basidesh.src
+++ b/basctl/source/basicide/basidesh.src
@@ -640,6 +640,48 @@ String RID_STR_TRANSLATION_DEFAULT
Text [ en-US ] = "[Default Language]" ;
};
+
+String RID_STR_DLGIMP_CLASH_RENAME
+{
+ Text [ en-US ] = "Rename" ;
+};
+
+String RID_STR_DLGIMP_CLASH_REPLACE
+{
+ Text [ en-US ] = "Replace" ;
+};
+
+String RID_STR_DLGIMP_CLASH_TITLE
+{
+ Text [ en-US ] = "Dialog Import - Name already used" ;
+};
+
+String RID_STR_DLGIMP_CLASH_TEXT
+{
+ Text [ en-US ] = "The library already contains a dialog with the name:\n\n$(ARG1)\n\nRename dialog to keep current dialog or replace existing dialog.\n " ;
+};
+
+String RID_STR_DLGIMP_MISMATCH_ADD
+{
+ Text [ en-US ] = "Add" ;
+};
+
+String RID_STR_DLGIMP_MISMATCH_OMIT
+{
+ Text [ en-US ] = "Omit" ;
+};
+
+String RID_STR_DLGIMP_MISMATCH_TITLE
+{
+ Text [ en-US ] = "Dialog Import - Language Mismatch" ;
+};
+
+String RID_STR_DLGIMP_MISMATCH_TEXT
+{
+ Text [ en-US ] = "The dialog to be imported supports other languages than the target library.\n\nAdd these languages to the library to keep additional language resources provided by the dialog or omit them to stay with the current library languages.\n\nNote: For languages not supported by the dialog the resources of the dialog's default language will be used.\n " ;
+};
+
+
#define MN_EDIT 20
#define MN_VIEW 21
#define MN_EXTRA 22
diff --git a/basctl/source/inc/baside3.hxx b/basctl/source/inc/baside3.hxx
index 408c045..16e31ca 100644
--- a/basctl/source/inc/baside3.hxx
+++ b/basctl/source/inc/baside3.hxx
@@ -37,6 +37,10 @@
#include <bastypes.hxx>
#include <svtools/undo.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/button.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/fixed.hxx>
#ifndef _COM_SUN_STAR_SCRIPT_XLIBRYARYCONTAINER_HPP_
#include <com/sun/star/script/XLibraryContainer.hpp>
@@ -94,6 +98,7 @@ public:
void DisableBrowser();
void UpdateBrowser();
BOOL SaveDialog();
+ BOOL ImportDialog();
virtual String GetTitle();
virtual BasicEntryDescriptor CreateEntryDescriptor();
diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx
index 65b7694..40f5a06 100644
--- a/basctl/source/inc/basidesh.hxx
+++ b/basctl/source/inc/basidesh.hxx
@@ -86,6 +86,7 @@ class BasicIDEShell :public SfxViewShell
{
friend class JavaDebuggingListenerImpl;
friend class LocalizationMgr;
+friend BOOL implImportDialog( Window* pWin, const String& rCurPath, const ScriptDocument& rDocument, const String& aLibName );
friend bool BasicIDE::RemoveDialog( const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName );
ObjectCatalog* pObjectCatalog;
@@ -147,7 +148,6 @@ protected:
DialogWindow* CreateDlgWin( const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName );
ModulWindow* FindBasWin( const ScriptDocument& rDocument, const String& rLibName, const String& rModName, BOOL bCreateIfNotExist, BOOL bFindSuspended = FALSE );
- DialogWindow* FindDlgWin( const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName, BOOL bCreateIfNotExist, BOOL bFindSuspended = FALSE );
ModulWindow* ShowActiveModuleWindow( StarBASIC* pBasic );
virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
@@ -219,6 +219,7 @@ public:
ModulWindowLayout* GetLayoutWindow() const { return pModulLayout; }
IDEBaseWindow* FindWindow( const ScriptDocument& rDocument, const String& rLibName = String(), const String& rName = String(), USHORT nType = BASICIDE_TYPE_UNKNOWN, BOOL bFindSuspended = FALSE );
+ DialogWindow* FindDlgWin( const ScriptDocument& rDocument, const String& rLibName, const String& rDlgName, BOOL bCreateIfNotExist, BOOL bFindSuspended = FALSE );
IDEBaseWindow* FindApplicationWindow();
BOOL NextPage( BOOL bPrev = FALSE );
diff --git a/basctl/uiconfig/basicide/toolbar/dialogbar.xml b/basctl/uiconfig/basicide/toolbar/dialogbar.xml
index afc409f..91b9a92 100644
--- a/basctl/uiconfig/basicide/toolbar/dialogbar.xml
+++ b/basctl/uiconfig/basicide/toolbar/dialogbar.xml
@@ -1,8 +1,9 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
<toolbar:toolbaritem xlink:href=".uno:LibSelector" />
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:ChooseControls" />
- <toolbar:toolbaritem xlink:href=".uno:ExportDialog" />
+ <toolbar:toolbaritem xlink:href=".uno:ImportDialog" />
+ <toolbar:toolbaritem xlink:href=".uno:ExportDialog" />
</toolbar:toolbar>
\ No newline at end of file
diff --git a/basctl/uiconfig/basicide/toolbar/macrobar.xml b/basctl/uiconfig/basicide/toolbar/macrobar.xml
index 8f08ba1..6e22bff 100644
--- a/basctl/uiconfig/basicide/toolbar/macrobar.xml
+++ b/basctl/uiconfig/basicide/toolbar/macrobar.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
<toolbar:toolbaritem xlink:href=".uno:LibSelector" toolbar:helpid="helpid:30787" />
@@ -17,4 +17,6 @@
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:LoadBasic" toolbar:helpid="helpid:5951" />
<toolbar:toolbaritem xlink:href=".uno:SaveBasicAs" toolbar:helpid="helpid:5953" />
-</toolbar:toolbar>
\ No newline at end of file
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:ImportDialog" />
+</toolbar:toolbar>
commit 02b2e0e19cd67ece2f4433187968ab2cea63fd79
Author: Kurt Zenker <kz at openoffice.org>
Date: Thu Sep 10 22:44:47 2009 +0000
CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
diff --git a/extensions/source/oooimprovecore/makefile.mk b/extensions/source/oooimprovecore/makefile.mk
index 74a9ad9..b527f16 100644
--- a/extensions/source/oooimprovecore/makefile.mk
+++ b/extensions/source/oooimprovecore/makefile.mk
@@ -52,6 +52,9 @@ LIB1FILES= \
$(SLB)$/$(TARGET).lib \
SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
+.IF "$(GUI)"=="OS2"
+SHL1TARGET=oooimpc$(DLLPOSTFIX)
+.ENDIF
SHL1STDLIBS= \
$(COMPHELPERLIB) \
diff --git a/extensions/source/oooimprovement/errormail.cxx b/extensions/source/oooimprovement/errormail.cxx
index e6a4070..6d755d8 100644
--- a/extensions/source/oooimprovement/errormail.cxx
+++ b/extensions/source/oooimprovement/errormail.cxx
@@ -37,7 +37,7 @@
#include <rtl/string.hxx>
#include <rtl/strbuf.hxx>
-#ifdef UNIX
+#if defined(UNIX) || defined(OS2)
#include <sys/utsname.h>
#endif
#ifdef WIN32
@@ -83,12 +83,14 @@ namespace {
return "Win32";
#elif defined UNIX
return "Unix";
+ #elif defined OS2
+ return "OS/2";
#else
return "Unknown";
#endif
};
-#ifdef UNIX
+#if defined(UNIX) || defined(OS2)
static const OString getLocale()
{
const char * locale = getenv( "LC_ALL" );
diff --git a/extensions/source/oooimprovement/makefile.mk b/extensions/source/oooimprovement/makefile.mk
index 41f91fc..f9b508b 100644
--- a/extensions/source/oooimprovement/makefile.mk
+++ b/extensions/source/oooimprovement/makefile.mk
@@ -70,6 +70,10 @@ SHL1STDLIBS= \
$(UNOTOOLSLIB) \
SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
+.IF "$(GUI)"=="OS2"
+SHL1TARGET= oooimp$(DLLPOSTFIX)
+.ENDIF
+
SHL1LIBS= $(SLB)$/$(TARGET).lib
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME= $(SHL1TARGET)
More information about the ooo-build-commit
mailing list