summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accessibility/bridge/org/openoffice/java/accessibility/Tree.java10
-rwxr-xr-xaccessibility/prj/build.lst2
-rw-r--r--automation/source/server/statemnt.cxx2
-rw-r--r--automation/source/testtool/objtest.cxx2
-rw-r--r--basctl/source/basicide/baside2b.cxx3
-rw-r--r--basctl/source/basicide/baside3.cxx814
-rw-r--r--basctl/source/basicide/objdlg.cxx2
-rw-r--r--basctl/source/basicide/tbxctl.cxx2
-rw-r--r--extensions/source/bibliography/toolbar.cxx4
-rw-r--r--extensions/source/config/ldap/ldapaccess.cxx15
-rw-r--r--extensions/source/config/ldap/wrapldapinclude.hxx6
-rw-r--r--extensions/source/dbpilots/commonpagesdbp.cxx2
-rw-r--r--extensions/source/logging/filehandler.cxx11
-rw-r--r--extensions/source/logging/logger.cxx2
-rw-r--r--extensions/source/propctrlr/taborder.cxx2
-rw-r--r--forms/qa/integration/forms/FormLayer.java22
-rw-r--r--forms/qa/integration/forms/FormPropertyBags.java2
-rw-r--r--forms/source/component/FormComponent.cxx9
-rw-r--r--forms/source/solar/control/navtoolbar.cxx6
-rw-r--r--package/inc/ByteGrabber.hxx4
-rw-r--r--package/inc/ZipFile.hxx2
-rw-r--r--package/inc/ZipPackage.hxx1
-rw-r--r--package/source/xstor/xstorage.cxx18
-rw-r--r--package/source/zipapi/ByteGrabber.cxx21
-rw-r--r--package/source/zipapi/ZipFile.cxx26
-rw-r--r--package/source/zippackage/ZipPackage.cxx20
-rw-r--r--setup_native/prj/build.lst2
-rw-r--r--setup_native/prj/d.lst5
-rw-r--r--setup_native/scripts/admin.pl203
-rw-r--r--setup_native/source/opensolaris/bundledextensions/README80
-rw-r--r--setup_native/source/opensolaris/bundledextensions/installed1
-rw-r--r--setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml60
-rw-r--r--setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions108
-rwxr-xr-xsetup_native/source/packinfo/packinfo_office.txt16
-rw-r--r--setup_native/source/packinfo/spellchecker_selection.txt1
-rw-r--r--setup_native/source/ulfconv/ulfconv.cxx6
-rwxr-xr-xsetup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx3
-rw-r--r--setup_native/tests/opensolaris/bundledextensions/send_ooo32
-rw-r--r--xmlsecurity/source/dialogs/certificateviewer.cxx10
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx2
-rw-r--r--xmlsecurity/source/dialogs/macrosecurity.cxx2
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx8
42 files changed, 1084 insertions, 465 deletions
diff --git a/accessibility/bridge/org/openoffice/java/accessibility/Tree.java b/accessibility/bridge/org/openoffice/java/accessibility/Tree.java
index 52debca0a5f6..83f8c9a10c49 100644
--- a/accessibility/bridge/org/openoffice/java/accessibility/Tree.java
+++ b/accessibility/bridge/org/openoffice/java/accessibility/Tree.java
@@ -118,6 +118,16 @@ public class Tree extends DescendantManager implements javax.accessibility.Acces
}
break;
+ case AccessibleEventId.LISTBOX_ENTRY_EXPANDED:
+ firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY,
+ AccessibleState.COLLAPSED, AccessibleState.EXPANDED);
+ break;
+
+ case AccessibleEventId.LISTBOX_ENTRY_COLLAPSED:
+ firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY,
+ AccessibleState.EXPANDED, AccessibleState.COLLAPSED);
+ break;
+
default:
super.notifyEvent(event);
}
diff --git a/accessibility/prj/build.lst b/accessibility/prj/build.lst
index 351473e38450..cd30f3452a30 100755
--- a/accessibility/prj/build.lst
+++ b/accessibility/prj/build.lst
@@ -1,4 +1,4 @@
-ac accessibility : l10n tools jurt offuh unoil vcl jvmaccess cppu sal toolkit svtools NULL
+ac accessibility : l10n tools jurt offuh unoil vcl javaunohelper jvmaccess cppu sal toolkit svtools NULL
ac accessibility usr1 - all ac_mkout NULL
ac accessibility\inc nmake - all ac_inc NULL
ac accessibility\bridge\org\openoffice\java\accessibility nmake - w ac_ooja ac_inc NULL
diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx
index 4219d1d5b099..65be45907b90 100644
--- a/automation/source/server/statemnt.cxx
+++ b/automation/source/server/statemnt.cxx
@@ -4288,7 +4288,7 @@ BOOL StatementControl::HandleCommonMethods( Window *pControl )
Edit *pMyEd = new Edit(pDlg,WB_CENTER | WB_BORDER );
pMyEd->SetSizePixel(Size(100,30));
- pDlg->SetText(CUniString("Schließen"));
+ pDlg->SetText(UniString("Schließen", RTL_TEXTENCODING_ISO_8859_1));
pDlg->Show();
pMyEd->Show();
ULONG nTime = Time().GetTime();
diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx
index e068530459a8..d3937963c155 100644
--- a/automation/source/testtool/objtest.cxx
+++ b/automation/source/testtool/objtest.cxx
@@ -521,6 +521,8 @@ void TestToolObj::LoadIniFile() // Laden der IniEinstellungen, die d
abGP.Append( "20" ); // Linux ia64
#elif defined LINUX && defined S390
abGP.Append( "21" ); // Linux S390
+#elif defined LINUX && defined HPPA
+ abGP.Append( "22" ); // Linux PA-RISC
#else
#error ("unknown platform. please request an ID for your platform on qa/dev")
#endif
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 27dce8dccc2f..644bd85bcb4d 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -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 d89191803c9f..d33310b6e339 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/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/tbxctl.cxx b/basctl/source/basicide/tbxctl.cxx
index e2af9e0346a1..3ebc749c30aa 100644
--- a/basctl/source/basicide/tbxctl.cxx
+++ b/basctl/source/basicide/tbxctl.cxx
@@ -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/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx
index 71de2963862b..416ff1e1845b 100644
--- a/extensions/source/bibliography/toolbar.cxx
+++ b/extensions/source/bibliography/toolbar.cxx
@@ -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));
diff --git a/extensions/source/config/ldap/ldapaccess.cxx b/extensions/source/config/ldap/ldapaccess.cxx
index a850a441c5fe..ee7505c8a518 100644
--- a/extensions/source/config/ldap/ldapaccess.cxx
+++ b/extensions/source/config/ldap/ldapaccess.cxx
@@ -315,14 +315,17 @@ void LdapConnection::loadModule()
if ( !s_Ldap_Module )
{
#if defined(WIN) || defined(WNT)
- const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM("nsldap32v50.dll"));
+# define LIBLDAP "nsldap32v50.dll"
#else
-#ifdef WITH_OPENLDAP
- const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM("libldap.so"));
-#else
- const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM("libldap50.so"));
-#endif
+# ifdef WITH_OPENLDAP
+# define xstr(s) str(s)
+# define str(s) #s
+# define LIBLDAP "libldap-" xstr(LDAP_VENDOR_VERSION_MAJOR) "." xstr(LDAP_VENDOR_VERSION_MINOR) ".so." xstr(LDAP_VENDOR_VERSION_MAJOR)
+# else
+# define LIBLDAP "libldap50.so"
+# endif
#endif
+ const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM(LIBLDAP));
// load the dbtools library
s_Ldap_Module = osl_loadModuleRelative(&thisModule, sModuleName.pData, 0);
diff --git a/extensions/source/config/ldap/wrapldapinclude.hxx b/extensions/source/config/ldap/wrapldapinclude.hxx
index 4c1bbdc350f8..b3b8d45e94d7 100644
--- a/extensions/source/config/ldap/wrapldapinclude.hxx
+++ b/extensions/source/config/ldap/wrapldapinclude.hxx
@@ -35,6 +35,12 @@
#ifdef WITH_OPENLDAP
#include <ldap.h>
+#ifndef LDAP_API
+# define LDAP_API(rt) rt
+#endif
+#ifndef LDAP_CALL
+# define LDAP_CALL
+#endif
#else
#ifndef LDAP_INCLUDED
#define LDAP_INCLUDED
diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx
index 43d8c7af5889..1d02cac88a4b 100644
--- a/extensions/source/dbpilots/commonpagesdbp.cxx
+++ b/extensions/source/dbpilots/commonpagesdbp.cxx
@@ -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 ) );
}
diff --git a/extensions/source/logging/filehandler.cxx b/extensions/source/logging/filehandler.cxx
index 97d6d7524290..e04ea8faf0be 100644
--- a/extensions/source/logging/filehandler.cxx
+++ b/extensions/source/logging/filehandler.cxx
@@ -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.");
}
//--------------------------------------------------------------------
diff --git a/extensions/source/logging/logger.cxx b/extensions/source/logging/logger.cxx
index 69ae5fced483..66e0eb540ef0 100644
--- a/extensions/source/logging/logger.cxx
+++ b/extensions/source/logging/logger.cxx
@@ -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 ) );
}
//--------------------------------------------------------------------
diff --git a/extensions/source/propctrlr/taborder.cxx b/extensions/source/propctrlr/taborder.cxx
index f8021b55229c..865a0074d457 100644
--- a/extensions/source/propctrlr/taborder.cxx
+++ b/extensions/source/propctrlr/taborder.cxx
@@ -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 ) );
diff --git a/forms/qa/integration/forms/FormLayer.java b/forms/qa/integration/forms/FormLayer.java
index d67e28bcf412..032ca5e7331a 100644
--- a/forms/qa/integration/forms/FormLayer.java
+++ b/forms/qa/integration/forms/FormLayer.java
@@ -310,7 +310,27 @@ public class FormLayer
}
/* ------------------------------------------------------------------ */
- /** retrieves a control model with a given access path
+ /** retrieves a control model with a given (integer) access path
+ */
+ public XPropertySet getControlModel( int[] _accessPath ) throws com.sun.star.uno.Exception
+ {
+ XIndexAccess indexAcc = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class,
+ m_document.getFormComponentTreeRoot() );
+ XPropertySet controlModel = null;
+ int i=0;
+ while ( ( indexAcc != null ) && ( i < _accessPath.length ) )
+ {
+ controlModel = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class,
+ indexAcc.getByIndex( _accessPath[i] ) );
+ indexAcc = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class,
+ controlModel );
+ ++i;
+ }
+ return controlModel;
+ }
+
+ /* ------------------------------------------------------------------ */
+ /** retrieves a control model with a given (string) access path
*/
public XPropertySet getControlModel( String[] _accessPath ) throws com.sun.star.uno.Exception
{
diff --git a/forms/qa/integration/forms/FormPropertyBags.java b/forms/qa/integration/forms/FormPropertyBags.java
index 92aa2b8b6236..4adb04796030 100644
--- a/forms/qa/integration/forms/FormPropertyBags.java
+++ b/forms/qa/integration/forms/FormPropertyBags.java
@@ -180,7 +180,7 @@ public class FormPropertyBags extends complexlib.ComplexTestCase implements XPro
m_document = DocumentHelper.loadDocument( m_orb, documentURL );
m_formLayer = new FormLayer( m_document );
- XPropertySet textFieldModel = m_formLayer.getControlModel( new String[] { "Standard", "TextBox" } );
+ XPropertySet textFieldModel = m_formLayer.getControlModel( new int[] { 0, 0 } );
// all persistent properties should have the expected values
assure( "persistent properties did not survive reload (1)!", ((String)textFieldModel.getPropertyValue( "SomeBoundText" )).equals( "ChangedBoundText" ) );
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx
index 23c05be9f89f..3b6a6afaf5de 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -1977,7 +1977,6 @@ void OBoundControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, co
//------------------------------------------------------------------------------
void SAL_CALL OBoundControlModel::propertyChange( const PropertyChangeEvent& evt ) throw(RuntimeException)
{
- // RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setFastPropertyValue_NoBroadcast" );
// if the DBColumn value changed, transfer it to the control
if ( evt.PropertyName.equals( PROPERTY_VALUE ) )
{
@@ -2267,6 +2266,14 @@ void OBoundControlModel::impl_connectDatabaseColumn_noNotify( bool _bFromReload
m_bLoaded = sal_True;
onConnectedDbColumn( xRowSet );
+ // Some derived classes decide to cache the "current" (resp. "last known") control value, so operations like
+ // commitControlValueToDbColumn can be made a no-op when nothing actually changed.
+ // Normally, this cache is kept in sync with the column value, but during a reload, this synchronization is
+ // temporarily disable. To allow the derived classes to update their cache from the current column value,
+ // we call translateDbColumnToControlValue.
+ if ( _bFromReload && hasField() )
+ translateDbColumnToControlValue();
+
// initially transfer the db column value to the control, if we successfully connected to a database column
if ( hasField() )
initFromField( xRowSet );
diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx
index 37b9faf8a5f4..c5114fe4ea15 100644
--- a/forms/source/solar/control/navtoolbar.cxx
+++ b/forms/source/solar/control/navtoolbar.cxx
@@ -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();
diff --git a/package/inc/ByteGrabber.hxx b/package/inc/ByteGrabber.hxx
index 725b2819f371..d4869845f066 100644
--- a/package/inc/ByteGrabber.hxx
+++ b/package/inc/ByteGrabber.hxx
@@ -38,12 +38,16 @@
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <osl/mutex.hxx>
+
namespace com { namespace sun { namespace star {
namespace io { class XSeekable; class XInputStream; }
} } }
class ByteGrabber
{
protected:
+ ::osl::Mutex m_aMutex;
+
com::sun::star::uno::Reference < com::sun::star::io::XInputStream > xStream;
com::sun::star::uno::Reference < com::sun::star::io::XSeekable > xSeek;
com::sun::star::uno::Sequence < sal_Int8 > aSequence;
diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx
index a954a1691c4b..a4129f4fbbfe 100644
--- a/package/inc/ZipFile.hxx
+++ b/package/inc/ZipFile.hxx
@@ -65,6 +65,8 @@ class EncryptionData;
class ZipFile
{
protected:
+ ::osl::Mutex m_aMutex;
+
::rtl::OUString sComment; /* zip file comment */
EntryHash aEntries;
ByteGrabber aGrabber;
diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx
index 0549c06b6bb7..72cba808de15 100644
--- a/package/inc/ZipPackage.hxx
+++ b/package/inc/ZipPackage.hxx
@@ -91,6 +91,7 @@ protected:
::rtl::OUString m_aURL;
sal_Bool m_bHasEncryptedEntries;
sal_Bool m_bHasNonEncryptedEntries;
+ sal_Bool m_bInconsistent;
sal_Bool m_bUseManifest;
sal_Bool m_bForceRecovery;
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 4d0af7bb7619..74c30049e9bd 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -4780,7 +4780,10 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName,
//TODO: think about interaction handler
- if ( m_pData->m_bReadOnlyWrap )
+ // WORKAROUND:
+ // The old document might have no version in the manifest.xml, so we have to allow to set the version
+ // even for readonly storages, so that the version from content.xml can be used.
+ if ( m_pData->m_bReadOnlyWrap && !aPropertyName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ) ) )
throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // TODO: Access denied
if ( m_pData->m_nStorageType == ZIP_STORAGE )
@@ -4800,11 +4803,16 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName,
aValue >>= m_pImpl->m_aVersion;
m_pImpl->m_bControlVersion = sal_True;
- m_pImpl->m_bBroadcastModified = sal_True;
- m_pImpl->m_bIsModified = sal_True;
+ // this property can be set even for readonly storage
+ if ( !m_pData->m_bReadOnlyWrap )
+ {
+ m_pImpl->m_bBroadcastModified = sal_True;
+ m_pImpl->m_bIsModified = sal_True;
+ }
}
else if ( m_pData->m_bIsRoot && ( aPropertyName.equalsAscii( "HasEncryptedEntries" )
|| aPropertyName.equalsAscii( "HasNonEncryptedEntries" )
+ || aPropertyName.equalsAscii( "IsInconsistent" )
|| aPropertyName.equalsAscii( "URL" )
|| aPropertyName.equalsAscii( "RepairPackage" ) )
|| aPropertyName.equalsAscii( "IsRoot" )
@@ -4939,7 +4947,9 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const ::rtl::OUString& aPropertyNa
return uno::makeAny( sal_False ); // RepairPackage
}
else if ( m_pData->m_nStorageType == PACKAGE_STORAGE
- && ( aPropertyName.equalsAscii( "HasEncryptedEntries" ) || aPropertyName.equalsAscii( "HasNonEncryptedEntries" ) ) )
+ && ( aPropertyName.equalsAscii( "HasEncryptedEntries" )
+ || aPropertyName.equalsAscii( "HasNonEncryptedEntries" )
+ || aPropertyName.equalsAscii( "IsInconsistent" ) ) )
{
try {
m_pImpl->ReadContents();
diff --git a/package/source/zipapi/ByteGrabber.cxx b/package/source/zipapi/ByteGrabber.cxx
index 7e8433d77837..84cd6465f7bf 100644
--- a/package/source/zipapi/ByteGrabber.cxx
+++ b/package/source/zipapi/ByteGrabber.cxx
@@ -51,8 +51,10 @@ ByteGrabber::ByteGrabber(uno::Reference < io::XInputStream > xIstream)
ByteGrabber::~ByteGrabber()
{
}
+
void ByteGrabber::setInputStream (uno::Reference < io::XInputStream > xNewStream)
{
+ ::osl::MutexGuard aGuard( m_aMutex );
xStream = xNewStream;
xSeek = uno::Reference < io::XSeekable > (xNewStream, uno::UNO_QUERY);
}
@@ -62,6 +64,7 @@ sal_Int32 SAL_CALL ByteGrabber::readBytes( uno::Sequence< sal_Int8 >& aData,
sal_Int32 nBytesToRead )
throw(io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException)
{
+ ::osl::MutexGuard aGuard( m_aMutex );
return xStream->readBytes(aData, nBytesToRead );
}
@@ -69,6 +72,7 @@ sal_Int32 SAL_CALL ByteGrabber::readBytes( uno::Sequence< sal_Int8 >& aData,
sal_Int64 SAL_CALL ByteGrabber::seek( sal_Int64 location )
throw(lang::IllegalArgumentException, io::IOException, uno::RuntimeException)
{
+ ::osl::MutexGuard aGuard( m_aMutex );
if (xSeek.is() )
{
sal_Int64 nLen = xSeek->getLength();
@@ -82,32 +86,40 @@ sal_Int64 SAL_CALL ByteGrabber::seek( sal_Int64 location )
else
throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
}
+
sal_Int64 SAL_CALL ByteGrabber::getPosition( )
throw(io::IOException, uno::RuntimeException)
{
+ ::osl::MutexGuard aGuard( m_aMutex );
if (xSeek.is() )
return xSeek->getPosition();
else
throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
}
+
sal_Int64 SAL_CALL ByteGrabber::getLength( )
throw(io::IOException, uno::RuntimeException)
{
+ ::osl::MutexGuard aGuard( m_aMutex );
if (xSeek.is() )
return xSeek->getLength();
else
throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
}
+
ByteGrabber& ByteGrabber::operator >> (sal_Int8& rInt8)
{
+ ::osl::MutexGuard aGuard( m_aMutex );
if (xStream->readBytes(aSequence,1) != 1)
rInt8 = 0;
else
rInt8 = aSequence[0] & 0xFF;
return *this;
}
+
ByteGrabber& ByteGrabber::operator >> (sal_Int16& rInt16)
{
+ ::osl::MutexGuard aGuard( m_aMutex );
if (xStream->readBytes ( aSequence, 2) != 2)
rInt16 = 0;
else
@@ -119,8 +131,11 @@ ByteGrabber& ByteGrabber::operator >> (sal_Int16& rInt16)
}
return *this;
}
+
ByteGrabber& ByteGrabber::operator >> (sal_Int32& rInt32)
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
if (xStream->readBytes(aSequence, 4) != 4)
rInt32 = 0;
else
@@ -137,6 +152,8 @@ ByteGrabber& ByteGrabber::operator >> (sal_Int32& rInt32)
ByteGrabber& ByteGrabber::operator >> (sal_uInt8& rInt8)
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
if (xStream->readBytes(aSequence,1) != 1)
rInt8 = 0;
else
@@ -145,6 +162,8 @@ ByteGrabber& ByteGrabber::operator >> (sal_uInt8& rInt8)
}
ByteGrabber& ByteGrabber::operator >> (sal_uInt16& rInt16)
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
if (xStream->readBytes(aSequence, 2) != 2)
rInt16 = 0;
else
@@ -158,6 +177,8 @@ ByteGrabber& ByteGrabber::operator >> (sal_uInt16& rInt16)
}
ByteGrabber& ByteGrabber::operator >> (sal_uInt32& ruInt32)
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
if (xStream->readBytes(aSequence, 4) != 4)
ruInt32 = 0;
else
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index 246cbd889015..f6dafac4cb6a 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -122,6 +122,8 @@ ZipFile::~ZipFile()
void ZipFile::setInputStream ( Reference < XInputStream > xNewStream )
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
xStream = xNewStream;
xSeek = Reference < XSeekable > ( xStream, UNO_QUERY );
aGrabber.setInputStream ( xStream );
@@ -381,6 +383,8 @@ sal_Bool ZipFile::StaticHasValidPassword( const Sequence< sal_Int8 > &aReadBuffe
sal_Bool ZipFile::hasValidPassword ( ZipEntry & rEntry, const ORef < EncryptionData > &rData )
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
sal_Bool bRet = sal_False;
if ( rData->aKey.getLength() )
{
@@ -499,6 +503,8 @@ Reference < XInputStream > ZipFile::createUnbufferedStream(
sal_Bool bIsEncrypted,
::rtl::OUString aMediaType )
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
return new XUnbufferedStream ( aMutexHolder, rEntry, xStream, rData, nStreamMode, bIsEncrypted, aMediaType, bRecoveryMode );
}
@@ -514,6 +520,8 @@ Reference< XInputStream > SAL_CALL ZipFile::getInputStream( ZipEntry& rEntry,
SotMutexHolderRef aMutexHolder )
throw(IOException, ZipException, RuntimeException)
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
if ( rEntry.nOffset <= 0 )
readLOC( rEntry );
@@ -543,6 +551,8 @@ Reference< XInputStream > SAL_CALL ZipFile::getDataStream( ZipEntry& rEntry,
ZipException,
RuntimeException )
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
if ( rEntry.nOffset <= 0 )
readLOC( rEntry );
@@ -579,6 +589,8 @@ Reference< XInputStream > SAL_CALL ZipFile::getRawData( ZipEntry& rEntry,
SotMutexHolderRef aMutexHolder )
throw(IOException, ZipException, RuntimeException)
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
if ( rEntry.nOffset <= 0 )
readLOC( rEntry );
@@ -595,6 +607,8 @@ Reference< XInputStream > SAL_CALL ZipFile::getWrappedRawStream(
ZipException,
RuntimeException )
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
if ( rData.isEmpty() )
throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
@@ -607,6 +621,8 @@ Reference< XInputStream > SAL_CALL ZipFile::getWrappedRawStream(
sal_Bool ZipFile::readLOC( ZipEntry &rEntry )
throw(IOException, ZipException, RuntimeException)
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
sal_Int32 nTestSig, nTime, nCRC, nSize, nCompressedSize;
sal_Int16 nVersion, nFlag, nHow, nPathLen, nExtraLen;
sal_Int32 nPos = -rEntry.nOffset;
@@ -660,6 +676,7 @@ sal_Bool ZipFile::readLOC( ZipEntry &rEntry )
sal_Int32 ZipFile::findEND( )
throw(IOException, ZipException, RuntimeException)
{
+ // this method is called in constructor only, no need for mutex
sal_Int32 nLength, nPos, nEnd;
Sequence < sal_Int8 > aBuffer;
try
@@ -701,6 +718,7 @@ sal_Int32 ZipFile::findEND( )
sal_Int32 ZipFile::readCEN()
throw(IOException, ZipException, RuntimeException)
{
+ // this method is called in constructor only, no need for mutex
sal_Int32 nCenLen, nCenPos = -1, nCenOff, nEndPos, nLocPos;
sal_uInt16 nCount, nTotal;
@@ -807,6 +825,8 @@ sal_Int32 ZipFile::readCEN()
sal_Int32 ZipFile::recover()
throw(IOException, ZipException, RuntimeException)
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
sal_Int32 nLength;
Sequence < sal_Int8 > aBuffer;
Sequence < sal_Int32 > aHeaderOffsets;
@@ -974,6 +994,8 @@ sal_Int32 ZipFile::recover()
sal_Bool ZipFile::checkSizeAndCRC( const ZipEntry& aEntry )
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
sal_Int32 nSize = 0, nCRC = 0;
if( aEntry.nMethod == STORED )
@@ -985,6 +1007,8 @@ sal_Bool ZipFile::checkSizeAndCRC( const ZipEntry& aEntry )
sal_Int32 ZipFile::getCRC( sal_Int32 nOffset, sal_Int32 nSize )
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
Sequence < sal_Int8 > aBuffer;
CRC32 aCRC;
sal_Int32 nBlockSize = ::std::min( nSize, static_cast< sal_Int32 >( 32000 ) );
@@ -1002,6 +1026,8 @@ sal_Int32 ZipFile::getCRC( sal_Int32 nOffset, sal_Int32 nSize )
void ZipFile::getSizeAndCRC( sal_Int32 nOffset, sal_Int32 nCompressedSize, sal_Int32 *nSize, sal_Int32 *nCRC )
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
Sequence < sal_Int8 > aBuffer;
CRC32 aCRC;
sal_Int32 nRealSize = 0;
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index b95711778e77..6ca9981d2291 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -201,6 +201,7 @@ ZipPackage::ZipPackage (const uno::Reference < XMultiServiceFactory > &xNewFacto
: m_aMutexHolder( new SotMutexHolder )
, m_bHasEncryptedEntries ( sal_False )
, m_bHasNonEncryptedEntries ( sal_False )
+, m_bInconsistent ( sal_False )
, m_bUseManifest ( sal_True )
, m_bForceRecovery ( sal_False )
, m_bMediaTypeFallbackUsed ( sal_False )
@@ -426,20 +427,23 @@ void ZipPackage::parseManifest()
m_xRootFolder->removeByName( sMimetype );
}
+ m_bInconsistent = m_pRootFolder->LookForUnexpectedODF12Streams( ::rtl::OUString() );
+
sal_Bool bODF12AndOlder = ( m_pRootFolder->GetVersion().compareTo( ODFVER_012_TEXT ) >= 0 );
- if ( !m_bForceRecovery && bODF12AndOlder && m_pRootFolder->LookForUnexpectedODF12Streams( ::rtl::OUString() ) )
+ if ( !m_bForceRecovery && bODF12AndOlder && m_bInconsistent )
{
- // this is an ODF1.2 document that contains streams not referred in the manifest.xml
+ // this is an ODF1.2 document that contains streams not referred in the manifest.xml;
+ // in case of ODF1.2 documents without version in manifest.xml the property IsInconsistent
+ // should be checked later
throw ZipIOException(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "there are streams not referred in manifest.xml\n" ) ),
uno::Reference< uno::XInterface >() );
}
+ // in case it is a correct ODF1.2 document, the version must be set
+ // and the META-INF folder is reserved for package format
if ( bODF12AndOlder )
- {
- // it is ODF1.2 or later, let the META-INF folder be unavailable for user
m_xRootFolder->removeByName( sMeta );
- }
}
}
@@ -1633,6 +1637,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const
if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HasEncryptedEntries") )
||aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HasNonEncryptedEntries") )
+ ||aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("IsInconsistent") )
||aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MediaTypeFallbackUsed") ) )
throw PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
else if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EncryptionKey") ) )
@@ -1671,6 +1676,11 @@ Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName )
aAny <<= m_bHasNonEncryptedEntries;
return aAny;
}
+ else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "IsInconsistent" ) ) )
+ {
+ aAny <<= m_bInconsistent;
+ return aAny;
+ }
else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "UseManifest" ) ) )
{
aAny <<= m_bUseManifest;
diff --git a/setup_native/prj/build.lst b/setup_native/prj/build.lst
index 8835ff0d6ad2..05200fdf938a 100644
--- a/setup_native/prj/build.lst
+++ b/setup_native/prj/build.lst
@@ -1,4 +1,4 @@
-pk setup_native : transex3 soltools sal xml2cmp 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
diff --git a/setup_native/prj/d.lst b/setup_native/prj/d.lst
index a573b94fd5cb..9d429454ebba 100644
--- a/setup_native/prj/d.lst
+++ b/setup_native/prj/d.lst
@@ -8,6 +8,7 @@ mkdir: %_DEST%\bin%_EXT%\userscripts
..\%__SRC%\bin\uninstall %_DEST%\bin%_EXT%\userscripts\uninstall
..\%__SRC%\bin\noarch\fake-db-1.0-0.noarch.rpm %_DEST%\bin%_EXT%\openoffice.org-userland-1.0-0.noarch.rpm
+mkdir: %_DEST%\bin%_EXT%\osolsmf
..\%__SRC%\bin\ulfconv %_DEST%\bin%_EXT%\ulfconv
..\%__SRC%\bin\langpackscript.sh %_DEST%\bin%_EXT%\langpackscript.sh
..\%__SRC%\bin\linuxpatchscript.sh %_DEST%\bin%_EXT%\linuxpatchscript.sh
@@ -33,6 +34,10 @@ mkdir: %_DEST%\bin%_EXT%\userscripts
..\source\java\openofficeorg_setup.gif %_DEST%\bin%_EXT%\osl\Setup.gif
..\source\java\javaversion.dat %_DEST%\bin%_EXT%\javaversion.dat
..\source\java\javaversion2.dat %_DEST%\bin%_EXT%\javaversion2.dat
+..\source\opensolaris\bundledextensions\installed %_DEST%\bin%_EXT%\osolsmf\installed
+..\source\opensolaris\bundledextensions\README %_DEST%\bin%_EXT%\osolsmf\README
+..\source\opensolaris\bundledextensions\ooo_bundled_extensions.xml %_DEST%\bin%_EXT%\osolsmf\ooo_bundled_extensions.xml
+..\source\opensolaris\bundledextensions\svc-ooo_bundled_extensions %_DEST%\bin%_EXT%\osolsmf\svc-ooo_bundled_extensions
..\source\packinfo\solariscopyrightfile %_DEST%\bin%_EXT%\solariscopyrightfile
..\source\packinfo\*.txt %_DEST%\bin%_EXT%\*.txt
..\source\packinfo\*.pcp %_DEST%\bin%_EXT%\*.pcp
diff --git a/setup_native/scripts/admin.pl b/setup_native/scripts/admin.pl
index 81d5649ffec6..ebb16d0ef008 100644
--- a/setup_native/scripts/admin.pl
+++ b/setup_native/scripts/admin.pl
@@ -46,6 +46,7 @@ BEGIN
$savetemppath = "";
$msiinfo_available = 0;
$path_displayed = 0;
+ $localmsidbpath = "";
$plat = $^O;
@@ -69,7 +70,7 @@ sub usage
{
print <<Ende;
----------------------------------------------------------------------
-$prog V1.0 (c) Sun Microsystems 2008
+$prog V1.0 (c) Sun Microsystems 2009
This program installs a Windows Installer installation set
without using msiexec.exe. The installation is comparable
with an administrative installation using the Windows Installer
@@ -150,6 +151,33 @@ sub controlparameter
}
#############################################################################
+# The program msidb.exe can be located next to the Perl program. Then it is
+# not neccessary to find it in the PATH variable.
+#############################################################################
+
+sub check_local_msidb
+{
+ my $msidbname = "msidb.exe";
+ my $perlprogramm = $0;
+ my $path = $perlprogramm;
+
+ get_path_from_fullqualifiedname(\$path);
+
+ $path =~ s/\\\s*$//;
+ $path =~ s/\/\s*$//;
+
+ my $msidbpath = "";
+ if ( $path =~ /^\s*$/ ) { $msidbpath = $msidbname; }
+ else { $msidbpath = $path . $separator . $msidbname; }
+
+ if ( -f $msidbpath )
+ {
+ $localmsidbpath = $msidbpath;
+ print "Using $msidbpath (next to \"admin.pl\")\n";
+ }
+}
+
+#############################################################################
# Converting a string list with separator $listseparator
# into an array
#############################################################################
@@ -198,7 +226,8 @@ sub check_system_path
}
my $patharrayref = convert_stringlist_into_array(\$pathvariable, $local_pathseparator);
- my @needed_files_in_path = ("msidb.exe", "expand.exe");
+ my @needed_files_in_path = ("expand.exe");
+ if ( $localmsidbpath eq "" ) { push(@needed_files_in_path, "msidb.exe"); } # not found locally -> search in path
my @optional_files_in_path = ("msiinfo.exe");
print("\nChecking required files:\n");
@@ -386,7 +415,7 @@ sub get_path_from_fullqualifiedname
if ( $$longfilenameref =~ /\Q$separator\E/ ) # Is there a separator in the path? Otherwise the path is empty.
{
- if ( $$longfilenameref =~ /^\s*(\S.*\S\Q$separator\E)(\S.+\S?)/ )
+ if ( $$longfilenameref =~ /^\s*(\S.*\Q$separator\E)(\S.+\S?)/ )
{
$$longfilenameref = $1;
}
@@ -486,6 +515,7 @@ sub extract_tables_from_database
my ($fullmsidatabasepath, $workdir, $tablelist) = @_;
my $msidb = "msidb.exe"; # Has to be in the path
+ if ( $localmsidbpath ) { $msidb = $localmsidbpath; }
my $infoline = "";
my $systemcall = "";
my $returnvalue = "";
@@ -513,6 +543,117 @@ sub extract_tables_from_database
}
}
+########################################################
+# Check, if this installation set contains
+# internal cabinet files included into the msi
+# database.
+########################################################
+
+sub check_for_internal_cabfiles
+{
+ my ($cabfilehash) = @_;
+
+ my $contains_internal_cabfiles = 0;
+ my %allcabfileshash = ();
+
+ foreach my $filename ( keys %{$cabfilehash} )
+ {
+ if ( $filename =~ /^\s*\#/ ) # starting with a hash
+ {
+ $contains_internal_cabfiles = 1;
+ # setting real filename without hash as key and name with hash as value
+ my $realfilename = $filename;
+ $realfilename =~ s/^\s*\#//;
+ $allcabfileshash{$realfilename} = $filename;
+ }
+ }
+
+ return ( $contains_internal_cabfiles, \%allcabfileshash );
+}
+
+#################################################################
+# Exclude all cab files from the msi database.
+#################################################################
+
+sub extract_cabs_from_database
+{
+ my ($msidatabase, $allcabfiles) = @_;
+
+ my $infoline = "";
+ my $fullsuccess = 1;
+ my $msidb = "msidb.exe"; # Has to be in the path
+ if ( $localmsidbpath ) { $msidb = $localmsidbpath; }
+
+ my @all_excluded_cabfiles = ();
+
+ if( $^O =~ /cygwin/i )
+ {
+ $msidatabase = qx{cygpath -w "$msidatabase"};
+ $msidatabase =~ s/\\/\\\\/g;
+ $msidatabase =~ s/\s*$//g;
+ }
+ else
+ {
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ $msidatabase =~ s/\//\\\\/g;
+ }
+
+ foreach my $onefile ( keys %{$allcabfiles} )
+ {
+ my $systemcall = $msidb . " -d " . $msidatabase . " -x " . $onefile;
+ system($systemcall);
+ push(@all_excluded_cabfiles, $onefile);
+ }
+
+ \@all_excluded_cabfiles;
+}
+
+################################################################################
+# Collect all DiskIds to the corresponding cabinet files from Media.idt.
+################################################################################
+
+sub analyze_media_file
+{
+ my ($filecontent) = @_;
+
+ my %diskidhash = ();
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( $i < 3 ) { next; }
+
+ if ( ${$filecontent}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ my $diskid = $1;
+ my $cabfile = $4;
+
+ $diskidhash{$cabfile} = $diskid;
+ }
+ }
+
+ return \%diskidhash;
+}
+
+sub analyze_customaction_file
+{
+ my ($filecontent) = @_;
+
+ my $register_extensions_exists = 0;
+
+ my %table = ();
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( ${$filecontent}[$i] =~ /^\s*RegisterExtensions\s+/ )
+ {
+ $register_extensions_exists = 1;
+ last;
+ }
+ }
+
+ return $register_extensions_exists;
+}
+
################################################################################
# Analyzing the content of Directory.idt
#################################################################################
@@ -930,6 +1071,10 @@ sub register_one_extension
$localextension =~ s/\\/\\\\/g;
}
+ if ( $^O =~ /cygwin/i ) {
+ $executable = "./" . $executable;
+ }
+
my $systemcall = $executable . " add --shared --verbose " . "\"" . $localextension . "\"" . " -env:UserInstallation=file://" . $temppath . " 2\>\&1 |";
print "... $systemcall\n";
@@ -1142,6 +1287,7 @@ $starttime = time();
getparameter();
controlparameter();
+check_local_msidb();
check_system_path();
my $temppath = get_temppath();
@@ -1153,9 +1299,36 @@ create_directory($helperdir);
# Get File.idt, Component.idt and Directory.idt from database
-my $tablelist = "File Directory Component";
+my $tablelist = "File Directory Component Media CustomAction";
extract_tables_from_database($databasepath, $helperdir, $tablelist);
+# Set unpackdir
+my $unpackdir = $helperdir . $separator . "unpack";
+create_directory($unpackdir);
+
+# Reading media table to check for internal cabinet files
+my $filename = $helperdir . $separator . "Media.idt";
+if ( ! -f $filename ) { exit_program("ERROR: Could not find required file: $filename !"); }
+my $filecontent = read_file($filename);
+my $cabfilehash = analyze_media_file($filecontent);
+
+# Check, if there are internal cab files
+my ( $contains_internal_cabfiles, $all_internal_cab_files) = check_for_internal_cabfiles($cabfilehash);
+
+if ( $contains_internal_cabfiles )
+{
+ # Set unpackdir
+ my $cabdir = $helperdir . $separator . "internal_cabs";
+ create_directory($cabdir);
+ my $from = cwd();
+ chdir($cabdir);
+ # Exclude all cabinet files from database
+ my $all_excluded_cabs = extract_cabs_from_database($databasepath, $all_internal_cab_files);
+ print "Unpacking files from internal cabinet file(s)\n";
+ foreach my $cabfile ( @{$all_excluded_cabs} ) { unpack_cabinet_file($cabfile, $unpackdir); }
+ chdir($from);
+}
+
# Unpack all cab files into $helperdir, cab files must be located next to msi database
my $installdir = $databasepath;
@@ -1166,11 +1339,7 @@ make_absolute_filename_to_relative_filename(\$databasefilename);
my $cabfiles = find_file_with_file_extension("cab", $installdir);
-if ( $#{$cabfiles} < 0 ) { exit_program("ERROR: Did not find any cab file in directory $installdir"); }
-
-# Set unpackdir
-my $unpackdir = $helperdir . $separator . "unpack";
-create_directory($unpackdir);
+if (( $#{$cabfiles} < 0 ) && ( ! $contains_internal_cabfiles )) { exit_program("ERROR: Did not find any cab file in directory $installdir"); }
print "Unpacking files from cabinet file(s)\n";
for ( my $i = 0; $i <= $#{$cabfiles}; $i++ )
@@ -1180,8 +1349,8 @@ for ( my $i = 0; $i <= $#{$cabfiles}; $i++ )
}
# Reading tables
-my $filename = $helperdir . $separator . "Directory.idt";
-my $filecontent = read_file($filename);
+$filename = $helperdir . $separator . "Directory.idt";
+$filecontent = read_file($filename);
my $dirhash = analyze_directory_file($filecontent);
$filename = $helperdir . $separator . "Component.idt";
@@ -1203,8 +1372,16 @@ my $msidatabase = $targetdir . $separator . $databasefilename;
my $copyreturn = copy($databasepath, $msidatabase);
if ( ! $copyreturn) { exit_program("ERROR: Could not copy $source to $dest\n"); }
-# Registering extensions
-register_extensions($unopkgfile, $extensions, $temppath);
+# Reading tables
+$filename = $helperdir . $separator . "CustomAction.idt";
+$filecontent = read_file($filename);
+my $register_extensions_exists = analyze_customaction_file($filecontent);
+
+if ( $register_extensions_exists )
+{
+ # Registering extensions
+ register_extensions($unopkgfile, $extensions, $temppath);
+}
# Saving info in Summary Information Stream of msi database (required for following patches)
if ( $msiinfo_available ) { write_sis_info($msidatabase); }
diff --git a/setup_native/source/opensolaris/bundledextensions/README b/setup_native/source/opensolaris/bundledextensions/README
new file mode 100644
index 000000000000..f64c225d9df9
--- /dev/null
+++ b/setup_native/source/opensolaris/bundledextensions/README
@@ -0,0 +1,80 @@
+================================================================================
+Installation information
+================================================================================
+
+In order to properly install the bundled extensions, such as dictionaries, it is
+necessary that the files
+
+installed
+ooo_bundled_extensions.xml
+svc-ooo_bundled_extensions
+
+are part of the OpenOffice.org IPS package. They must be added to the package
+after all other files have been added. Those other files are the SVR4 packages
+of OOo which can be imported by pkg (pkg import).
+The files have to be uploaded this way:
+
+pkgsend -s url_to_pkg_server add file installed mode=644 owner=root group=bin path=${EXTENSIONPATH}/installed restart_fmri=svc:/application/ooo_bundled_extensions:default
+pkgsend -s url_to_pkg_server add file svc-ooo_bundled_extensions mode=744 owner=root group=bin path=/lib/svc/method/svc-ooo_bundled_extensions
+pkgsend -s url_to_pkg_server add file ooo_bundled_extensions.xml mode=644 owner=root group=bin path=/var/svc/manifest/application/ooo_bundled_extensions.xml restart_fmri=svc:/system/manifest-import:default
+
+
+---
+
+${EXTENSIONPATH} must be replaced by the path to the folder containing the
+bundled extensions. This path changes with every major release of OOo because of
+the version number which is part of a folder name. The
+current value is:
+
+EXTENSIONPATH=/opt/openoffice.org3/share/extension/install
+
+The service was tested with OpenSolaris release 2009.6 and may not work with a
+previous release.
+
+
+================================================================================
+What do these files do
+================================================================================
+
+The three files constitute a SMF service. When this service is started, then it
+installes the bundled extensions which are contained in
+/opt/openoffice.org3/share/extension/install. To install them, the service calls
+"unopkg add --shared ..." with the appropriate arguments.
+
+The service is started initially after the installation of
+ooo_bundled_extensions.xml. At this time, all files of OOo, including the
+extensions, have been copied to their destination. The service calls unopkg on
+behalf of every extension and adds the path to that extension to the file
+'installed'. The file 'installed' is used to remember what extensions have
+already been installed with unopkg. This will prevent to reinstall those
+extensions whenever the service is restarted.
+
+When a new version of OOo becomes available, then the respective OOo package
+containes a new version of 'installed'. That is, it contains a version string,
+such as 3.2.0. The sole reason for that string is, to change the content of this
+file in every release. Otherwise IPS would not replace the installed version of
+'installed' with the one contained in the package.
+
+The update procedure of OOo will replace 'installed'. 'installed' is associated
+with a restart_fmri of the service ooo_bundled_extensions. That is after
+copying 'installed' the service will be restarted. It then installes all
+extensions contained in /opt/openoffice.org3/share/extension/install, because
+the newly installed 'installed' file does not contain any entries yet, except
+for the version string.
+
+
+================================================================================
+Known issues
+================================================================================
+
+If OOo, which contains this service, is uninstalled and later it is installed
+again, then the bundled extensions are not installed. That is, unopkg is not
+called to install them with OOo's Extensions Manager. The reasons is a bug in
+OpenSolaris:
+
+http://defect.opensolaris.org/bz/show_bug.cgi?id=5742
+
+To work around this, one can call after uninstalling OOo
+
+svccfg delete -f ooo_bundled_extensions
+svccfg delete smf/manifest
diff --git a/setup_native/source/opensolaris/bundledextensions/installed b/setup_native/source/opensolaris/bundledextensions/installed
new file mode 100644
index 000000000000..0c8d8df5ae26
--- /dev/null
+++ b/setup_native/source/opensolaris/bundledextensions/installed
@@ -0,0 +1 @@
+${OOOPACKAGEVERSION}
diff --git a/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml b/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml
new file mode 100644
index 000000000000..66acd508c281
--- /dev/null
+++ b/setup_native/source/opensolaris/bundledextensions/ooo_bundled_extensions.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+
+<service_bundle type="manifest" name="ooo_bundled_extensions">
+
+<service
+ name="application/ooo_bundled_extensions"
+ type="service"
+ version="1">
+
+ <create_default_instance enabled="true" />
+ <single_instance/>
+
+ <dependency name="service_available"
+ grouping="require_all"
+ restart_on="none"
+ type="service">
+ <service_fmri value="svc:/system/filesystem/local:default" />
+ </dependency>
+
+ <exec_method
+ type="method" name="start"
+ exec="/lib/svc/method/svc-ooo_bundled_extensions start"
+ timeout_seconds="160">
+ <method_context>
+ <method_credential user="root" group="root" />
+ </method_context>
+ </exec_method>
+
+
+ <exec_method
+ type="method" name="stop"
+ exec="/lib/svc/method/svc-ooo_bundled_extensions stop"
+ timeout_seconds="160" >
+ <method_context>
+ <method_credential user="root" group="root" />
+ </method_context>
+ </exec_method>
+
+ <property_group name="startd" type="framework">
+ <propval name="duration" type="astring"
+ value="transient" />
+ <propval name="ignore_error"
+ type="astring" value="core,signal" />
+
+ </property_group>
+
+ <stability value="Unstable" />
+
+ <template>
+ <common_name>
+ <loctext xml:lang="C">
+ Installation of OpenOffice.org's bundled extensions.
+ </loctext>
+ </common_name>
+ </template>
+</service>
+
+</service_bundle>
diff --git a/setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions b/setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions
new file mode 100644
index 000000000000..696277011133
--- /dev/null
+++ b/setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions
@@ -0,0 +1,108 @@
+#!/sbin/sh
+
+. /lib/svc/share/smf_include.sh
+
+#The start method is used for installing and updating the
+#extensions. The service keeps a list
+#(share/extensions/install/installed) of the extensions which were
+#already installed. During installation, the bundled extensions are
+#copied to the install folder (share/extensions/install). Finally this
+#service, which is part of the office installation package, will be
+#started and the start "method" of this script is called. Then all
+#extensions in the "install" folder are checked if they are already
+#installed by reading the list "installed". Because the list is empty
+#at this time, all the extensions will be installed.
+#
+#If this service is restarted then the script checks if there is an
+#extensions which is not yet installed, that is there is no entry for
+#it in the 'installed' file. Only if this is the case then that
+#extensions will be installed and its path is added to 'installed'.
+#
+#In case of an update, new versions of existing extensions and
+#completely new extensions may be copied to the 'install' folder. Also
+#a new 'installed' file will be copied which replaces the existing
+#file. The new 'installed' file does not contain any entries of
+#installed extensions. Therefore the next time when the start method is
+#run all extensions contained in share/extensions/install will be
+#installed.
+
+#Create the folder which contains the temporary user installation
+INSTDIR=`/usr/bin/mktemp -d "/tmp/userinstall.XXXXXX"`
+
+OOO_BASE_DIR="/opt/openoffice.org/basis${OOOBASEVERSION}"
+
+case "$1" in
+'start')
+ EXTENSIONDIR=/opt/openoffice.org${OOOBRANDPACKAGEVERSION}/share/extension/install
+ for FILE in $EXTENSIONDIR/*.oxt
+ do
+ #We check if the file exist, because if there is no extension
+ #then $FILE will contain "<..>/*.oxt"
+ if [ -f "$FILE" ]; then
+ #Determine if this extension is already installed. We do
+ #that by checking the file "installed" which contains a
+ #list of all installed extensions including the full path
+ EXTENSIONFILE=`basename $FILE`
+ INSTALLED=`sed -n "/$EXTENSIONFILE/p" $EXTENSIONDIR/installed`
+
+ if [ -z "$INSTALLED" ]; then
+ #We have not found the name of the extension in the
+ #list. That is, it has not been installed (with unopkg) yet.
+ #Therefore we do it now.
+ echo installing $FILE
+ /opt/openoffice.org${OOOBRANDPACKAGEVERSION}/program/unopkg add --shared --bundled "$FILE" '-env:UserInstallation=file://$INSTDIR' '-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+ #Let us remember that this extensions has been installed
+ #by adding the path name of the extension to the file
+ #installed
+ echo $FILE >> $EXTENSIONDIR/installed
+ fi
+ fi
+ done
+
+ #Now check for extensions which need to be uninstalled
+ #(unopkg). This is the case if the list of extensions in the file
+ #installed contains the name of an extension which does not exist
+ #in the the folder <..>/share/extension/install.
+# LINE=""
+# NEWCONTENT=""
+# REMOVED=""
+# LIST=`cat $EXTENSIONDIR/installed`
+# #remove blank lines
+# LIST=`echo "$LIST" | sed '/^[:blank:]*$/d'`
+
+# echo "$LIST" | while [ 1 ]
+# do
+# read LINE || break
+# if [ ! -f "$LINE" ]; then
+# #The extension file has been removed from
+# #share/extension/install. Now we remove the installed
+# #extension
+# echo removing `basename $LINE`
+# /opt/openoffice.org${OOOBRANDPACKAGEVERSION}/program/unopkg remove --shared --bundled "`basename $LINE`" '-env:UserInstallation=file://$INSTDIR' '-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' '-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1'
+# REMOVED=1
+# else
+# NEWCONTENT+=$LINE
+# NEWCONTENT+="\n"
+# fi
+# done
+
+# #Write the new list to the file "installed". It now has all names
+# #remove which refered to previously removed extensions (removed
+# #from .../share/extension/install)
+# if [ "$REMOVED" ]; then
+# #remove the last empty line
+# NEWCONTENT=`echo "$NEWCONTENT" | sed '/^[:space:]*$/d'`
+# echo "$NEWCONTENT" > $EXTENSIONDIR/installed
+# fi
+
+ ;;
+ 'stop')
+ echo "#### stop ####"
+ ;;
+ *)
+ echo "Usage: $0 { start | stop }"
+ exit 1
+ ;;
+esac
+
+exit $SMF_EXIT_OK
diff --git a/setup_native/source/packinfo/packinfo_office.txt b/setup_native/source/packinfo/packinfo_office.txt
index cd0885b2184f..b3e68ac17bff 100755
--- a/setup_native/source/packinfo/packinfo_office.txt
+++ b/setup_native/source/packinfo/packinfo_office.txt
@@ -636,6 +636,22 @@ packageversion = "%OOOPACKAGEVERSION"
End
Start
+module = "gid_Module_Root_Extension_Dictionary_He"
+script = "shellscripts_extensions.txt"
+solarispackagename = "%PACKAGEPREFIX%WITHOUTDOTUNIXPRODUCTNAME%BRANDPACKAGEVERSION-dict-he"
+solarisrequires = "%SOLSUREPACKAGEPREFIX-ure, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07, %PACKAGEPREFIX%WITHOUTDOTUNIXPRODUCTNAME%BRANDPACKAGEVERSION"
+packagename = "%UNIXPRODUCTNAME%BRANDPACKAGEVERSION-dict-he"
+requires = "%UREPACKAGEPREFIX-ure,%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07,%UNIXPRODUCTNAME%BRANDPACKAGEVERSION"
+linuxpatchrequires = ""
+copyright = "1999-2009 by Sun Microsystems"
+solariscopyright = "solariscopyrightfile"
+vendor = "Sun Microsystems, Inc."
+description = "He dictionary for %PRODUCTNAME %PRODUCTVERSION"
+destpath = "/opt"
+packageversion = "%PACKAGEVERSION"
+End
+
+Start
module = "gid_Module_Root_Extension_Dictionary_Hu"
script = "shellscripts_extensions.txt"
solarispackagename = "%PACKAGEPREFIX%WITHOUTDOTUNIXPRODUCTNAME%BRANDPACKAGEVERSION-dict-hu"
diff --git a/setup_native/source/packinfo/spellchecker_selection.txt b/setup_native/source/packinfo/spellchecker_selection.txt
index d7f7f7d53d9f..2abcc10db890 100644
--- a/setup_native/source/packinfo/spellchecker_selection.txt
+++ b/setup_native/source/packinfo/spellchecker_selection.txt
@@ -13,6 +13,7 @@ es = "en-US,es,fr,pt"
et = "en-US,et"
fr = "en-US,es,fr"
gl = "en-US,pt,es,gl"
+he = "en-US,he"
hu = "de,en-US,hu"
it = "de,en-US,fr,it"
ja = "en-US"
diff --git a/setup_native/source/ulfconv/ulfconv.cxx b/setup_native/source/ulfconv/ulfconv.cxx
index 6ca6834461f9..7a345f8b365a 100644
--- a/setup_native/source/ulfconv/ulfconv.cxx
+++ b/setup_native/source/ulfconv/ulfconv.cxx
@@ -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);
}
diff --git a/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx b/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx
index 1fe1d2335b88..70c0d9fef1e6 100755
--- a/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx
@@ -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;
diff --git a/setup_native/tests/opensolaris/bundledextensions/send_ooo b/setup_native/tests/opensolaris/bundledextensions/send_ooo
new file mode 100644
index 000000000000..669e63ceda1b
--- /dev/null
+++ b/setup_native/tests/opensolaris/bundledextensions/send_ooo
@@ -0,0 +1,32 @@
+#! /bin/bash
+
+
+if [ $# = 0 ]
+then
+echo "usage: send_ooo path_to_pkg_folder
+
+The files
+installed,
+ooo_bundled_extension.xml,
+svc-ooo_bundled_extension
+must be in the current directory. The pkg.depotd or the service
+application/pkg/server must listen to port 80"
+
+exit
+fi
+
+
+EXTENSIONPATH=/opt/openoffice.org3/share/extension/install
+
+eval `pkgsend -s http://localhost:80 open ooo_test@3.2-1`
+pkgsend -s http://localhost:80 import $1/openofficeorg-ure
+pkgsend -s http://localhost:80 import $1/ooobasis*
+pkgsend -s http://localhost:80 import $1/openofficeorg3*
+
+pkgsend -s http://localhost:80 add file installed mode=644 owner=root group=bin path=${EXTENSIONPATH}/installed restart_fmri=svc:/application/ooo_bundled_extensions:default
+pkgsend -s http://localhost:80 add file svc-ooo_bundled_extensions mode=744 owner=root group=bin path=/lib/svc/method/svc-ooo_bundled_extensions
+pkgsend -s http://localhost:80 add file ooo_bundled_extensions.xml mode=644 owner=root group=bin path=/var/svc/manifest/application/ooo_bundled_extensions.xml restart_fmri=svc:/system/manifest-import:default
+
+pkgsend -s http://localhost:80 add set name=description value="OOo 3.2 with dictionaries: en fr es da de"
+pkgsend -s http://localhost:80 close
+
diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx
index 7f04872f7a63..765649ba3bf7 100644
--- a/xmlsecurity/source/dialogs/certificateviewer.cxx
+++ b/xmlsecurity/source/dialogs/certificateviewer.cxx
@@ -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 ) );
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index cf07edb7023e..e8a484f38944 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -216,7 +216,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 ) ) );
diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx
index 9d469a53a479..f7fa2c08eca5 100644
--- a/xmlsecurity/source/dialogs/macrosecurity.cxx
+++ b/xmlsecurity/source/dialogs/macrosecurity.cxx
@@ -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 )));
}
diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
index 41dbd6232bce..e01fe5109190 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
@@ -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 {