merge commit for m65

This commit is contained in:
Mathias Bauer 2009-11-23 17:39:22 +01:00
commit d925fcf39e
31 changed files with 479 additions and 460 deletions

View File

@ -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();
}

View File

@ -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 );
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;
}
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;

View File

@ -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);

View File

@ -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;

View File

@ -403,7 +403,7 @@ void InitImageType()
Window* topwin = Application::GetActiveTopWindow();
if ( topwin != NULL &&
topwin->GetDisplayBackground().GetColor().IsDark() )
topwin->GetSettings().GetStyleSettings().GetHighContrastMode() )
{
theImageType |= css::ui::ImageType::COLOR_HIGHCONTRAST;
}
@ -5114,7 +5114,7 @@ SvxToolbarEntriesListBox::SvxToolbarEntriesListBox(
BuildCheckBoxButtonImages( m_pButtonData );
EnableCheckButton( m_pButtonData );
m_bHiContrastMode = GetDisplayBackground().GetColor().IsDark();
m_bHiContrastMode = GetSettings().GetStyleSettings().GetHighContrastMode();
}
// --------------------------------------------------------
@ -5189,11 +5189,8 @@ void SvxToolbarEntriesListBox::DataChanged( const DataChangedEvent& rDCEvt )
if (( rDCEvt.GetType() == DATACHANGED_SETTINGS ) &&
( rDCEvt.GetFlags() & SETTINGS_STYLE ))
{
if ( m_bHiContrastMode != GetDisplayBackground().GetColor().IsDark() )
{
// We have to reset all images because we change to/from high contrast mode
m_bHiContrastMode = GetDisplayBackground().GetColor().IsDark();
}
// We have to reset all images because we change to/from high contrast mode
m_bHiContrastMode = GetSettings().GetStyleSettings().GetHighContrastMode();
BuildCheckBoxButtonImages( m_pButtonData );
Invalidate();

View File

@ -486,9 +486,7 @@ void IconLBoxString::Paint( const Point& aPos, SvLBox& aDevice,
sal_Int32 nIndex = aURL.indexOf( aVndSunStarUNO );
bool bUNO = nIndex == 0;
Wallpaper aBackground = aDevice.GetBackground();
Color aColor = aBackground.GetColor();
BOOL bHC = aColor.IsDark();
BOOL bHC = aDevice.GetSettings().GetStyleSettings().GetHighContrastMode();
const Image* pImg;
if( bHC )
pImg = bUNO ? m_pComponentImg_h : m_pMacroImg_h;

View File

@ -902,7 +902,7 @@ void SpellDialog::SetTitle_Impl(LanguageType nLang)
const SpellErrorDescription* pSpellErrorDescription = aSentenceED.GetAlternatives();
if( pSpellErrorDescription && pSpellErrorDescription->sServiceName.getLength() )
{
bool bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0;
bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
::rtl::OUString sSuggestionImageUrl =
SvtLinguConfig().GetSpellAndGrammarDialogImage( pSpellErrorDescription->sServiceName, bHighContrast );
aVendorImageFI.SetImage( lcl_GetImageFromPngUrl( sSuggestionImageUrl ) );
@ -912,7 +912,7 @@ void SpellDialog::SetTitle_Impl(LanguageType nLang)
}
else
{
bool bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0;
bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
aVendorImageFI.SetImage( bHighContrast ? aVendorImageHC : aVendorImage );
}
@ -923,7 +923,7 @@ void SpellDialog::SetTitle_Impl(LanguageType nLang)
}
else
{
//bool bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0;
//bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
sTitle = m_sTitleSpellingGrammar;
}
}

View File

@ -148,8 +148,8 @@ BOOL SvxAccessibilityOptionsTabPage::FillItemSet( SfxItemSet& )
aMiscSettings.SetEnableATToolSupport( m_aAccessibilityTool.IsChecked() );
#endif
aAllSettings.SetMiscSettings(aMiscSettings);
Application::SetSettings(aAllSettings);
Application::MergeSystemSettings( aAllSettings );
Application::SetSettings(aAllSettings);
return FALSE;
}

View File

