diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2010-11-08 16:01:31 +0100 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2010-11-08 16:01:31 +0100 |
commit | c66f767b220ced6ffd3773dff021c9636a36c51d (patch) | |
tree | 9ff1141915a5794a17096ae5e5aaeefd6e70b690 | |
parent | c3a8753eb49072715f467c6478823e16d0d20a4c (diff) | |
parent | 108d04b9d404a8e83284d5e55d41ef185827bb55 (diff) |
CWS-TOOLING: integrate CWS dba34aooo/DEV300_m95ooo/DEV300_m94ooo/DEV300_m93
25 files changed, 234 insertions, 637 deletions
diff --git a/dbaccess/qa/complex/dbaccess/DataSource.java b/dbaccess/qa/complex/dbaccess/DataSource.java index ff920d03b..0a6395da6 100644 --- a/dbaccess/qa/complex/dbaccess/DataSource.java +++ b/dbaccess/qa/complex/dbaccess/DataSource.java @@ -26,6 +26,7 @@ ************************************************************************/ package complex.dbaccess; +import com.sun.star.container.XNameAccess; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.Exception; import com.sun.star.uno.UnoRuntime; @@ -110,6 +111,9 @@ public class DataSource extends TestCase dataSourceName = "someDataSource"; final XNamingService dataSourceRegistrations = (XNamingService) UnoRuntime.queryInterface( XNamingService.class, getMSF().createInstance("com.sun.star.sdb.DatabaseContext")); + final XNameAccess existenceCheck = UnoRuntime.queryInterface( XNameAccess.class, dataSourceRegistrations ); + if ( existenceCheck.hasByName( "someDataSource" ) ) + dataSourceRegistrations.revokeObject( "someDataSource" ); dataSourceRegistrations.registerObject("someDataSource", m_dataSource.getXDataSource()); assertEquals("registration name of a newly registered data source is wrong", dataSourceName, m_dataSource.getName()); } diff --git a/dbaccess/source/ext/macromigration/macromigration.src b/dbaccess/source/ext/macromigration/macromigration.src index b772d3841..f971bd133 100644 --- a/dbaccess/source/ext/macromigration/macromigration.src +++ b/dbaccess/source/ext/macromigration/macromigration.src @@ -453,7 +453,7 @@ String STR_INVALID_NUMBER_ARGS }; String STR_NO_DATABASE { - Text [ en-US ] = "No database document found in the initializatin arguments."; + Text [ en-US ] = "No database document found in the initialization arguments."; }; String STR_NOT_READONLY { diff --git a/dbaccess/source/ext/macromigration/migrationlog.cxx b/dbaccess/source/ext/macromigration/migrationlog.cxx index 1c49c5fa2..5ecfd37c0 100644 --- a/dbaccess/source/ext/macromigration/migrationlog.cxx +++ b/dbaccess/source/ext/macromigration/migrationlog.cxx @@ -372,7 +372,7 @@ namespace dbmm break; case ERR_NEW_STYLE_REPORT: - pAsciiErrorDescription = "#doc# could not be processed, since you don't have the Sun Report Builder (TM) extension installed."; + pAsciiErrorDescription = "#doc# could not be processed, since you don't have the Oracle Report Builder (TM) extension installed."; aAsciiParameterNames.push_back( "#doc#" ); break; diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 3d5aa8651..4129a7fff 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -891,7 +891,7 @@ DBTreeListBox* OAppDetailPageHelper::createTree( DBTreeListBox* _pTreeView, cons { WaitObject aWaitCursor(this); - _pTreeView->SetWindowBits(WB_HASLINES | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT | WB_TABSTOP); + _pTreeView->SetStyle(_pTreeView->GetStyle() | WB_HASLINES | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT | WB_TABSTOP); _pTreeView->GetModel()->SetSortMode(SortAscending); _pTreeView->EnableCheckButton( NULL ); // do not show any buttons _pTreeView->SetSelectionMode(MULTIPLE_SELECTION); diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index 1b13168ce..ac6ec16d2 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -193,7 +193,7 @@ void OCreationList::SelectSearchEntry( const void* _pEntry ) } // ----------------------------------------------------------------------------- -void OCreationList::ExecuteSearchEntry( const void* _pEntry ) +void OCreationList::ExecuteSearchEntry( const void* _pEntry ) const { SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pEntry ) ); DBG_ASSERT( pEntry, "OCreationList::ExecuteSearchEntry: invalid entry!" ); diff --git a/dbaccess/source/ui/app/AppDetailView.hxx b/dbaccess/source/ui/app/AppDetailView.hxx index 38d1dfc54..378918583 100644 --- a/dbaccess/source/ui/app/AppDetailView.hxx +++ b/dbaccess/source/ui/app/AppDetailView.hxx @@ -111,7 +111,7 @@ namespace dbaui // IMnemonicEntryList virtual void SelectSearchEntry( const void* _pEntry ); - virtual void ExecuteSearchEntry( const void* _pEntry ); + virtual void ExecuteSearchEntry( const void* _pEntry ) const; private: void onSelected( SvLBoxEntry* _pEntry ) const; diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index 88861a5ac..6a09d050c 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -140,6 +140,8 @@ void DBTreeListBox::init() SetNodeDefaultImages( ); EnableContextMenuHandling(); + + SetStyle( GetStyle() | WB_QUICK_SEARCH ); } //------------------------------------------------------------------------ DBTreeListBox::~DBTreeListBox() diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index f87cbe29a..5bd6ecaba 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -220,6 +220,8 @@ namespace dbaui m_aTestJavaDriver.SetClickHdl(LINK(this,OConnectionTabPage,OnTestJavaClickHdl)); FreeResource(); + + LayoutHelper::fitSizeRightAligned( m_aTestConnection ); } // ----------------------------------------------------------------------- diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index 2365a9779..d2cc9e57a 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -844,6 +844,8 @@ DBG_NAME(OAuthentificationPageSetup) m_aCBPasswordRequired.SetClickHdl(getControlModifiedLink()); m_aPBTestConnection.SetClickHdl(LINK(this,OGenericAdministrationPage,OnTestConnectionClickHdl)); FreeResource(); + + LayoutHelper::fitSizeRightAligned( m_aPBTestConnection ); } diff --git a/dbaccess/source/ui/dlg/ExtensionNotPresent.cxx b/dbaccess/source/ui/dlg/ExtensionNotPresent.cxx deleted file mode 100644 index 472263ba0..000000000 --- a/dbaccess/source/ui/dlg/ExtensionNotPresent.cxx +++ /dev/null @@ -1,218 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "precompiled_dbaccess.hxx" - -#include "dbaccess_helpid.hrc" -#include "dbu_resource.hrc" -#include "ExtensionNotPresent.hrc" -#include "ExtensionNotPresent.hxx" -#include "moduledbu.hxx" -#include "UITools.hxx" - -/** === begin UNO includes === **/ -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/lang/XMultiComponentFactory.hpp> -#include <com/sun/star/system/SystemShellExecuteFlags.hpp> -#include <com/sun/star/uno/XComponentContext.hpp> -/** === end UNO includes === **/ - -#include <connectivity/dbconversion.hxx> -#include <unotools/syslocale.hxx> -#include <svx/globlmn.hrc> -#include <svx/svxids.hrc> -#include <tools/debug.hxx> -#include <tools/diagnose_ex.h> -#include <unotools/confignode.hxx> -#include <vcl/msgbox.hxx> - - -namespace dbaui -{ -using namespace ::com::sun::star; -using namespace ::comphelper; - -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) - -DBG_NAME( dbu_OExtensionNotPresentDialog ) -//======================================================================== -// class OExtensionNotPresentDialog -//======================================================================== - OExtensionNotPresentDialog::OExtensionNotPresentDialog( Window* _pParent, uno::Reference< lang::XMultiServiceFactory > _xORB) - : ModalDialog( _pParent, ModuleRes(RID_EXTENSION_NOT_PRESENT_DLG) ) - ,m_aFI_WARNING(this, ModuleRes(FI_WARNING)) - ,m_aFT_TEXT(this, ModuleRes(FT_TEXT ) ) - ,m_aPB_DOWNLOAD(this, ModuleRes(PB_DOWNLOAD)) - ,m_aPB_CANCEL(this, ModuleRes(PB_CANCEL)) - ,m_xMultiServiceFactory(_xORB) -{ - DBG_CTOR( dbu_OExtensionNotPresentDialog, NULL); - - try - { - SvtSysLocale aSysLocale; - m_nLocale = aSysLocale.GetLocaleData().getLocale(); - } - catch(uno::Exception&) - { - } - - // set a ClickHandler for the 'Download' button - m_aPB_DOWNLOAD.SetClickHdl( LINK( this, OExtensionNotPresentDialog, Download_Click ) ); - - // get message string out of the resource - String sText = String( ModuleRes( RID_STR_EXTENSION_NOT_PRESENT ) ); - // String sExtensionName = String( ModuleRes( RID_STR_EXTENSION_NAME ) ); - String sExtensionName = getFromConfigurationExtension("Name"); - sText.SearchAndReplaceAscii("%RPT_EXTENSION_NAME", sExtensionName); - - m_aFT_TEXT.SetText(sText); - - // calulate the size of the text field - Rectangle aPrimaryRect( Point(0,0), m_aFT_TEXT.GetSizePixel() ); - Rectangle aSuggestedRect( GetTextRect( aPrimaryRect, sText, TEXT_DRAW_MULTILINE | TEXT_DRAW_LEFT ) ); - - Size aTempSize = LogicToPixel( Size(LEFT_PADDING + RIGHT_PADDING, 1), MAP_APPFONT); // real pixel size of LEFT and RIGHT_PADDING - sal_Int32 nWidthWithoutFixedText = aTempSize.getWidth() ; - sal_Int32 nHeightWithoutFixedText = GetSizePixel().getHeight() - m_aFT_TEXT.GetSizePixel().getHeight(); - - Size aNewSize = aSuggestedRect.GetSize(); - m_aFT_TEXT.SetSizePixel( aNewSize ); - sal_Int32 nNewWidth = nWidthWithoutFixedText + aSuggestedRect.GetWidth(); - sal_Int32 nNewHeight = nHeightWithoutFixedText + aSuggestedRect.GetHeight(); - - // set new window width & height - Size aDialogWindowSize = GetSizePixel(); - aDialogWindowSize.setWidth( nNewWidth ); - aDialogWindowSize.setHeight( nNewHeight ); - SetSizePixel(aDialogWindowSize); - - // move Action items - sal_Int32 nWindowWidth = GetSizePixel().getWidth(); - sal_Int32 nWindowHeight = GetSizePixel().getHeight(); - - Size aButtonSize = LogicToPixel( Size(BUTTON_WIDTH, BUTTON_HEIGHT), MAP_APPFONT); // real pixel size of a button - - Point aNewPos = m_aPB_DOWNLOAD.GetPosPixel(); - aNewPos.setX(nWindowWidth / 2 - m_aPB_DOWNLOAD.GetSizePixel().getWidth() - 8); - aNewPos.setY(nWindowHeight - aButtonSize.getHeight() - 5); - m_aPB_DOWNLOAD.SetPosPixel(aNewPos ); - - aNewPos = m_aPB_CANCEL.GetPosPixel(); - aNewPos.setX(nWindowWidth / 2 + 8); - aNewPos.setY(nWindowHeight - aButtonSize.getHeight() - 5); - m_aPB_CANCEL.SetPosPixel(aNewPos ); - - m_aFI_WARNING.SetImage(WarningBox::GetStandardImage()); - - // set an image in high contrast - // m_aFI_WARNING.SetModeImage(Image(BMP_EXCEPTION_WARNING_SCH), BMP_COLOR_HIGHCONTRAST); - - // to resize images - // WinBits aBits = m_aFI_WARNING.GetStyle(); - // aBits |= WB_SCALE; - // m_aFI_WARNING.SetStyle(aBits); - // - // Size aImageSize = m_aFI_WARNING.GetSizePixel(); - // (void) aImageSize; - // m_aFI_WARNING.Resize(); - - - Resize(); - FreeResource(); -} - -//------------------------------------------------------------------------ -OExtensionNotPresentDialog::~OExtensionNotPresentDialog() -{ - DBG_DTOR( dbu_OExtensionNotPresentDialog, NULL); -} -// ----------------------------------------------------------------------------- -short OExtensionNotPresentDialog::Execute() -{ - DBG_CHKTHIS( dbu_OExtensionNotPresentDialog,NULL); - short nRet = ModalDialog::Execute(); - // RET_OK - // RET_NO - return nRet; -} - -//------------------------------------------------------------------------------ - -uno::Reference< com::sun::star::system::XSystemShellExecute > OExtensionNotPresentDialog::getShellExecuter() const -{ - uno::Reference<com::sun::star::system::XSystemShellExecute> xExecuter( m_xMultiServiceFactory->createInstance( UNISTRING( "com.sun.star.system.SystemShellExecute" )), uno::UNO_QUERY_THROW); - return xExecuter; -} -// ----------------------------------------------------------------------------- -rtl::OUString OExtensionNotPresentDialog::getFromConfigurationExtension(rtl::OUString const& _sPropertyName) const -{ - // get the URL to open in a browser from Configuration - static const ::rtl::OUString sConfigName( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.ReportDesign/Extension" ) ); - - ::utl::OConfigurationTreeRoot aConfiguration( ::utl::OConfigurationTreeRoot::createWithServiceFactory( m_xMultiServiceFactory, sConfigName ) ); - - rtl::OUString aValue; - aConfiguration.getNodeValue( _sPropertyName ) >>= aValue; - return aValue; -} - -// ----------------------------------------------------------------------------- -rtl::OUString OExtensionNotPresentDialog::getFromConfigurationExtension(rtl::OString const& _sPropertyName) const -{ - return getFromConfigurationExtension(rtl::OStringToOUString( _sPropertyName, RTL_TEXTENCODING_UTF8) ); -} - -// ----------------------------------------------------------------------------- -// handle the click on the download button -IMPL_LINK( OExtensionNotPresentDialog, Download_Click, PushButton*, EMPTYARG ) -{ - try - { - EndDialog( TRUE ); - - rtl::OUString suDownloadURL = getFromConfigurationExtension("DownloadURL"); - if (suDownloadURL.getLength() == 0) - { - // fallback - suDownloadURL = UNISTRING("http://extensions.services.openoffice.org"); - } - - // open such URL in a browser - uno::Reference< com::sun::star::system::XSystemShellExecute > xShellExecute( getShellExecuter() ); - xShellExecute->execute( suDownloadURL, ::rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS ); - } - catch( const uno::Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - return 0; -} - -// ============================================================================= -} // rptui -// ============================================================================= - diff --git a/dbaccess/source/ui/dlg/ExtensionNotPresent.hrc b/dbaccess/source/ui/dlg/ExtensionNotPresent.hrc deleted file mode 100644 index cb314b9f7..000000000 --- a/dbaccess/source/ui/dlg/ExtensionNotPresent.hrc +++ /dev/null @@ -1,48 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef DBU_EXTENSIONNOTPRESENT_HRC -#define DBU_EXTENSIONNOTPRESENT_HRC - -#define FT_TEXT (1) -#define FI_WARNING (2) -#define PB_DOWNLOAD (10) -#define PB_CANCEL (11) - -#define FIXEDTEXT_HEIGHT 8 -#define CELL_PADDING 8 -#define BUTTON_HEIGHT 14 -#define BUTTON_WIDTH 55 -#define BROWSER_HEIGHT 75 -// #define PAGE_WIDTH ( CELL_PADDING + BUTTON_WIDTH + CELL_PADDING + BUTTON_WIDTH + CELL_PADDING) -#define LEFT_PADDING 32 /* size for the icon */ -#define RIGHT_PADDING 16 -#define DLG_WIDTH ( 250 ) -#define ACTION_LINE_START (CELL_PADDING + ( 3 * FIXEDTEXT_HEIGHT ) + 2 * CELL_PADDING + 1 ) -#define DLG_HEIGHT (ACTION_LINE_START + BUTTON_HEIGHT + CELL_PADDING) - - -#endif /* DBU_EXTENSIONNOTPRESENT_HRC */ diff --git a/dbaccess/source/ui/dlg/ExtensionNotPresent.src b/dbaccess/source/ui/dlg/ExtensionNotPresent.src deleted file mode 100644 index 206c280eb..000000000 --- a/dbaccess/source/ui/dlg/ExtensionNotPresent.src +++ /dev/null @@ -1,90 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "ExtensionNotPresent.hrc" -#include "dbaccess_helpid.hrc" -#include "dbu_resource.hrc" -#include <svx/globlmn.hrc> -#include <svx/svxids.hrc> - - -String RID_STR_EXTENSION_NOT_PRESENT -{ - // #i96130# use hard coded name - Text [ en-US ] = "To open a report you require the extension Sun™ Report Builder.\n\nClick 'Download...' to download and install the extension."; - // OLD: Text [ en-US ] = "To open a report you require the extension %RPT_EXTENSION_NAME.\n\nClick 'Download...' to download and install the extension."; -}; -// To open a report you require the extension Sun Report Designer weiss der Geier Hauptsache extra langer Name -// String RID_STR_EXTENSION_NAME -// { -// Text = "Sun(TM) Report Builder"; -// }; - -ModalDialog RID_EXTENSION_NOT_PRESENT_DLG -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( DLG_WIDTH , DLG_HEIGHT ) ; - Text [ en-US ] = "%PRODUCTNAME %PRODUCTVERSION" ; - HelpId = HID_EXTENSION_NOT_PRESENT_DLG; - Moveable = TRUE ; - Closeable = TRUE ; - - // most of the calulated values here are overridden by the ExtensionNotPresent ctor itself. - FixedImage FI_WARNING - { - Pos = MAP_APPFONT (CELL_PADDING / 2, CELL_PADDING) ; - Size = (32, 32); - Fixed=BMP_EXCEPTION_WARNING; - }; - - - FixedText FT_TEXT - { - Pos = MAP_APPFONT ( 32 , CELL_PADDING ) ; - Size = MAP_APPFONT ( DLG_WIDTH - LEFT_PADDING - RIGHT_PADDING , 3 * (FIXEDTEXT_HEIGHT + 2) ) ; - // Border = TRUE ; - // Text will set outside from RID_STR_EXTENSION_NOT_PRESENT - }; - - PushButton PB_DOWNLOAD - { - HelpID = "dbaccess:PushButton:RID_EXTENSION_NOT_PRESENT_DLG:PB_DOWNLOAD"; - Pos = MAP_APPFONT ( DLG_WIDTH / 2 - (CELL_PADDING/2) - BUTTON_WIDTH, ACTION_LINE_START ) ; - Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; - DefButton = TRUE ; - TabStop = TRUE ; - Text [ en-US ] = "~Download..." ; - }; - - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT ( DLG_WIDTH / 2 + (CELL_PADDING/2), ACTION_LINE_START) ; - Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; - TabStop = TRUE ; - }; -}; - diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx index de8488116..eff9ed219 100644 --- a/dbaccess/source/ui/dlg/adminpages.cxx +++ b/dbaccess/source/ui/dlg/adminpages.cxx @@ -313,7 +313,6 @@ namespace dbaui SetControlFontWeight(m_pFT_HeaderText); } - //========================================================================= //= LayoutHelper //========================================================================= @@ -331,6 +330,24 @@ namespace dbaui _rControl.SetPosPixel( aControlPos ); } + //------------------------------------------------------------------------- + void LayoutHelper::fitSizeRightAligned( PushButton& io_button ) + { + const Point aOldPos = io_button.GetPosPixel(); + const Size aOldSize = io_button.GetSizePixel(); + const Size aMinSize( io_button.CalcMinimumSize() ); + if ( aMinSize.Width() > aOldSize.Width() ) + { + io_button.SetPosSizePixel( + aOldPos.X() + aOldSize.Width() - aMinSize.Width(), + 0, + aMinSize.Width(), + 0, + WINDOW_POSSIZE_X | WINDOW_POSSIZE_WIDTH + ); + } + } + //......................................................................... } // namespace dbaui //......................................................................... diff --git a/dbaccess/source/ui/dlg/adminpages.hxx b/dbaccess/source/ui/dlg/adminpages.hxx index 4b38685ac..d10990acf 100644 --- a/dbaccess/source/ui/dlg/adminpages.hxx +++ b/dbaccess/source/ui/dlg/adminpages.hxx @@ -288,6 +288,10 @@ namespace dbaui const ControlRelation _eRelation, const long _nIndentAppFont ); + /** fits the button size to be large enough to contain the buttons text + */ + static void fitSizeRightAligned( PushButton& io_button ); + // why is CalcMinimumSize not a virtual method of ::Window? }; //......................................................................... diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx index 46599fc26..79ba2b86d 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.cxx +++ b/dbaccess/source/ui/dlg/adtabdlg.cxx @@ -377,7 +377,7 @@ OAddTableDlg::OAddTableDlg( Window* pParent, IAddTableDialogContext& _rContext ) ////////////////////////////////////////////////////////////////////// m_aTableList.EnableInplaceEditing( FALSE ); - m_aTableList.SetWindowBits(WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HASLINESATROOT | WB_SORT | WB_HSCROLL ); + m_aTableList.SetStyle(m_aTableList.GetStyle() | WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HASLINESATROOT | WB_SORT | WB_HSCROLL ); m_aTableList.EnableCheckButton( NULL ); // do not show any buttons m_aTableList.SetSelectionMode( SINGLE_SELECTION ); m_aTableList.notifyHiContrastChanged(); diff --git a/dbaccess/source/ui/dlg/dbadmin2.src b/dbaccess/source/ui/dlg/dbadmin2.src index a4c57e0fb..9cc6ba2f3 100644 --- a/dbaccess/source/ui/dlg/dbadmin2.src +++ b/dbaccess/source/ui/dlg/dbadmin2.src @@ -52,11 +52,6 @@ String STR_ENTER_CONNECTION_PASSWORD Text [ en-US ] = "A password is needed to connect to the data source \"$name$\"."; }; -String STR_QUERY_DROP_ALL -{ - Text[ en-US ] = "Do you want to delete all selected items?"; -}; - String STR_ASK_FOR_DIRECTORY_CREATION { Text [ en-US ] = "The directory\n\n$path$\n\ndoes not exist. Should it be created?"; @@ -67,41 +62,6 @@ String STR_COULD_NOT_CREATE_DIRECTORY Text [ en-US ] = "The directory $name$ could not be created."; }; -String STR_ADDRESSBOOK_SYSTEM -{ - Text[ en-US ] = "Windows address book"; -}; -String STR_ADDRESSBOOK_OUTLOOK -{ - Text[ en-US ] = "MS Outlook"; -}; -String STR_ADDRESSBOOK_MOZILLA -{ - Text[ en-US ] = "Mozilla address book"; -}; -String STR_ADDRESSBOOK_THUNDERBIRD -{ - Text[ en-US ] = "Thunderbird address book"; -}; -String STR_ADDRESSBOOK_EVOLUTION -{ - Text[ en-US ] = "Evolution address book"; -}; -String STR_ADDRESSBOOK_LDAP -{ - Text[ en-US ] = "LDAP address book"; -}; - -String STR_HINT_READONLY_CONNECTION -{ - Text [ en-US ] = "(Connection is read-only)"; -}; - -String STR_HINT_CONNECTION_NOT_CAPABLE -{ - Text [ en-US ] = "(Not supported by this connection)"; -}; - #define EDIT_SIZE_X 50 #define FT_SIZE_X 90 #define WIN_X 220 diff --git a/dbaccess/source/ui/dlg/makefile.mk b/dbaccess/source/ui/dlg/makefile.mk index 270741d00..ca0d3ab8c 100644 --- a/dbaccess/source/ui/dlg/makefile.mk +++ b/dbaccess/source/ui/dlg/makefile.mk @@ -137,8 +137,6 @@ SLOFILES+= $(SLO)$/adodatalinks.obj .ENDIF # --- Targets ---------------------------------- -#LOCALIZE_ME=AutoControls_tmpl.hrc - .INCLUDE : target.mk $(SLO)$/ConnectionHelper.obj : $(LOCALIZE_ME_DEST) diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index 79cad78af..34b1d6f32 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -401,7 +401,7 @@ OExceptionChainDialog::OExceptionChainDialog( Window* pParent, const ExceptionDi m_aExceptionList.SetSelectionMode(SINGLE_SELECTION); m_aExceptionList.SetDragDropMode(0); m_aExceptionList.EnableInplaceEditing(sal_False); - m_aExceptionList.SetWindowBits(WB_HASLINES | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL); + m_aExceptionList.SetStyle(m_aExceptionList.GetStyle() | WB_HASLINES | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL); m_aExceptionList.SetSelectHdl(LINK(this, OExceptionChainDialog, OnExceptionSelected)); m_aExceptionList.SetNodeDefaultImages( ); diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx index 4567b46a9..aa31cf532 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -162,7 +162,7 @@ DBG_NAME(OTableSubscriptionPage) m_aTablesList.SetSelectionMode( MULTIPLE_SELECTION ); m_aTablesList.SetDragDropMode( 0 ); m_aTablesList.EnableInplaceEditing( sal_False ); - m_aTablesList.SetWindowBits(WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT); + m_aTablesList.SetStyle(m_aTablesList.GetStyle() | WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT); m_aTablesList.Clear(); diff --git a/dbaccess/source/ui/inc/ExtensionNotPresent.hxx b/dbaccess/source/ui/inc/ExtensionNotPresent.hxx deleted file mode 100644 index f332941db..000000000 --- a/dbaccess/source/ui/inc/ExtensionNotPresent.hxx +++ /dev/null @@ -1,101 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef DBU_EXTENSIONNOTPRESENT_HXX -#define DBU_EXTENSIONNOTPRESENT_HXX - -#ifndef _DIALOG_HXX //autogen -#include <vcl/dialog.hxx> -#endif -#ifndef _FIXED_HXX //autogen -#include <vcl/fixed.hxx> -#endif -#ifndef _SV_LSTBOX_HXX -#include <vcl/lstbox.hxx> -#endif -#ifndef _SV_FIELD_HXX -#include <vcl/field.hxx> -#endif -#ifndef _SV_BUTTON_HXX -#include <vcl/button.hxx> -#endif -#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_ -#include <com/sun/star/report/XReportDefinition.hpp> -#endif -#ifndef _COM_SUN_STAR_LANG_LOCALE_HPP_ -#include <com/sun/star/lang/Locale.hpp> -#endif - -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/system/XSystemShellExecute.hpp> - -namespace dbaui -{ - -/************************************************************************* -|* -|* Groups and Sorting dialog -|* -\************************************************************************/ -class OExtensionNotPresentDialog : public ModalDialog -{ - FixedImage m_aFI_WARNING; - FixedText m_aFT_TEXT; - - PushButton m_aPB_DOWNLOAD; - CancelButton m_aPB_CANCEL; - - ::com::sun::star::lang::Locale m_nLocale; - com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xMultiServiceFactory; - - /** returns the format string. - */ - // ::rtl::OUString getFormatString(::sal_Int16 _nNumberFormatIndex); - - DECL_LINK(Download_Click,PushButton*); - - // not CopyCTOR, no self assignment - OExtensionNotPresentDialog(const OExtensionNotPresentDialog&); - void operator =(const OExtensionNotPresentDialog&); - - // get some values out of the configuration - rtl::OUString getFromConfigurationExtension(rtl::OUString const& _sPropertyName) const; - rtl::OUString getFromConfigurationExtension(rtl::OString const& _sPropertyName) const; // syntactic sugar - - ::com::sun::star::uno::Reference< ::com::sun::star::system::XSystemShellExecute > getShellExecuter() const; - -public: - OExtensionNotPresentDialog( Window* pParent, com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > ); - virtual ~OExtensionNotPresentDialog(); - virtual short Execute(); - - inline String getText() const { return m_aFT_TEXT.GetText(); } -}; -// ============================================================================= -} // namespace rptui -// ============================================================================= -#endif // DBU_EXTENSIONNOTPRESENT_HXX - diff --git a/dbaccess/source/ui/inc/dbu_dlg.hrc b/dbaccess/source/ui/inc/dbu_dlg.hrc index f403caafd..1335a6c10 100644 --- a/dbaccess/source/ui/inc/dbu_dlg.hrc +++ b/dbaccess/source/ui/inc/dbu_dlg.hrc @@ -64,24 +64,24 @@ #define STR_ADABAS_ERROR_SYSTEMTABLES RID_STR_DLG_START + 6 #define STR_ERROR_PASSWORDS_NOT_IDENTICAL RID_STR_DLG_START + 7 #define STR_INDEXDESIGN_DOUBLE_COLUMN_NAME RID_STR_DLG_START + 8 -#define STR_DATASOURCE_DEFAULTNAME RID_STR_DLG_START + 9 -#define STR_ERR_EMPTY_DSN_NAME RID_STR_DLG_START + 10 + // FREE + // FREE #define STR_ERR_USE_CONNECT_TO RID_STR_DLG_START + 11 #define STR_ALREADYEXISTOVERWRITE RID_STR_DLG_START + 12 -#define STR_QUERY_DROP_ALL RID_STR_DLG_START + 13 + // FREE #define STR_INDEX_NAME_ALREADY_USED RID_STR_DLG_START + 14 #define STR_ASK_FOR_DIRECTORY_CREATION RID_STR_DLG_START + 15 #define STR_COULD_NOT_CREATE_DIRECTORY RID_STR_DLG_START + 16 -#define STR_ADDRESSBOOK_SYSTEM RID_STR_DLG_START + 17 -#define STR_ADDRESSBOOK_MOZILLA RID_STR_DLG_START + 18 -#define STR_ADDRESSBOOK_EVOLUTION RID_STR_DLG_START + 19 // FREE -#define STR_ADDRESSBOOK_LDAP RID_STR_DLG_START + 21 -#define STR_ADDRESSBOOK_OUTLOOK RID_STR_DLG_START + 22 + // FREE + // FREE + // FREE + // FREE + // FREE #define STR_COMMAND_EXECUTED_SUCCESSFULLY RID_STR_DLG_START + 23 #define STR_DIRECTSQL_CONNECTIONLOST RID_STR_DLG_START + 24 -#define STR_HINT_READONLY_CONNECTION RID_STR_DLG_START + 25 -#define STR_HINT_CONNECTION_NOT_CAPABLE RID_STR_DLG_START + 26 + // FREE + // FREE #define STR_USERADMIN_NOT_AVAILABLE RID_STR_DLG_START + 27 #define STR_TAB_INDEX_SORTORDER RID_STR_DLG_START + 28 #define STR_TAB_INDEX_FIELD RID_STR_DLG_START + 29 @@ -110,7 +110,7 @@ #define STR_NO_ADABASE_DATASOURCES RID_STR_DLG_START + 55 #define STR_NO_ADDITIONAL_SETTINGS RID_STR_DLG_START + 56 #define STR_HOSTNAME RID_STR_DLG_START + 57 -#define STR_ADDRESSBOOK_THUNDERBIRD RID_STR_DLG_START + 58 + // FREE #define STR_MOZILLA_PROFILE_NAME RID_STR_DLG_START + 59 #define STR_THUNDERBIRD_PROFILE_NAME RID_STR_DLG_START + 60 #define STR_EXPLAN_STRINGCONVERSION_ERROR RID_STR_DLG_START + 61 diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index e4ccc2b58..0d070c500 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -92,8 +92,8 @@ OWizNameMatching::OWizNameMatching( Window* pParent) m_CTRL_RIGHT.SetSelectHdl(LINK(this,OWizNameMatching,TableListRightSelectHdl)); m_CTRL_RIGHT.EnableCheckButton( NULL ); - m_CTRL_LEFT.SetWindowBits( WB_FORCE_MAKEVISIBLE ); - m_CTRL_RIGHT.SetWindowBits( WB_FORCE_MAKEVISIBLE ); + m_CTRL_LEFT.SetStyle( m_CTRL_LEFT.GetStyle() | WB_FORCE_MAKEVISIBLE ); + m_CTRL_RIGHT.SetStyle( m_CTRL_RIGHT.GetStyle() | WB_FORCE_MAKEVISIBLE ); m_sSourceText = m_FT_TABLE_LEFT.GetText(); m_sSourceText.AppendAscii("\n"); @@ -405,7 +405,7 @@ OColumnTreeBox::OColumnTreeBox( Window* pParent, const ResId& rResId ) { SetDragDropMode( 0 ); EnableInplaceEditing( sal_False ); - SetWindowBits(WB_BORDER | WB_HASBUTTONS | WB_HSCROLL); + SetStyle(GetStyle() | WB_BORDER | WB_HASBUTTONS | WB_HSCROLL); SetSelectionMode( SINGLE_SELECTION ); } //------------------------------------------------------------------------ diff --git a/dbaccess/source/ui/misc/dbumiscres.src b/dbaccess/source/ui/misc/dbumiscres.src index 8deda3fde..4d191adef 100644 --- a/dbaccess/source/ui/misc/dbumiscres.src +++ b/dbaccess/source/ui/misc/dbumiscres.src @@ -96,5 +96,5 @@ String STR_NAMED_OBJECT_ALREADY_EXISTS String RID_STR_EXTENSION_NOT_PRESENT { // #i96130# use hard coded name - Text [ en-US ] = "The report, \"$file$\", requires the extension Sun Report Builder."; + Text [ en-US ] = "The report, \"$file$\", requires the extension Oracle Report Builder."; }; diff --git a/reportdesign/source/core/sdr/UndoEnv.cxx b/reportdesign/source/core/sdr/UndoEnv.cxx index 4ffc5096c..a1f51cd5d 100644 --- a/reportdesign/source/core/sdr/UndoEnv.cxx +++ b/reportdesign/source/core/sdr/UndoEnv.cxx @@ -44,12 +44,15 @@ #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/util/XModifyBroadcaster.hpp> +#include <com/sun/star/beans/XIntrospectionAccess.hpp> +#include <com/sun/star/beans/XIntrospection.hpp> /** === end UNO includes === **/ #include <connectivity/dbtools.hxx> #include <svl/smplhint.hxx> #include <tools/diagnose_ex.h> #include <comphelper/stl_types.hxx> +#include <comphelper/componentcontext.hxx> #include <vcl/svapp.hxx> #include <dbaccess/singledoccontroller.hxx> #include <svx/unoshape.hxx> @@ -69,8 +72,36 @@ namespace rptui //---------------------------------------------------------------------------- -DECLARE_STL_USTRINGACCESS_MAP(bool, AllProperties); -DECLARE_STL_STDKEY_MAP(uno::Reference< beans::XPropertySet >, AllProperties, PropertySetInfoCache); +struct PropertyInfo +{ + bool bIsReadonlyOrTransient; + + PropertyInfo() + :bIsReadonlyOrTransient( false ) + { + } + + PropertyInfo( const bool i_bIsTransientOrReadOnly ) + :bIsReadonlyOrTransient( i_bIsTransientOrReadOnly ) + { + } +}; + +typedef ::std::hash_map< ::rtl::OUString, PropertyInfo, ::rtl::OUStringHash > PropertiesInfo; + +struct ObjectInfo +{ + PropertiesInfo aProperties; + Reference< XPropertySet > xPropertyIntrospection; + + ObjectInfo() + :aProperties() + ,xPropertyIntrospection() + { + } +}; + +typedef ::std::map< Reference< XPropertySet >, ObjectInfo, ::comphelper::OInterfaceCompare< XPropertySet > > PropertySetInfoCache; // ----------------------------------------------------------------------------- @@ -85,6 +116,7 @@ public: ConditionUpdater m_aConditionUpdater; ::osl::Mutex m_aMutex; ::std::vector< uno::Reference< container::XChild> > m_aSections; + Reference< XIntrospection > m_xIntrospection; oslInterlockedCount m_nLocks; sal_Bool m_bReadOnly; sal_Bool m_bIsUndo; @@ -154,7 +186,7 @@ void OXUndoEnvironment::Clear(const Accessor& /*_r*/) { uno::Reference<beans::XPropertySet> xProp(aIter->first,uno::UNO_QUERY); xProp->getPropertySetInfo(); - int nlen = aIter->second.size(); + int nlen = aIter->second.aProperties.size(); nlen = nlen; } #endif @@ -240,29 +272,73 @@ void SAL_CALL OXUndoEnvironment::propertyChange( const PropertyChangeEvent& _rEv int nlen = m_pImpl->m_aPropertySetCache.size(); nlen = nlen; #endif - PropertySetInfoCache::iterator aSetPos = m_pImpl->m_aPropertySetCache.find(xSet); - if (aSetPos == m_pImpl->m_aPropertySetCache.end()) + PropertySetInfoCache::iterator objectPos = m_pImpl->m_aPropertySetCache.find(xSet); + if (objectPos == m_pImpl->m_aPropertySetCache.end()) { - AllProperties aNewEntry; - aSetPos = m_pImpl->m_aPropertySetCache.insert(PropertySetInfoCache::value_type(xSet,aNewEntry)).first; - DBG_ASSERT(aSetPos != m_pImpl->m_aPropertySetCache.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?"); + objectPos = m_pImpl->m_aPropertySetCache.insert( PropertySetInfoCache::value_type( + xSet, ObjectInfo() + ) ).first; + DBG_ASSERT(objectPos != m_pImpl->m_aPropertySetCache.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?"); } - if ( aSetPos == m_pImpl->m_aPropertySetCache.end() ) + if ( objectPos == m_pImpl->m_aPropertySetCache.end() ) return; // now we have access to the cached info about the set // let's see what we know about the property - AllProperties& rPropInfos = aSetPos->second; - AllPropertiesIterator aPropertyPos = rPropInfos.find( _rEvent.PropertyName ); - if (aPropertyPos == rPropInfos.end()) + ObjectInfo& rObjectInfo = objectPos->second; + PropertiesInfo::iterator aPropertyPos = rObjectInfo.aProperties.find( _rEvent.PropertyName ); + if ( aPropertyPos == rObjectInfo.aProperties.end() ) { // nothing 'til now ... have to change this .... // the attributes - INT32 nAttributes = xSet->getPropertySetInfo()->getPropertyByName( _rEvent.PropertyName ).Attributes; - bool bTransReadOnly = ((nAttributes & PropertyAttribute::READONLY) != 0) || ((nAttributes & PropertyAttribute::TRANSIENT) != 0); + Reference< XPropertySetInfo > xPSI( xSet->getPropertySetInfo(), UNO_SET_THROW ); + INT32 nPropertyAttributes = 0; + try + { + if ( xPSI->hasPropertyByName( _rEvent.PropertyName ) ) + { + nPropertyAttributes = xPSI->getPropertyByName( _rEvent.PropertyName ).Attributes; + } + else + { + // it's perfectly valid for a component to notify a change in a property which it doesn't have - as long + // as it has an attribute with this name + if ( !rObjectInfo.xPropertyIntrospection.is() ) + { + if ( !m_pImpl->m_xIntrospection.is() ) + { + ::comphelper::ComponentContext aContext( m_pImpl->m_rModel.getController()->getORB() ); + OSL_VERIFY( aContext.createComponent( "com.sun.star.beans.Introspection", m_pImpl->m_xIntrospection ) ); + } + if ( m_pImpl->m_xIntrospection.is() ) + { + Reference< XIntrospectionAccess > xIntrospection( + m_pImpl->m_xIntrospection->inspect( makeAny( _rEvent.Source ) ), + UNO_SET_THROW + ); + rObjectInfo.xPropertyIntrospection.set( xIntrospection->queryAdapter( XPropertySet::static_type() ), UNO_QUERY_THROW ); + } + } + if ( rObjectInfo.xPropertyIntrospection.is() ) + { + xPSI.set( rObjectInfo.xPropertyIntrospection->getPropertySetInfo(), UNO_SET_THROW ); + nPropertyAttributes = xPSI->getPropertyByName( _rEvent.PropertyName ).Attributes; + } + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + const bool bTransReadOnly = + ( ( nPropertyAttributes & PropertyAttribute::READONLY ) != 0 ) + || ( ( nPropertyAttributes & PropertyAttribute::TRANSIENT ) != 0 ); // insert the new entry - aPropertyPos = rPropInfos.insert( AllProperties::value_type( _rEvent.PropertyName, bTransReadOnly ) ).first; - DBG_ASSERT(aPropertyPos != rPropInfos.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?"); + aPropertyPos = rObjectInfo.aProperties.insert( PropertiesInfo::value_type( + _rEvent.PropertyName, + PropertyInfo( bTransReadOnly ) + ) ).first; + DBG_ASSERT(aPropertyPos != rObjectInfo.aProperties.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?"); } implSetModified(); @@ -271,7 +347,7 @@ void SAL_CALL OXUndoEnvironment::propertyChange( const PropertyChangeEvent& _rEv // and are able to decide wether or not we need an undo action // no UNDO for transient/readonly properties - if ( aPropertyPos->second ) + if ( aPropertyPos->second.bIsReadonlyOrTransient ) return; // give components with sub responsibilities a chance diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 051c5b39b..df10b6806 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -984,37 +984,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); ::osl::MutexGuard aGuard( getMutex() ); - if ( !getView() ) - { - switch(_nId) - { - case SID_RULER: - OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!"); - aArgs[0].Value >>= m_bShowRuler; - break; - case SID_HELPLINES_MOVE: - OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!"); - aArgs[0].Value >>= m_bHelplinesMove; - break; - case SID_GRID_VISIBLE: - OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!"); - aArgs[0].Value >>= m_bGridVisible; - break; - case SID_SHOW_PROPERTYBROWSER: - OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!"); - aArgs[0].Value >>= m_bShowProperties; - break; - case SID_PROPERTYBROWSER_LAST_PAGE: - OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!"); - aArgs[0].Value >>= m_sLastActivePage; - break; - case SID_SPLIT_POSITION: - OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!"); - aArgs[0].Value >>= m_nSplitPos; - break; - } - return; // return without execution - } + sal_Bool bForceBroadcast = sal_False; switch(_nId) { @@ -1686,6 +1656,7 @@ short OReportController::saveModified() { return RET_NO; } + // ----------------------------------------------------------------------------- void OReportController::impl_initialize( ) { @@ -1783,7 +1754,7 @@ void OReportController::impl_initialize( ) } catch(const SQLException&) { - OSL_ENSURE(sal_False, "OReportController::initialize: caught an exception!"); + DBG_UNHANDLED_EXCEPTION(); } } // ----------------------------------------------------------------------------- @@ -2745,35 +2716,38 @@ void OReportController::shrinkSection(USHORT _nUndoStrId, uno::Reference<report: uno::Any SAL_CALL OReportController::getViewData(void) throw( uno::RuntimeException ) { ::osl::MutexGuard aGuard( getMutex() ); - typedef ::std::pair< ::rtl::OUString,sal_uInt16> TStringIntPair; - const TStringIntPair pViewDataList[] = + + sal_Int32 nCommandIDs[] = { - TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GridVisible")), SID_GRID_VISIBLE) - ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GridUse")), SID_GRID_USE) - ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HelplinesMove")), SID_HELPLINES_MOVE) - ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowRuler")), SID_RULER) - ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlProperties")), SID_SHOW_PROPERTYBROWSER) - ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LastPropertyBrowserPage")),SID_PROPERTYBROWSER_LAST_PAGE) - ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SplitPosition")), SID_SPLIT_POSITION) + SID_GRID_VISIBLE, + SID_GRID_USE, + SID_HELPLINES_MOVE, + SID_RULER, + SID_SHOW_PROPERTYBROWSER, + SID_PROPERTYBROWSER_LAST_PAGE, + SID_SPLIT_POSITION }; - uno::Sequence<beans::PropertyValue> aCommandProps(sizeof(pViewDataList)/sizeof(pViewDataList[0])); - beans::PropertyValue* pIter = aCommandProps.getArray(); - beans::PropertyValue* pEnd = pIter + aCommandProps.getLength(); - for (sal_Int32 i = 0; pIter != pEnd; ++pIter,++i) + ::comphelper::NamedValueCollection aCommandProperties; + for ( size_t i=0; i < sizeof( nCommandIDs ) / sizeof( nCommandIDs[0] ); ++i ) { - FeatureState aFeatureState = GetState(pViewDataList[i].second); - pIter->Name = pViewDataList[i].first; + const FeatureState aFeatureState = GetState( nCommandIDs[i] ); + + ::rtl::OUString sCommandURL( getURLForId( nCommandIDs[i] ).Main ); + OSL_ENSURE( sCommandURL.indexOfAsciiL( ".uno:", 5 ) == 0, "OReportController::getViewData: illegal command URL!" ); + sCommandURL = sCommandURL.copy( 5 ); + + Any aCommandState; if ( !!aFeatureState.bChecked ) - pIter->Value <<= (*aFeatureState.bChecked) ? sal_True : sal_False; + aCommandState <<= (*aFeatureState.bChecked) ? sal_True : sal_False; else if ( aFeatureState.aValue.hasValue() ) - pIter->Value = aFeatureState.aValue; + aCommandState = aFeatureState.aValue; - } // for (; pIter != pEnd; ++pIter) + aCommandProperties.put( sCommandURL, aCommandState ); + } - uno::Sequence<beans::PropertyValue> aProps(1); - aProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CommandProperties")); - aProps[0].Value <<= aCommandProps; + ::comphelper::NamedValueCollection aViewData; + aViewData.put( "CommandProperties", aCommandProperties.getPropertyValues() ); if ( getDesignView() ) { @@ -2790,68 +2764,83 @@ uno::Any SAL_CALL OReportController::getViewData(void) throw( uno::RuntimeExcept pCollapsedIter->Name = PROPERTY_SECTION + ::rtl::OUString::valueOf(i); pCollapsedIter->Value <<= static_cast<sal_Int32>(*aIter); } - const sal_Int32 nCount = aProps.getLength(); - aProps.realloc( nCount + 1 ); - aProps[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CollapsedSections")); - aProps[nCount].Value <<= aCollapsedSections; + + aViewData.put( "CollapsedSections", aCollapsedSections ); } ::boost::shared_ptr<OSectionWindow> pSectionWindow = getDesignView()->getMarkedSection(); if ( pSectionWindow.get() ) { - const sal_Int32 nCount = aProps.getLength(); - aProps.realloc( nCount + 1 ); - aProps[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MarkedSection")); - aProps[nCount].Value <<= (sal_Int32)pSectionWindow->getReportSection().getPage()->GetPageNum(); + aViewData.put( "MarkedSection", (sal_Int32)pSectionWindow->getReportSection().getPage()->GetPageNum() ); } // if ( pSectionWindow.get() ) } // if ( getDesignView() ) - const sal_Int32 nCount = aProps.getLength(); - aProps.realloc( nCount + 1 ); - aProps[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZoomFactor")); - aProps[nCount].Value <<= m_nZoomValue; - return uno::makeAny(aProps); + + aViewData.put( "ZoomFactor", m_nZoomValue ); + return uno::makeAny( aViewData.getPropertyValues() ); } // ----------------------------------------------------------------------------- -void SAL_CALL OReportController::restoreViewData(const uno::Any& Data) throw( uno::RuntimeException ) +void SAL_CALL OReportController::restoreViewData(const uno::Any& i_data) throw( uno::RuntimeException ) { ::osl::MutexGuard aGuard( getMutex() ); - uno::Sequence<beans::PropertyValue> aProps; - if ( Data >>= aProps ) + + try { - const beans::PropertyValue* pPropsIter = aProps.getConstArray(); - const beans::PropertyValue* pPropsEnd = pPropsIter + aProps.getLength(); - for (sal_Int32 i = 0; pPropsIter != pPropsEnd; ++pPropsIter,++i) + const ::comphelper::NamedValueCollection aViewData( i_data ); + + m_aCollapsedSections = aViewData.getOrDefault( "CollapsedSections", m_aCollapsedSections ); + m_nPageNum = aViewData.getOrDefault( "MarkedSection", m_nPageNum ); + m_nZoomValue = aViewData.getOrDefault( "ZoomFactor", m_nZoomValue ); + // TODO: setting those 3 members is not enough - in theory, restoreViewData can be called when the + // view is fully alive, so we need to reflect those 3 values in the view. + // (At the moment, the method is called only during construction phase) + + + ::comphelper::NamedValueCollection aCommandProperties( aViewData.get( "CommandProperties" ) ); + const ::std::vector< ::rtl::OUString > aCommandNames( aCommandProperties.getNames() ); + + for ( ::std::vector< ::rtl::OUString >::const_iterator commandName = aCommandNames.begin(); + commandName != aCommandNames.end(); + ++commandName + ) { - if ( pPropsIter->Name.equalsAscii("CommandProperties") ) + const Any& rCommandValue = aCommandProperties.get( *commandName ); + if ( !rCommandValue.hasValue() ) + continue; + + if ( getView() ) { util::URL aCommand; - uno::Sequence< beans::PropertyValue> aArgs(1); - beans::PropertyValue* pArg = aArgs.getArray(); - pArg->Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); - uno::Sequence< beans::PropertyValue> aCommandProps; - if ( pPropsIter->Value >>= aCommandProps ) - { - const beans::PropertyValue* pIter = aCommandProps.getConstArray(); - const beans::PropertyValue* pEnd = pIter + aCommandProps.getLength(); - for (; pIter != pEnd; ++pIter) - { - pArg->Value = pIter->Value; - if ( pArg->Value.hasValue() ) - { - aCommand.Complete = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:")) + pIter->Name; - executeUnChecked(aCommand,aArgs); - } - } - } + aCommand.Complete = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:" ) ) + *commandName; + + Sequence< PropertyValue > aCommandArgs(1); + aCommandArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Value" ) ); + aCommandArgs[0].Value = rCommandValue; + + executeUnChecked( aCommand, aCommandArgs ); + } + else + { + if ( commandName->equalsAscii( "ShowRuler" ) ) + OSL_VERIFY( rCommandValue >>= m_bShowRuler ); + else if ( commandName->equalsAscii( "HelplinesMove" ) ) + OSL_VERIFY( rCommandValue >>= m_bHelplinesMove ); + else if ( commandName->equalsAscii( "GridVisible" ) ) + OSL_VERIFY( rCommandValue >>= m_bGridVisible ); + else if ( commandName->equalsAscii( "GridUse" ) ) + OSL_VERIFY( rCommandValue >>= m_bGridUse ); + else if ( commandName->equalsAscii( "ControlProperties" ) ) + OSL_VERIFY( rCommandValue >>= m_bShowProperties ); + else if ( commandName->equalsAscii( "LastPropertyBrowserPage" ) ) + OSL_VERIFY( rCommandValue >>= m_sLastActivePage ); + else if ( commandName->equalsAscii( "SplitPosition" ) ) + OSL_VERIFY( rCommandValue >>= m_nSplitPos ); } - else if ( pPropsIter->Name.equalsAscii("CollapsedSections") ) - pPropsIter->Value >>= m_aCollapsedSections; - else if ( pPropsIter->Name.equalsAscii("MarkedSection") ) - pPropsIter->Value >>= m_nPageNum; - else if ( pPropsIter->Name.equalsAscii("ZoomFactor") ) - pPropsIter->Value >>= m_nZoomValue; } } + catch ( const IllegalArgumentException& e ) + { + DBG_UNHANDLED_EXCEPTION(); + } } // ----------------------------------------------------------------------------- void OReportController::updateFloater() |