summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2010-01-14 19:11:13 +0100
committerPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2010-01-14 19:11:13 +0100
commitdb2e29794ffa161476c668e25cf4e86d19091665 (patch)
tree2018ae22146a57c74641468f9b67e9dc2a1b7ccf /basctl
parentf19e59318176c1952ad264996f9e0cee3e8e3982 (diff)
parent8a5b59989048d67b567819ee2038d4bff54ca184 (diff)
rebase to DEV300_m69
Diffstat (limited to 'basctl')
-rw-r--r--basctl/inc/pch/precompiled_basctl.hxx14
-rw-r--r--basctl/sdi/basslots.sdi8
-rw-r--r--basctl/sdi/makefile.mk8
-rw-r--r--basctl/source/basicide/basicbox.hxx2
-rw-r--r--basctl/source/basicide/baside2.cxx13
-rw-r--r--basctl/source/basicide/baside2.hxx16
-rw-r--r--basctl/source/basicide/baside2b.cxx27
-rw-r--r--basctl/source/basicide/baside3.cxx814
-rw-r--r--basctl/source/basicide/basides1.cxx2
-rw-r--r--basctl/source/basicide/basidesh.cxx2
-rw-r--r--basctl/source/basicide/basobj2.cxx2
-rw-r--r--basctl/source/basicide/basobj3.cxx2
-rw-r--r--basctl/source/basicide/bastype2.hxx2
-rw-r--r--basctl/source/basicide/ide_pch.hxx10
-rw-r--r--basctl/source/basicide/moduldl2.cxx2
-rw-r--r--basctl/source/basicide/objdlg.cxx2
-rw-r--r--basctl/source/basicide/scriptdocument.cxx2
-rw-r--r--basctl/source/basicide/tbxctl.cxx4
-rw-r--r--basctl/source/dlged/dlged.cxx2
-rw-r--r--basctl/source/inc/accessibledialogwindow.hxx2
-rw-r--r--basctl/source/inc/baside3.hxx2
-rw-r--r--basctl/source/inc/basobj.hxx2
-rw-r--r--basctl/source/inc/dlged.hxx4
-rw-r--r--basctl/source/inc/propbrw.hxx4
-rw-r--r--basctl/source/inc/sbxitem.hxx2
25 files changed, 478 insertions, 472 deletions
diff --git a/basctl/inc/pch/precompiled_basctl.hxx b/basctl/inc/pch/precompiled_basctl.hxx
index e975d6464194..be1612ea7429 100644
--- a/basctl/inc/pch/precompiled_basctl.hxx
+++ b/basctl/inc/pch/precompiled_basctl.hxx
@@ -77,19 +77,19 @@
#include "vcl/svapp.hxx"
#include "vcl/scrbar.hxx"
-#include "svtools/svarray.hxx"
-#include "svtools/itempool.hxx"
-#include "svtools/itemset.hxx"
-#include "svtools/aeitem.hxx"
-#include "svtools/stritem.hxx"
-#include "svtools/whiter.hxx"
+#include "svl/svarray.hxx"
+#include "svl/itempool.hxx"
+#include "svl/itemset.hxx"
+#include "svl/aeitem.hxx"
+#include "svl/stritem.hxx"
+#include "svl/whiter.hxx"
#include "svtools/langtab.hxx"
#include "svtools/texteng.hxx"
#include "svtools/textview.hxx"
#include "svtools/xtextedt.hxx"
#include "svtools/txtattr.hxx"
#include "svtools/textwindowpeer.hxx"
-#include "svtools/urihelper.hxx"
+#include "svl/urihelper.hxx"
#define _BASIC_TEXTPORTIONS
#include "basic/sbdef.hxx"
diff --git a/basctl/sdi/basslots.sdi b/basctl/sdi/basslots.sdi
index bb9cd1172af9..d2b3cb602ab8 100644
--- a/basctl/sdi/basslots.sdi
+++ b/basctl/sdi/basslots.sdi
@@ -28,8 +28,6 @@
*
************************************************************************/
-import "svxslots.ilb"
-
module
"6706E0E7-FB05-101B-804c-04021c007002"
"6806E0E7-FB05-101B-804c-04021c007002"
@@ -37,10 +35,14 @@ BasicIDE
[
HelpText( "BasicIDE" )
SlotIdFile( "basslots.hrc" )
-TypeLibFile( "basslots.tlb" )
]
{
//=========================================================================
+ include "sfx2/sfxitems.sdi"
+ include "sfx2/sfx.sdi"
+ include "svx/svxitems.sdi"
+ include "svx/xoitems.sdi"
+ include "svx/svx.sdi"
include "baside.sdi"
diff --git a/basctl/sdi/makefile.mk b/basctl/sdi/makefile.mk
index d94921bf9ae2..2244eafcd654 100644
--- a/basctl/sdi/makefile.mk
+++ b/basctl/sdi/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -45,7 +45,11 @@ SDI1EXPORT=basctl
# --- Files --------------------------------------------------------
SVSDI1DEPEND= \
- $(SOLARINCXDIR)$/svxslots.ilb \
+ $(SOLARINCXDIR)$/sfx2/sfx.sdi \
+ $(SOLARINCXDIR)$/sfx2/sfxitems.sdi \
+ $(SOLARINCXDIR)$/svx/svx.sdi \
+ $(SOLARINCXDIR)$/svx/svxitems.sdi \
+ $(SOLARINCXDIR)$/svx/xoitems.sdi \
baside.sdi
# --- Targets -------------------------------------------------------
diff --git a/basctl/source/basicide/basicbox.hxx b/basctl/source/basicide/basicbox.hxx
index e21a0c9d09c6..25f47c980c5d 100644
--- a/basctl/source/basicide/basicbox.hxx
+++ b/basctl/source/basicide/basicbox.hxx
@@ -32,7 +32,7 @@
#define _BASICBOX_HXX
#include "doceventnotifier.hxx"
-#include <svtools/stritem.hxx>
+#include <svl/stritem.hxx>
#include <svheader.hxx>
#include <sfx2/tbxctrl.hxx>
#include <vcl/lstbox.hxx>
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 9d0a5fc38c7a..6612f82fb92b 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -1446,7 +1446,7 @@ ModulWindowLayout::ModulWindowLayout( Window* pParent ) :
m_aSyntaxColors[TT_UNKNOWN] = aColor;
m_aSyntaxColors[TT_WHITESPACE] = aColor;
m_aSyntaxColors[TT_EOL] = aColor;
- StartListening(m_aColorConfig);
+ m_aColorConfig.AddListener(this);
m_aSyntaxColors[TT_IDENTIFIER]
= Color(m_aColorConfig.GetColorValue(svtools::BASICIDENTIFIER).nColor);
m_aSyntaxColors[TT_NUMBER]
@@ -1474,7 +1474,7 @@ ModulWindowLayout::ModulWindowLayout( Window* pParent ) :
ModulWindowLayout::~ModulWindowLayout()
{
- EndListening(m_aColorConfig);
+ m_aColorConfig.RemoveListener(this);
}
void __EXPORT ModulWindowLayout::Resize()
@@ -1618,7 +1618,7 @@ void ModulWindowLayout::DockaWindow( DockingWindow* pDockingWindow )
// evtl. Sonderbehandlung...
ArrangeWindows();
}
-#ifndef PRODUCT
+#ifdef DBG_UTIL
else
DBG_ERROR( "Wer will sich denn hier andocken ?" );
#endif
@@ -1668,13 +1668,8 @@ void ModulWindowLayout::DataChanged(DataChangedEvent const & rDCEvt)
}
// virtual
-void ModulWindowLayout::Notify(SfxBroadcaster & rBc, SfxHint const & rHint)
+void ModulWindowLayout::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 )
{
- (void)rBc;
-
- if (rHint.ISA(SfxSimpleHint)
- && (static_cast< SfxSimpleHint const & >(rHint).GetId()
- == SFX_HINT_COLORS_CHANGED))
{
Color aColor(m_aColorConfig.GetColorValue(svtools::BASICIDENTIFIER).
nColor);
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index 0559e1d9c474..25a04b0da6ab 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -48,7 +48,7 @@ class SvxSearchItem;
#endif
#include <basic/sbmod.hxx>
#include <vcl/split.hxx>
-#include "svtools/lstner.hxx"
+#include "svl/lstner.hxx"
#include <svtools/colorcfg.hxx>
#include <sfx2/progress.hxx>
@@ -58,6 +58,10 @@ DBG_NAMEEX( ModulWindow )
#define MARKER_NOMARKER 0xFFFF
+namespace utl
+{
+ class SourceViewConfig;
+}
// #108672 Helper functions to get/set text in TextEngine
// using the stream interface (get/setText() only supports
@@ -108,13 +112,13 @@ namespace svt {
class SourceViewConfig;
}
-class EditorWindow : public Window, public SfxListener
+class EditorWindow : public Window, public SfxListener, public utl::ConfigurationListener
{
private:
ExtTextView* pEditView;
ExtTextEngine* pEditEngine;
- svt::SourceViewConfig* pSourceViewConfig;
+ utl::SourceViewConfig* pSourceViewConfig;
long nCurTextWidth;
@@ -151,6 +155,7 @@ protected:
virtual void Command( const CommandEvent& rCEvt );
virtual void LoseFocus();
virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 );
void DoSyntaxHighlight( ULONG nPara );
String GetWordAtCursor();
@@ -447,7 +452,7 @@ public:
void SetModule( const ::rtl::OUString& aModule ) { m_aModule = aModule; }
};
-class ModulWindowLayout: public Window, public SfxListener
+class ModulWindowLayout: public Window, public utl::ConfigurationListener
{
private:
@@ -470,8 +475,7 @@ private:
virtual void DataChanged(DataChangedEvent const & rDCEvt);
- using Window::Notify;
- virtual void Notify(SfxBroadcaster & rBc, SfxHint const & rHint);
+ virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 );
void updateSyntaxHighlighting();
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 27dce8dccc2f..66065d77f71e 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -32,7 +32,7 @@
#include "precompiled_basctl.hxx"
-#include <svtools/svarray.hxx>
+#include <svl/svarray.hxx>
#define _BASIC_TEXTPORTIONS
#include <basic/sbdef.hxx>
#include <ide_pch.hxx>
@@ -40,7 +40,7 @@
#include <tools/urlobj.hxx>
#include <unotools/charclass.hxx>
-#include <svtools/urihelper.hxx>
+#include <svl/urihelper.hxx>
#include <basic/sbx.hxx>
#include <vcl/sound.hxx>
#include <svtools/xtextedt.hxx>
@@ -62,7 +62,7 @@
//#ifndef _SFX_HELP_HXX //autogen
//#include <sfx2/sfxhelp.hxx>
//#endif
-#include <svtools/sourceviewconfig.hxx>
+#include <unotools/sourceviewconfig.hxx>
#ifndef _COM_SUN_STAR_SCRIPT_XLIBRYARYCONTAINER2_HPP_
#include <com/sun/star/script/XLibraryContainer2.hpp>
@@ -172,7 +172,7 @@ EditorWindow::EditorWindow( Window* pParent ) :
pModulWindow = 0;
pEditView = 0;
pEditEngine = 0;
- pSourceViewConfig = new svt::SourceViewConfig;
+ pSourceViewConfig = new utl::SourceViewConfig;
bHighlightning = FALSE;
pProgress = 0;
nCurTextWidth = 0;
@@ -181,15 +181,14 @@ EditorWindow::EditorWindow( Window* pParent ) :
SetPointer( Pointer( POINTER_TEXT ) );
SetHelpId( HID_BASICIDE_EDITORWINDOW );
-
- StartListening( *pSourceViewConfig );
+ pSourceViewConfig->AddListener(this);
}
__EXPORT EditorWindow::~EditorWindow()
{
- EndListening( *pSourceViewConfig );
+ pSourceViewConfig->RemoveListener(this);
delete pSourceViewConfig;
aSyntaxIdleTimer.Stop();
@@ -662,7 +661,7 @@ void EditorWindow::DataChanged(DataChangedEvent const & rDCEvt)
}
}
-void EditorWindow::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+void EditorWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
if ( rHint.ISA( TextHint ) )
{
@@ -718,10 +717,11 @@ void EditorWindow::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
DoDelayedSyntaxHighlight( rTextHint.GetValue() );
}
}
- else if ( &rBC == pSourceViewConfig )
- {
- ImplSetFont();
- }
+}
+
+void EditorWindow::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 )
+{
+ ImplSetFont();
}
void EditorWindow::SetScrollBarRanges()
@@ -944,6 +944,7 @@ BreakPointWindow::BreakPointWindow( Window* pParent ) :
pModulWindow = 0;
nCurYOffset = 0;
setBackgroundColor(GetSettings().GetStyleSettings().GetFieldColor());
+ m_bHighContrastMode = GetSettings().GetStyleSettings().GetHighContrastMode();
nMarkerPos = MARKER_NOMARKER;
// nCurYOffset merken und nicht von EditEngine holen.
@@ -1161,6 +1162,7 @@ void BreakPointWindow::DataChanged(DataChangedEvent const & rDCEvt)
!= rDCEvt.GetOldSettings()->GetStyleSettings().GetFieldColor())
{
setBackgroundColor(aColor);
+ m_bHighContrastMode = GetSettings().GetStyleSettings().GetHighContrastMode();
Invalidate();
}
}
@@ -1169,7 +1171,6 @@ void BreakPointWindow::DataChanged(DataChangedEvent const & rDCEvt)
void BreakPointWindow::setBackgroundColor(Color aColor)
{
SetBackground(Wallpaper(aColor));
- m_bHighContrastMode = aColor.IsDark();
}
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index 1d64a7c318d1..77181a0a2044 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -46,7 +46,7 @@
#include <ide_pch.hxx>
-#include <vector>
+#include <vector>
#include <basidesh.hrc>
#include <baside3.hxx>
#include <localizationmgr.hxx>
@@ -64,7 +64,7 @@
#include <helpid.hrc>
#include <bastype2.hxx>
#include <svx/svdview.hxx>
-#include <svx/unolingu.hxx>
+#include <svx/unolingu.hxx>
#include <tools/diagnose_ex.h>
#include <tools/urlobj.hxx>
#include <comphelper/processfactory.hxx>
@@ -75,7 +75,7 @@
#include <com/sun/star/script/XLibraryContainer2.hpp>
#endif
#include <svtools/ehdl.hxx>
-#include <svtools/langtab.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>
@@ -641,10 +641,10 @@ void __EXPORT DialogWindow::ExecuteCommand( SfxRequest& rReq )
case SID_EXPORT_DIALOG:
SaveDialog();
break;
-
- case SID_IMPORT_DIALOG:
- ImportDialog();
- break;
+
+ case SID_IMPORT_DIALOG:
+ ImportDialog();
+ break;
}
rReq.Done();
@@ -866,406 +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;
-}
-
+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().GetHighContrastMode() ?
+ 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().GetHighContrastMode() ?
+ 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/basides1.cxx b/basctl/source/basicide/basides1.cxx
index b821c7ca51c6..044c61d5cc21 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -36,7 +36,7 @@
#define GLOBALOVERFLOW2
#include <basic/sbx.hxx>
#define _SVSTDARR_STRINGS
-#include <svtools/svstdarr.hxx>
+#include <svl/svstdarr.hxx>
#include <ide_pch.hxx>
#define _SOLAR__PRIVATE 1
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index e6b147cc46c8..2d2e0f6a5693 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -52,7 +52,7 @@
#define _SOLAR__PRIVATE 1
#include <basic/sbx.hxx>
-#include <svtools/hint.hxx>
+#include <svl/hint.hxx>
#include <tools/diagnose_ex.h>
#include <basidesh.hrc>
#include <basidesh.hxx>
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index e4abb3fad92e..f7ddd62e144a 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -36,7 +36,7 @@
#include <vector>
#include <algorithm>
#include <basic/sbx.hxx>
-#include <svtools/moduleoptions.hxx>
+#include <unotools/moduleoptions.hxx>
#include <com/sun/star/document/XEmbeddedScripts.hpp>
#include <com/sun/star/document/XScriptInvocationContext.hpp>
#include <basobj.hxx>
diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx
index 8ef06af7dc25..a1887e0ea7a0 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -36,7 +36,7 @@
#include <vector>
#include <algorithm>
#include <basic/sbx.hxx>
-#include <svtools/moduleoptions.hxx>
+#include <unotools/moduleoptions.hxx>
#include <iderdll.hxx>
#include <iderdll2.hxx>
diff --git a/basctl/source/basicide/bastype2.hxx b/basctl/source/basicide/bastype2.hxx
index d10bdbc0e7f2..ce96ca3892a9 100644
--- a/basctl/source/basicide/bastype2.hxx
+++ b/basctl/source/basicide/bastype2.hxx
@@ -37,7 +37,7 @@
#define _SVICNVW_HXX
#include <svtools/svtreebx.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
#include <basic/sbstar.hxx>
#include <sbxitem.hxx>
#include "basobj.hxx"
diff --git a/basctl/source/basicide/ide_pch.hxx b/basctl/source/basicide/ide_pch.hxx
index 4029e45fe082..9f294b87577d 100644
--- a/basctl/source/basicide/ide_pch.hxx
+++ b/basctl/source/basicide/ide_pch.hxx
@@ -33,11 +33,11 @@
#include <vcl/msgbox.hxx>
#include <vcl/menu.hxx>
-#include <svtools/svarray.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/aeitem.hxx>
-#include <svtools/stritem.hxx>
-#include <svtools/whiter.hxx>
+#include <svl/svarray.hxx>
+#include <svl/itemset.hxx>
+#include <svl/aeitem.hxx>
+#include <svl/stritem.hxx>
+#include <svl/whiter.hxx>
#define _BASIC_TEXTPORTIONS
#include <basic/sbdef.hxx>
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index f0143cc8517b..ea5f7cec9878 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -72,7 +72,7 @@
#include "com/sun/star/ucb/XCommandEnvironment.hpp"
#include <com/sun/star/ucb/NameClash.hpp>
#include "com/sun/star/packages/manifest/XManifestWriter.hpp"
-#include <svtools/pathoptions.hxx>
+#include <unotools/pathoptions.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/util/VetoException.hpp>
diff --git a/basctl/source/basicide/objdlg.cxx b/basctl/source/basicide/objdlg.cxx
index 55bc15810a2b..d71f1b2929d7 100644
--- a/basctl/source/basicide/objdlg.cxx
+++ b/basctl/source/basicide/objdlg.cxx
@@ -300,7 +300,7 @@ void ObjectCatalogToolBox_Impl::DataChanged(DataChangedEvent const & rDCEvt)
void ObjectCatalogToolBox_Impl::setImages()
{
- bool bHC = GetDisplayBackground().GetColor().IsDark();
+ bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
if (bHC != m_bHighContrast)
{
SetImageList(bHC ? m_aImagesHighContrast : m_aImagesNormal);
diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx
index b9ffe708e6fa..a87ad521c2f5 100644
--- a/basctl/source/basicide/scriptdocument.cxx
+++ b/basctl/source/basicide/scriptdocument.cxx
@@ -70,7 +70,7 @@
#include <xmlscript/xmldlg_imexp.hxx>
-#include <svtools/syslocale.hxx>
+#include <unotools/syslocale.hxx>
#include <unotools/collatorwrapper.hxx>
diff --git a/basctl/source/basicide/tbxctl.cxx b/basctl/source/basicide/tbxctl.cxx
index e2af9e0346a1..bac7e8854cf6 100644
--- a/basctl/source/basicide/tbxctl.cxx
+++ b/basctl/source/basicide/tbxctl.cxx
@@ -42,7 +42,7 @@
#include <tbxctl.hrc>
#include <idetemp.hxx>
#include <sfx2/imagemgr.hxx>
-#include <svtools/aeitem.hxx>
+#include <svl/aeitem.hxx>
#include <vcl/toolbox.hxx>
using namespace ::com::sun::star::uno;
@@ -186,7 +186,7 @@ void TbxControls::StateChanged( USHORT nSID, SfxItemState eState,
Image aImage = GetImage( m_xFrame,
aSlotURL,
hasBigImages(),
- GetToolBox().GetDisplayBackground().GetColor().IsDark() );
+ GetToolBox().GetSettings().GetStyleSettings().GetHighContrastMode() );
ToolBox& rBox = GetToolBox();
rBox.SetItemImage(GetId(), aImage);
nLastSlot = nLastEnum;
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index b4a6e67e65dc..80b9c26e07b4 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -46,7 +46,7 @@
#include <iderdll.hxx>
#include <vcl/scrbar.hxx>
#include <tools/shl.hxx>
-#include <svtools/itempool.hxx>
+#include <svl/itempool.hxx>
#include <sfx2/viewfrm.hxx>
#ifndef _SVX_SVXIDS_HRC
diff --git a/basctl/source/inc/accessibledialogwindow.hxx b/basctl/source/inc/accessibledialogwindow.hxx
index 8552f9f09e10..db446d479ead 100644
--- a/basctl/source/inc/accessibledialogwindow.hxx
+++ b/basctl/source/inc/accessibledialogwindow.hxx
@@ -37,7 +37,7 @@
#include <comphelper/accessiblecomponenthelper.hxx>
#include <cppuhelper/implbase3.hxx>
#include <tools/link.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
#include <vector>
diff --git a/basctl/source/inc/baside3.hxx b/basctl/source/inc/baside3.hxx
index b60d4d432bfd..7920e9ebdfc6 100644
--- a/basctl/source/inc/baside3.hxx
+++ b/basctl/source/inc/baside3.hxx
@@ -36,7 +36,7 @@
#endif
#include <bastypes.hxx>
-#include <svtools/undo.hxx>
+#include <svl/undo.hxx>
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
#include <vcl/lstbox.hxx>
diff --git a/basctl/source/inc/basobj.hxx b/basctl/source/inc/basobj.hxx
index c917de5a6dee..a2911dcccb8f 100644
--- a/basctl/source/inc/basobj.hxx
+++ b/basctl/source/inc/basobj.hxx
@@ -32,7 +32,7 @@
#include "scriptdocument.hxx"
#include <tools/string.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/lstner.hxx>
#ifndef _COM_SUN_STAR_IO_XINPUTSTREAMPROVIDER_HXX_
#include <com/sun/star/io/XInputStreamProvider.hpp>
diff --git a/basctl/source/inc/dlged.hxx b/basctl/source/inc/dlged.hxx
index f1217351f5f8..001c689a78a5 100644
--- a/basctl/source/inc/dlged.hxx
+++ b/basctl/source/inc/dlged.hxx
@@ -38,8 +38,8 @@
#include <tools/link.hxx>
#include <tools/gen.hxx>
#include <vcl/timer.hxx>
-#include <svtools/hint.hxx>
-#include <svtools/brdcst.hxx>
+#include <svl/hint.hxx>
+#include <svl/brdcst.hxx>
#define DLGED_PAGE_WIDTH_MIN 1280
#define DLGED_PAGE_HEIGHT_MIN 1024
diff --git a/basctl/source/inc/propbrw.hxx b/basctl/source/inc/propbrw.hxx
index 8e3fa615d960..f9be90b38b4b 100644
--- a/basctl/source/inc/propbrw.hxx
+++ b/basctl/source/inc/propbrw.hxx
@@ -37,8 +37,8 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <comphelper/composedprops.hxx>
#include <sfx2/basedlgs.hxx>
-#include <svtools/brdcst.hxx>
-#include <svtools/lstner.hxx>
+#include <svl/brdcst.hxx>
+#include <svl/lstner.hxx>
#include <sfx2/childwin.hxx>
#include <svx/svdmark.hxx>
diff --git a/basctl/source/inc/sbxitem.hxx b/basctl/source/inc/sbxitem.hxx
index 654e283128fb..b1192b51d9bf 100644
--- a/basctl/source/inc/sbxitem.hxx
+++ b/basctl/source/inc/sbxitem.hxx
@@ -31,7 +31,7 @@
#define _SBXITEM_HXX
#include "scriptdocument.hxx"
-#include <svtools/poolitem.hxx>
+#include <svl/poolitem.hxx>
const USHORT BASICIDE_TYPE_UNKNOWN = 0;
const USHORT BASICIDE_TYPE_SHELL = 1;