@ -753,9 +753,9 @@ ColorConfigWindow_Impl::ColorConfigWindow_Impl(Window* pParent, const ResId& rRe
Wallpaper aTransparentWall(TempColor);
sal_Int32 nWinWidth = GetSizePixel().Width();
sal_Int32 nFTHeight = aChapters[0]->GetSizePixel().Height();
sal_Bool bHighContrast = GetDisplayBackground().GetColor().IsDark();
Color aBackColor;
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
sal_Bool bHighContrast = rStyleSettings.GetHighContrastMode();
if ( bHighContrast )
aBackColor = rStyleSettings.GetShadowColor();
else

View File

@ -145,7 +145,13 @@ IMPL_LINK( SvxImprovementOptionsPage, HandleShowData, PushButton*, EMPTYARG )
{
::rtl::OUString sLogFile( m_sLogPath );
sLogFile += C2S("/Current.csv");
uno::Sequence< beans::PropertyValue > aArgs;
uno::Sequence< beans::PropertyValue > aArgs(3);
aArgs[0].Name = ::rtl::OUString::createFromAscii("FilterName");
aArgs[0].Value = uno::makeAny(::rtl::OUString::createFromAscii("Text - txt - csv (StarCalc)"));
aArgs[1].Name = ::rtl::OUString::createFromAscii("FilterOptions");
aArgs[1].Value = uno::makeAny(::rtl::OUString::createFromAscii("44,34,12,1,"));
aArgs[2].Name = ::rtl::OUString::createFromAscii("ReadOnly");
aArgs[2].Value = uno::makeAny(true);
uno::Reference< lang::XComponent > xDoc = ::comphelper::SynchronousDispatch::dispatch(
xDesktop, sLogFile, C2S("_default"), 0, aArgs );

View File

@ -229,7 +229,7 @@ SfxSaveTabPage::SfxSaveTabPage( Window* pParent, const SfxItemSet& rCoreSet ) :
pImpl ( new SvxSaveTabPage_Impl )
{
sal_Bool bHighContrast = GetDisplayBackground().GetColor().IsDark();
sal_Bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
aODFWarningFI.SetImage(
Image( CUI_RES( bHighContrast ? IMG_ODF_WARNING_HC : IMG_ODF_WARNING ) ) );

View File

@ -42,8 +42,8 @@
ReadOnlyImage::ReadOnlyImage(Window* pParent, const ResId rResId) :
FixedImage(pParent, rResId)
{
sal_Bool bHighContrast = pParent->GetDisplayBackground().GetColor().IsDark();
SetImage( Image(CUI_RES(bHighContrast ? RID_SVXBMP_LOCK_HC : RID_SVXBMP_LOCK )));
sal_Bool bHighContrast = pParent->GetSettings().GetStyleSettings().GetHighContrastMode();
SetImage( Image(SVX_RES(bHighContrast ? RID_SVXBMP_LOCK_HC : RID_SVXBMP_LOCK )));
}
/*-- 26.02.2004 13:31:04---------------------------------------------------

View File

@ -1067,7 +1067,7 @@ void OfaTreeOptionsDialog::DataChanged( const DataChangedEvent& rDCEvt )
!aTreeLB.GetParent(pEntry))
{
OptionsGroupInfo* pInfo = static_cast<OptionsGroupInfo*>(pEntry->GetUserData());
bool bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0;
bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
ImageList* pImgLst = bHighContrast ? &aPageImagesHC : &aPageImages;
for ( sal_uInt16 i = 0; i < aHelpTextsArr.Count(); ++i )
{
@ -1325,7 +1325,7 @@ IMPL_LINK( OfaTreeOptionsDialog, SelectHdl_Impl, Timer*, EMPTYARG )
OptionsGroupInfo* pTGInfo = (OptionsGroupInfo *)pEntry->GetUserData();
if ( pTGInfo->m_sPageURL.getLength() == 0 )
{
bool bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0;
bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
ImageList* pImgLst = bHighContrast ? &aPageImagesHC : &aPageImages;
//hier den Hilfetext anzeigen
for ( sal_uInt16 i = 0; i < aHelpTextsArr.Count(); ++i )

View File

@ -244,7 +244,7 @@ void AlignmentTabPage::InitVsRefEgde()
// remember selection - is deleted in call to ValueSet::Clear()
USHORT nSel = maVsRefEdge.GetSelectItemId();
ResId aResId( GetBackground().GetColor().IsDark() ? IL_LOCK_BMPS_HC : IL_LOCK_BMPS, CUI_MGR() );
ResId aResId( GetSettings().GetStyleSettings().GetHighContrastMode() ? IL_LOCK_BMPS_HC : IL_LOCK_BMPS, DIALOG_MGR() );
ImageList aImageList( aResId );
Size aItemSize( aImageList.GetImage( IID_BOTTOMLOCK ).GetSizePixel() );

View File

@ -1029,8 +1029,8 @@ USHORT SvxBorderTabPage::GetPresetStringId( USHORT nValueSetIdx ) const
void SvxBorderTabPage::FillPresetVS()
{
// find correct image list
bool bDark = aWndPresets.GetDisplayBackground().GetColor().IsDark();
ImageList& rImgList = bDark ? aBorderImgLstH : aBorderImgLst;
bool bHC = aWndPresets.GetSettings().GetStyleSettings().GetHighContrastMode();
ImageList& rImgList = bHC ? aBorderImgLstH : aBorderImgLst;
Size aImgSize( rImgList.GetImage( IID_PRE_CELL_NONE ).GetSizePixel() );
// basic initialization of the ValueSet
@ -1056,8 +1056,8 @@ void SvxBorderTabPage::FillPresetVS()
void SvxBorderTabPage::FillShadowVS()
{
// find correct image list
bool bDark = aWndShadows.GetDisplayBackground().GetColor().IsDark();
ImageList& rImgList = bDark ? aShadowImgLstH : aShadowImgLst;
bool bHC = aWndPresets.GetSettings().GetStyleSettings().GetHighContrastMode();
ImageList& rImgList = bHC ? aShadowImgLstH : aShadowImgLst;
Size aImgSize( rImgList.GetImage( IID_SHADOWNONE ).GetSizePixel() );
// basic initialization of the ValueSet

View File

@ -570,7 +570,7 @@ void SvxCaptionTabPage::DataChanged( const DataChangedEvent& rDCEvt )
void SvxCaptionTabPage::FillValueSet()
{
bool bHighContrast = GetDisplayBackground().GetColor().IsDark() != 0;
bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
Image** ppBitmaps = bHighContrast ? mpBmpCapTypesH : mpBmpCapTypes;
aCT_CAPTTYPE.SetItemImage(BMP_CAPTTYPE_1, *(ppBitmaps[0]) );

View File

@ -155,7 +155,7 @@ SvxHatchTabPage::SvxHatchTabPage
aBtnLoad.SetClickHdl( LINK( this, SvxHatchTabPage, ClickLoadHdl_Impl ) );
aBtnSave.SetClickHdl( LINK( this, SvxHatchTabPage, ClickSaveHdl_Impl ) );
aCtlPreview.SetDrawMode( GetDisplayBackground().GetColor().IsDark() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
aCtlPreview.SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
}
// -----------------------------------------------------------------------
@ -889,7 +889,7 @@ void SvxHatchTabPage::PointChanged( Window* pWindow, RECT_POINT eRcPt )
void SvxHatchTabPage::DataChanged( const DataChangedEvent& rDCEvt )
{
if ( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
aCtlPreview.SetDrawMode( GetDisplayBackground().GetColor().IsDark() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
aCtlPreview.SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
SvxTabPage::DataChanged( rDCEvt );
}

View File

@ -288,6 +288,7 @@ void SvxLineTabPage::Construct()
void SvxLineTabPage::FillListboxes()
{
// Linienstile
USHORT nOldSelect = aLbLineStyle.GetSelectEntryPos();
aLbLineStyle.FillStyles();
aLbLineStyle.Fill( pDashList );

View File

@ -620,8 +620,8 @@ void BibToolBar::RebuildToolbar()
void BibToolBar::ApplyImageList()
{
ImageList& rList = ( nSymbolsSize == SFX_SYMBOLS_SIZE_SMALL ) ?
( GetDisplayBackground().GetColor().IsDark() ? aImgLstHC : aImgLst ) :
( GetDisplayBackground().GetColor().IsDark() ? aBigImgLstHC : aBigImgLst );
( GetSettings().GetStyleSettings().GetHighContrastMode() ? aImgLstHC : aImgLst ) :
( GetSettings().GetStyleSettings().GetHighContrastMode() ? aBigImgLstHC : aBigImgLst );
SetItemImage(TBC_BT_AUTOFILTER , rList.GetImage(SID_FM_AUTOFILTER));
SetItemImage(TBC_BT_FILTERCRIT , rList.GetImage(SID_FM_FILTERCRIT));

View File

@ -376,7 +376,7 @@ namespace dbp
{
::svt::OLocalResourceAccess aLocalResAccess( ModuleRes( RID_PAGE_TABLESELECTION ), RSC_TABPAGE );
bool bIsHiContrast = m_aTable.GetBackground().GetColor().IsDark();
bool bIsHiContrast = m_aTable.GetSettings().GetStyleSettings().GetHighContrastMode();
aTableImage = Image( ModuleRes( bIsHiContrast ? IMG_TABLE_HC : IMG_TABLE ) );
aQueryImage = Image( ModuleRes( bIsHiContrast ? IMG_QUERY_HC : IMG_QUERY ) );
}

View File

@ -328,7 +328,16 @@ namespace logging
void SAL_CALL FileHandler::flush( ) throw (RuntimeException)
{
MethodGuard aGuard( *this );
// nothing to do, our ::osl::File implementation is not buffered
if(!m_pFile.get())
{
OSL_PRECOND(false, "FileHandler::flush: no file!");
return;
}
#if OSL_DEBUG_LEVEL > 0
::osl::FileBase::RC res =
#endif
m_pFile->sync();
OSL_ENSURE(res == ::osl::FileBase::E_None, "FileHandler::flush: Could not sync logfile to filesystem.");
}
//--------------------------------------------------------------------

View File

@ -230,6 +230,8 @@ namespace logging
m_aHandlers.forEach< XLogHandler >(
::boost::bind( &XLogHandler::publish, _1, ::boost::cref( _rRecord ) ) );
m_aHandlers.forEach< XLogHandler >(
::boost::bind( &XLogHandler::flush, _1 ) );
}
//--------------------------------------------------------------------

View File

@ -114,7 +114,7 @@ namespace pcr
aPB_OK.SetClickHdl( LINK( this, TabOrderDialog, OKClickHdl ) );
aPB_OK.Disable();
sal_Bool bIsHighContrast = GetDisplayBackground().GetColor().IsDark();
sal_Bool bIsHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
pImageList = new ImageList( PcrRes( bIsHighContrast ? RID_IL_FORMEXPLORER_HC : RID_IL_FORMEXPLORER ) );

View File

@ -72,10 +72,6 @@ namespace frm
sLabel += String::CreateFromAscii( " " );
return sLabel;
}
static bool lcl_isHighContrast( const Color& _rColor )
{
return _rColor.IsDark();
}
}
//=====================================================================
@ -346,7 +342,7 @@ namespace frm
{
m_eImageSize = _eSize;
::std::auto_ptr< SfxImageManager > pImageManager( new SfxImageManager( NULL ) );
pImageManager->SetImagesForceSize( *m_pToolbar, lcl_isHighContrast( GetBackground().GetColor() ), m_eImageSize == eLarge );
pImageManager->SetImagesForceSize( *m_pToolbar, GetSettings().GetStyleSettings().GetHighContrastMode(), m_eImageSize == eLarge );
// parts of our layout is dependent on the size of our icons
Resize();

View File

@ -1,4 +1,4 @@
pk setup_native : transex3 soltools xml2cmp sal unoil officecfg NULL
pk setup_native : l10n transex3 soltools sal xml2cmp NULL
pk setup_native usr1 - all sn_mkout NULL
pk setup_native\scripts\source nmake - u sn_source NULL
pk setup_native\scripts nmake - u sn_scripts sn_source.u NULL

View File

@ -199,6 +199,8 @@ void read_encoding_table(char * file, EncodingMap& aEncodingMap)
aEncodingMap.insert( EncodingMap::value_type(language, encoding->value) );
}
}
fclose(fp);
}
/************************************************************************
@ -311,6 +313,7 @@ int main( int argc, char * const argv[] )
ostream = fopen(outfile, "w");
if ( ostream == NULL ) {
fprintf(stderr, "ulfconv: %s : %s\n", outfile, strerror(errno));
fclose(istream);
exit(2);
}
}
@ -351,4 +354,7 @@ int main( int argc, char * const argv[] )
fputs(buffer, ostream);
}
}
fclose(ostream);
fclose(istream);
}

View File

@ -257,6 +257,9 @@ extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
// When there is no program folder, there could be no running office
if ( dwError == ERROR_FILE_NOT_FOUND )
return ERROR_SUCCESS;
if ( dwError == ERROR_PATH_NOT_FOUND )
return ERROR_SUCCESS;
// The destination folder should never exist, don't know what to do here
if ( dwError == ERROR_ALREADY_EXISTS )
return ERROR_SUCCESS;

View File

@ -122,7 +122,7 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif
,maKeyImg ( this, XMLSEC_RES( IMG_KEY ) )
,maHintCorrespPrivKeyFI ( this, XMLSEC_RES( FI_CORRPRIVKEY ) )
{
if ( GetSettings().GetStyleSettings().GetWindowColor().IsDark() )
if ( GetSettings().GetStyleSettings().GetHighContrastMode() )
maKeyImg.SetImage( Image( XMLSEC_RES( IMG_KEY_HC ) ) );
//Verify the certificate
@ -139,14 +139,14 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif
sal_Int32 certErrors = certStatus & mask;
bool bCertValid = certErrors > 0 ? false : true;
bool bIsDark = ( GetSettings().GetStyleSettings().GetWindowColor().IsDark() != FALSE );
bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
if ( !bCertValid )
{
maCertImg.SetImage(
Image( XMLSEC_RES( bIsDark ? IMG_STATE_NOT_VALIDATED_HC : IMG_STATE_NOT_VALIDATED ) ) );
Image( XMLSEC_RES( bHC ? IMG_STATE_NOT_VALIDATED_HC : IMG_STATE_NOT_VALIDATED ) ) );
maHintNotTrustedFI.SetText( String( XMLSEC_RES( STR_CERTIFICATE_NOT_VALIDATED ) ) );
}
else if ( bIsDark )
else if ( bHC )
maCertImg.SetImage( Image( XMLSEC_RES( IMG_STATE_CERIFICATED_HC ) ) );
FreeResource();
@ -430,7 +430,7 @@ CertificateViewerCertPathTP::CertificateViewerCertPathTP( Window* _pParent, Cert
,msCertNotValidated ( XMLSEC_RES( STR_PATH_CERT_NOT_VALIDATED ) )
{
if ( GetSettings().GetStyleSettings().GetWindowColor().IsDark() )
if ( GetSettings().GetStyleSettings().GetHighContrastMode() )
{
maCertImage = Image( XMLSEC_RES( IMG_CERT_SMALL_HC ) );
maCertNotValidatedImage = Image( XMLSEC_RES( IMG_CERT_NOTVALIDATED_SMALL_HC ) );

View File

@ -221,7 +221,7 @@ DigitalSignaturesDialog::DigitalSignaturesDialog(
maSigsNotvalidatedFI.SetText( String( XMLSEC_RES( STR_NO_INFO_TO_VERIFY ) ) );
if ( GetBackground().GetColor().IsDark() )
if ( GetSettings().GetStyleSettings().GetHighContrastMode() )
{
// high contrast mode needs other images
maSigsValidImg.SetImage( Image( XMLSEC_RES( IMG_STATE_VALID_HC ) ) );

View File

@ -429,7 +429,7 @@ void MacroSecurityTrustedSourcesTP::ClosePage( void )
ReadOnlyImage::ReadOnlyImage(Window* pParent, const ResId rResId) :
FixedImage(pParent, rResId)
{
sal_Bool bHighContrast = pParent->GetDisplayBackground().GetColor().IsDark();
sal_Bool bHighContrast = pParent->GetSettings().GetStyleSettings().GetHighContrastMode();
SetImage( Image(XMLSEC_RES( bHighContrast ? RID_XMLSECTP_LOCK_HC : RID_XMLSECTP_LOCK )));
}

View File

@ -239,7 +239,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su
) ;
if( cbIssuer <= 0 ) {
delete issuer ;
delete [] issuer ;
throw RuntimeException() ;
}
@ -252,7 +252,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su
if(issuer[cbIssuer-1] == 0) cbIssuer--; //delimit the last 0x00;
OUString xIssuer(issuer , cbIssuer ,encoding ) ; //By CP
delete issuer ;
delete [] issuer ;
return replaceTagSWithTagST(xIssuer);
} else {
@ -288,7 +288,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su
) ;
if( cbSubject <= 0 ) {
delete subject ;
delete [] subject ;
throw RuntimeException() ;
}
@ -301,7 +301,7 @@ sal_Int16 SAL_CALL X509Certificate_MSCryptImpl :: getVersion() throw ( ::com::su
if(subject[cbSubject-1] == 0) cbSubject--; //delimit the last 0x00;
OUString xSubject(subject , cbSubject ,encoding ) ; //By CP
delete subject ;
delete [] subject ;
return replaceTagSWithTagST(xSubject);
} else {