diff options
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/appl/appuno.cxx | 95 | ||||
-rw-r--r-- | sfx2/source/appl/newhelp.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/mailmodel.cxx | 137 | ||||
-rw-r--r-- | sfx2/source/dialog/mgetempl.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/dialog/mgetempl.hrc | 1 | ||||
-rw-r--r-- | sfx2/source/dialog/mgetempl.src | 8 | ||||
-rw-r--r-- | sfx2/source/dialog/templdlg.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/dialog/versdlg.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/inc/workwin.hxx | 4 | ||||
-rw-r--r-- | sfx2/source/view/ipclient.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/view/sfxbasecontroller.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/view/viewimp.hxx | 33 | ||||
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 44 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 136 |
14 files changed, 328 insertions, 166 deletions
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index eebc5a930c03..62038598a96f 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -165,7 +165,7 @@ static char const sDontEdit[] = "DontEdit"; static char const sSilent[] = "Silent"; static char const sJumpMark[] = "JumpMark"; static char const sFileName[] = "FileName"; -static char const sSalvageURL[] = "SalvagedFile"; +static char const sSalvagedFile[] = "SalvagedFile"; static char const sStatusInd[] = "StatusIndicator"; static char const sModel[] = "Model"; static char const sFrame[] = "Frame"; @@ -191,6 +191,8 @@ static char const sUseSystemDialog[] = "UseSystemDialog"; static char const sStandardDir[] = "StandardDir"; static char const sBlackList[] = "BlackList"; static char const sModifyPasswordInfo[] = "ModifyPasswordInfo"; +static char const sSuggestedSaveAsDir[] = "SuggestedSaveAsDir"; +static char const sSuggestedSaveAsName[] = "SuggestedSaveAsName"; void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs, SfxAllItemSet& rSet, const SfxSlot* pSlot ) { @@ -685,7 +687,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque { ::rtl::OUString sVal; sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); - DBG_ASSERT( bOK, "invalid type or value for StanadardDir" ); + DBG_ASSERT( bOK, "invalid type or value for StandardDir" ); if (bOK) rSet.Put( SfxStringItem( SID_STANDARD_DIR, sVal ) ); } @@ -709,11 +711,11 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if (bOK) rSet.Put( SfxStringItem( SID_FILE_NAME, sVal ) ); } - else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSalvageURL)) ) + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSalvagedFile)) ) { ::rtl::OUString sVal; sal_Bool bOK = (rProp.Value >>= sVal); - DBG_ASSERT( bOK, "invalid type or value for SalvageURL" ); + DBG_ASSERT( bOK, "invalid type or value for SalvagedFile" ); if (bOK) rSet.Put( SfxStringItem( SID_DOC_SALVAGE, sVal ) ); } @@ -721,7 +723,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque { ::rtl::OUString sVal; sal_Bool bOK = (rProp.Value >>= sVal); - DBG_ASSERT( bOK, "invalid type or value for SalvageURL" ); + DBG_ASSERT( bOK, "invalid type or value for FolderName" ); if (bOK) rSet.Put( SfxStringItem( SID_PATH, sVal ) ); } @@ -850,6 +852,22 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque { rSet.Put( SfxUnoAnyItem( SID_MODIFYPASSWORDINFO, rProp.Value ) ); } + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSuggestedSaveAsDir)) ) + { + ::rtl::OUString sVal; + sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); + DBG_ASSERT( bOK, "invalid type or value for SuggestedSaveAsDir" ); + if (bOK) + rSet.Put( SfxStringItem( SID_SUGGESTEDSAVEASDIR, sVal ) ); + } + else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSuggestedSaveAsName)) ) + { + ::rtl::OUString sVal; + sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); + DBG_ASSERT( bOK, "invalid type or value for SuggestedSaveAsName" ); + if (bOK) + rSet.Put( SfxStringItem( SID_SUGGESTEDSAVEASNAME, sVal ) ); + } #ifdef DBG_UTIL else --nFoundArgs; @@ -1064,6 +1082,10 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta nAdditional++; if ( rSet.GetItemState( SID_MODIFYPASSWORDINFO ) == SFX_ITEM_SET ) nAdditional++; + if ( rSet.GetItemState( SID_SUGGESTEDSAVEASDIR ) == SFX_ITEM_SET ) + nAdditional++; + if ( rSet.GetItemState( SID_SUGGESTEDSAVEASNAME ) == SFX_ITEM_SET ) + nAdditional++; // consider additional arguments nProps += nAdditional; @@ -1205,6 +1227,10 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta continue; if ( nId == SID_MODIFYPASSWORDINFO ) continue; + if ( nId == SID_SUGGESTEDSAVEASDIR ) + continue; + if ( nId == SID_SUGGESTEDSAVEASNAME ) + continue; } ByteString aDbg( "Unknown item detected: "); @@ -1489,7 +1515,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta } if ( rSet.GetItemState( SID_DOC_SALVAGE, sal_False, &pItem ) == SFX_ITEM_SET ) { - pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSalvageURL)); + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSalvagedFile)); pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); } if ( rSet.GetItemState( SID_PATH, sal_False, &pItem ) == SFX_ITEM_SET ) @@ -1568,6 +1594,16 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sModifyPasswordInfo)); pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() ); } + if ( rSet.GetItemState( SID_SUGGESTEDSAVEASDIR, sal_False, &pItem ) == SFX_ITEM_SET ) + { + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSuggestedSaveAsDir)); + pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); + } + if ( rSet.GetItemState( SID_SUGGESTEDSAVEASNAME, sal_False, &pItem ) == SFX_ITEM_SET ) + { + pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSuggestedSaveAsName)); + pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) ); + } } } @@ -1723,7 +1759,6 @@ void SAL_CALL SfxMacroLoader::removeStatusListener( { } -// ----------------------------------------------------------------------- ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star::uno::Any& rRetval, SfxObjectShell* pSh ) throw ( ::com::sun::star::uno::RuntimeException ) { @@ -1843,8 +1878,8 @@ ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star:: if ( bSetDocMacroMode ) { - // remove flag for modal mode - pDoc->SetMacroMode_Impl( FALSE ); + // remove flag for modal mode + pDoc->SetMacroMode_Impl( FALSE ); } } else @@ -2186,18 +2221,18 @@ RequestFilterOptions::RequestFilterOptions( ::com::sun::star::uno::Reference< :: ::rtl::OUString temp; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > temp2; ::com::sun::star::document::FilterOptionsRequest aOptionsRequest( temp, - temp2, + temp2, rModel, rProperties ); - m_aRequest <<= aOptionsRequest; + m_aRequest <<= aOptionsRequest; - m_pAbort = new ContinuationAbort; - m_pOptions = new FilterOptionsContinuation; + m_pAbort = new ContinuationAbort; + m_pOptions = new FilterOptionsContinuation; - m_lContinuations.realloc( 2 ); - m_lContinuations[0] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pAbort ); - m_lContinuations[1] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pOptions ); + m_lContinuations.realloc( 2 ); + m_lContinuations[0] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pAbort ); + m_lContinuations[1] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pOptions ); } ::com::sun::star::uno::Any SAL_CALL RequestFilterOptions::getRequest() @@ -2220,17 +2255,17 @@ RequestPackageReparation::RequestPackageReparation( ::rtl::OUString aName ) ::rtl::OUString temp; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > temp2; ::com::sun::star::document::BrokenPackageRequest aBrokenPackageRequest( temp, - temp2, - aName ); + temp2, + aName ); - m_aRequest <<= aBrokenPackageRequest; + m_aRequest <<= aBrokenPackageRequest; - m_pApprove = new ContinuationApprove; - m_pDisapprove = new ContinuationDisapprove; + m_pApprove = new ContinuationApprove; + m_pDisapprove = new ContinuationDisapprove; - m_lContinuations.realloc( 2 ); - m_lContinuations[0] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pApprove ); - m_lContinuations[1] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pDisapprove ); + m_lContinuations.realloc( 2 ); + m_lContinuations[0] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pApprove ); + m_lContinuations[1] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pDisapprove ); } /*uno::*/Any SAL_CALL RequestPackageReparation::queryInterface( const /*uno::*/Type& rType ) throw (RuntimeException) @@ -2273,15 +2308,15 @@ NotifyBrokenPackage::NotifyBrokenPackage( ::rtl::OUString aName ) ::rtl::OUString temp; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > temp2; ::com::sun::star::document::BrokenPackageRequest aBrokenPackageRequest( temp, - temp2, - aName ); + temp2, + aName ); - m_aRequest <<= aBrokenPackageRequest; + m_aRequest <<= aBrokenPackageRequest; - m_pAbort = new ContinuationAbort; + m_pAbort = new ContinuationAbort; - m_lContinuations.realloc( 1 ); - m_lContinuations[0] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pAbort ); + m_lContinuations.realloc( 1 ); + m_lContinuations[0] = ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation >( m_pAbort ); } /*uno::*/Any SAL_CALL NotifyBrokenPackage::queryInterface( const /*uno::*/Type& rType ) throw (RuntimeException) diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 9235777e0d5a..1d79b89a776d 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -300,7 +300,7 @@ ContentListBox_Impl::ContentListBox_Impl( Window* pParent, const ResId& rResId ) aDocumentImage = Image( SfxResId( IMG_HELP_CONTENT_DOC_HC ) ); } - SetWindowBits( WB_HIDESELECTION | WB_HSCROLL ); + SetStyle( GetStyle() | WB_HIDESELECTION | WB_HSCROLL ); SetEntryHeight( 16 ); SetSelectionMode( SINGLE_SELECTION ); diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx index 0e0c6ec22ee1..dfd099f6cf45 100644 --- a/sfx2/source/dialog/mailmodel.cxx +++ b/sfx2/source/dialog/mailmodel.cxx @@ -53,13 +53,11 @@ #include <com/sun/star/security/XDocumentDigitalSignatures.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/frame/XDispatch.hpp> +#include <com/sun/star/frame/XStatusListener.hpp> #include <com/sun/star/ucb/InsertCommandArgument.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/document/XExporter.hpp> -#ifndef _RTL_TEXTENC_H -#include <rtl/textench.h> -#endif #include <rtl/uri.h> #include <rtl/uri.hxx> #include <rtl/ustrbuf.hxx> @@ -84,6 +82,7 @@ #include <comphelper/mediadescriptor.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <vcl/svapp.hxx> +#include <cppuhelper/implbase1.hxx> // -------------------------------------------------------------- using namespace ::com::sun::star; @@ -98,6 +97,54 @@ using namespace ::com::sun::star::system; using namespace ::rtl; namespace css = ::com::sun::star; +// - class PrepareListener_Impl ------------------------------------------ +class PrepareListener_Impl : public ::cppu::WeakImplHelper1< css::frame::XStatusListener > +{ + bool m_bState; +public: + PrepareListener_Impl(); + virtual ~PrepareListener_Impl(); + + // css.frame.XStatusListener + virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& aEvent) + throw(css::uno::RuntimeException); + + // css.lang.XEventListener + virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent) + throw(css::uno::RuntimeException); + + bool IsSet() const {return m_bState;} +}; + +/*-- 25.08.2010 14:32:49--------------------------------------------------- + + -----------------------------------------------------------------------*/ +PrepareListener_Impl::PrepareListener_Impl() : + m_bState( false ) +{ +} +/*-- 25.08.2010 14:32:51--------------------------------------------------- + + -----------------------------------------------------------------------*/ +PrepareListener_Impl::~PrepareListener_Impl() +{ +} +/*-- 25.08.2010 14:32:51--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void PrepareListener_Impl::statusChanged(const css::frame::FeatureStateEvent& rEvent) throw(css::uno::RuntimeException) +{ + if( rEvent.IsEnabled ) + rEvent.State >>= m_bState; + else + m_bState = sal_False; +} +/*-- 25.08.2010 14:32:52--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void PrepareListener_Impl::disposing(const css::lang::EventObject& /*rEvent*/) throw(css::uno::RuntimeException) +{ +} // class AddressList_Impl ------------------------------------------------ @@ -547,46 +594,68 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( aArgs[nNumArgs-1].Value = css::uno::makeAny( aPassword ); } - if ( bModified || !bHasLocation || bStoreTo ) + bool bNeedsPreparation = false; + css::util::URL aPrepareURL; + css::uno::Reference< css::frame::XDispatch > xPrepareDispatch; + css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( xFrame, css::uno::UNO_QUERY ); + css::uno::Reference< css::util::XURLTransformer > xURLTransformer( + xSMGR->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), + css::uno::UNO_QUERY ); + if( !bSendAsPDF ) { - // Document is modified, is newly created or should be stored in a special format try { - css::uno::Reference< css::util::XURLTransformer > xURLTransformer( - xSMGR->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ))), - css::uno::UNO_QUERY ); - - css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( xFrame, css::uno::UNO_QUERY ); - css::uno::Reference< css::frame::XDispatch > xDispatch; + // check if the document needs to be prepared for sending as mail (embedding of links, removal of invisible content) - css::util::URL aURL; - css::uno::Sequence< css::beans::PropertyValue > aDispatchArgs; + if ( xURLTransformer.is() ) + { + aPrepareURL.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PrepareMailExport" )); + xURLTransformer->parseStrict( aPrepareURL ); + } - if( !bSendAsPDF ) + if ( xDispatchProvider.is() ) { - if ( xURLTransformer.is() ) + xPrepareDispatch = css::uno::Reference< css::frame::XDispatch >( + xDispatchProvider->queryDispatch( aPrepareURL, ::rtl::OUString(), 0 )); + if ( xPrepareDispatch.is() ) { - aURL.Complete = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PrepareMailExport" )); - xURLTransformer->parseStrict( aURL ); + PrepareListener_Impl* pPrepareListener; + uno::Reference< css::frame::XStatusListener > xStatusListener = pPrepareListener = new PrepareListener_Impl; + xPrepareDispatch->addStatusListener( xStatusListener, aPrepareURL ); + bNeedsPreparation = pPrepareListener->IsSet(); + xPrepareDispatch->removeStatusListener( xStatusListener, aPrepareURL ); } + } + } + catch ( css::uno::RuntimeException& ) + { + throw; + } + catch ( css::uno::Exception& ) + { + } + } - if ( xDispatchProvider.is() ) + if ( bModified || !bHasLocation || bStoreTo || bNeedsPreparation ) + { + // Document is modified, is newly created or should be stored in a special format + try + { + if( bNeedsPreparation && xPrepareDispatch.is() ) + { + if ( xPrepareDispatch.is() ) { - xDispatch = css::uno::Reference< css::frame::XDispatch >( - xDispatchProvider->queryDispatch( aURL, ::rtl::OUString(), 0 )); - if ( xDispatch.is() ) + try + { + css::uno::Sequence< css::beans::PropertyValue > aDispatchArgs; + xPrepareDispatch->dispatch( aPrepareURL, aDispatchArgs ); + } + catch ( css::uno::RuntimeException& ) + { + throw; + } + catch ( css::uno::Exception& ) { - try - { - xDispatch->dispatch( aURL, aDispatchArgs ); - } - catch ( css::uno::RuntimeException& ) - { - throw; - } - catch ( css::uno::Exception& ) - { - } } } } @@ -608,6 +677,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( if( !bSendAsPDF ) { + css::util::URL aURL; // #i30432# notify that export is finished - the Writer may want to restore removed content if ( xURLTransformer.is() ) { @@ -617,12 +687,13 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( if ( xDispatchProvider.is() ) { - xDispatch = css::uno::Reference< css::frame::XDispatch >( + css::uno::Reference< css::frame::XDispatch > xDispatch = css::uno::Reference< css::frame::XDispatch >( xDispatchProvider->queryDispatch( aURL, ::rtl::OUString(), 0 )); if ( xDispatch.is() ) { try { + css::uno::Sequence< css::beans::PropertyValue > aDispatchArgs; xDispatch->dispatch( aURL, aDispatchArgs ); } catch ( css::uno::RuntimeException& ) diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index 1f5472cf2052..1666916b0c0b 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -65,6 +65,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage( Window* pParent, const SfxItem aNameFt ( this, SfxResId( FT_NAME ) ), aNameEd ( this, SfxResId( ED_NAME ) ), + aNameMLE ( this, SfxResId( MLE_NAME ) ), aAutoCB ( this, SfxResId( CB_AUTO ) ), aFollowFt ( this, SfxResId( FT_NEXT ) ), @@ -147,8 +148,17 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage( Window* pParent, const SfxItem } aNameEd.SetText(pStyle->GetName()); - if ( !pStyle->IsUserDefined() ) + // Set the field read-only if it is NOT an user-defined style + // but allow selecting and copying + if ( !pStyle->IsUserDefined() ) { aNameEd.SetReadOnly(); + aNameEd.Hide(); + + aNameMLE.SetControlBackground( GetSettings().GetStyleSettings().GetDialogColor() ); + aNameMLE.SetText( pStyle->GetName() ); + aNameMLE.EnableCursor( FALSE ); + aNameMLE.Show(); + } if ( pStyle->HasFollowSupport() && pPool ) { diff --git a/sfx2/source/dialog/mgetempl.hrc b/sfx2/source/dialog/mgetempl.hrc index e998baba939d..a34700846f9c 100644 --- a/sfx2/source/dialog/mgetempl.hrc +++ b/sfx2/source/dialog/mgetempl.hrc @@ -25,6 +25,7 @@ * ************************************************************************/ #define ED_NAME 2 +#define MLE_NAME 13 #define LB_NEXT 4 #define FT_BASE 5 #define LB_BASE 6 diff --git a/sfx2/source/dialog/mgetempl.src b/sfx2/source/dialog/mgetempl.src index bfa3948d90ac..c478ed715646 100644 --- a/sfx2/source/dialog/mgetempl.src +++ b/sfx2/source/dialog/mgetempl.src @@ -49,6 +49,14 @@ TabPage TP_MANAGE_STYLES Pos = MAP_APPFONT ( 70 , 6 ) ; Size = MAP_APPFONT ( 184 , 12 ) ; }; + MultiLineEdit MLE_NAME + { + Pos = MAP_APPFONT ( 70 , 8 ) ; + Size = MAP_APPFONT ( 80 , 12 ) ; + Border = FALSE; + ReadOnly = TRUE; + Hide = TRUE; + }; CheckBox CB_AUTO { HelpID = "sfx2:CheckBox:TP_MANAGE_STYLES:CB_AUTO"; diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index a3d9fd7b4ed2..88801d95f0d5 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -756,7 +756,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Sfx DEFINE_CONST_UNICODE("com.sun.star.frame.ModuleManager") ), UNO_QUERY ), pbDeleted ( NULL ), - aFmtLb ( this, WB_BORDER | WB_TABSTOP | WB_SORT ), + aFmtLb ( this, WB_BORDER | WB_TABSTOP | WB_SORT | WB_QUICK_SEARCH ), aFilterLb ( pW, WB_BORDER | WB_DROPDOWN | WB_TABSTOP ), nActFamily ( 0xffff ), @@ -780,7 +780,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Sfx { aFmtLb.SetHelpId( HID_TEMPLATE_FMT ); aFilterLb.SetHelpId( HID_TEMPLATE_FILTER ); - aFmtLb.SetWindowBits( WB_SORT | WB_HIDESELECTION ); + aFmtLb.SetStyle( aFmtLb.GetStyle() | WB_SORT | WB_HIDESELECTION ); Font aFont = aFmtLb.GetFont(); aFont.SetWeight( WEIGHT_NORMAL ); aFmtLb.SetFont( aFont ); @@ -823,7 +823,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Mod bBindingUpdate ( TRUE ) { - aFmtLb.SetWindowBits( WB_SORT ); + aFmtLb.SetStyle( aFmtLb.GetStyle() | WB_SORT ); } //------------------------------------------------------------------------- @@ -1776,7 +1776,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, ListBox *, pBox ) pTreeBox = new StyleTreeListBox_Impl( this, WB_HASBUTTONS | WB_HASLINES | WB_BORDER | WB_TABSTOP | WB_HASLINESATROOT | - WB_HASBUTTONSATROOT | WB_HIDESELECTION ); + WB_HASBUTTONSATROOT | WB_HIDESELECTION | WB_QUICK_SEARCH ); pTreeBox->SetFont( aFmtLb.GetFont() ); pTreeBox->SetPosSizePixel(aFmtLb.GetPosPixel(), aFmtLb.GetSizePixel()); diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index beb43c192810..8e440de0757c 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -239,7 +239,7 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, BOOL bIsSaveVersion aVersionBox.SetDoubleClickHdl( LINK( this, SfxVersionDialog, DClickHdl_Impl ) ); aVersionBox.GrabFocus(); - aVersionBox.SetWindowBits( WB_HSCROLL | WB_CLIPCHILDREN ); + aVersionBox.SetStyle( aVersionBox.GetStyle() | WB_HSCROLL | WB_CLIPCHILDREN ); aVersionBox.SetSelectionMode( SINGLE_SELECTION ); aVersionBox.SetTabs( &nTabs_Impl[0], MAP_APPFONT ); aVersionBox.Resize(); // OS: Hack fuer richtige Selektion diff --git a/sfx2/source/inc/workwin.hxx b/sfx2/source/inc/workwin.hxx index a82b72bc2947..0e263a58b90e 100644 --- a/sfx2/source/inc/workwin.hxx +++ b/sfx2/source/inc/workwin.hxx @@ -28,6 +28,7 @@ #define _SFXWORKWIN_HXX #include <vector> +#include <deque> #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/XFrame.hpp> #ifndef _COM_SUN_STAR_UI_XUILEMENT_HPP_ @@ -175,11 +176,10 @@ enum SfxDockingConfig DECL_PTRARRAY( SfxChildList_Impl, SfxChild_Impl*, 2, 2 ) DECL_PTRARRAY( SfxChildWindows_Impl, SfxChildWin_Impl*, 2, 2 ) -SV_DECL_OBJARR( SfxObjectBarArr_Impl, SfxObjectBar_Impl, 1, 2 ) struct SfxObjectBarList_Impl { - SfxObjectBarArr_Impl aArr; + std::deque<SfxObjectBar_Impl> aArr; USHORT nAct; SfxObjectBar_Impl operator[] ( USHORT n ) diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index 328d88d8b2b9..997cb584f83d 100644 --- a/sfx2/source/view/ipclient.cxx +++ b/sfx2/source/view/ipclient.cxx @@ -220,6 +220,7 @@ void SAL_CALL SfxInPlaceClient_Impl::notifyEvent( const document::EventObject& a if ( m_pClient && aEvent.EventName.equalsAscii("OnVisAreaChanged") && m_nAspect != embed::Aspects::MSOLE_ICON ) { + m_pClient->FormatChanged(); // for Writer when format of the object is changed with the area m_pClient->ViewChanged(); m_pClient->Invalidate(); } @@ -1082,6 +1083,11 @@ void SfxInPlaceClient::MakeVisible() // dummy implementation } +void SfxInPlaceClient::FormatChanged() +{ + // dummy implementation +} + void SfxInPlaceClient::DeactivateObject() { if ( GetObject().is() ) diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index cda5fd0bdd7d..19aa4b75ee0f 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -1052,7 +1052,7 @@ void SAL_CALL SfxBaseController::dispose() throw( ::com::sun::star::uno::Runtime if ( pFrame && pFrame->GetViewShell() == m_pData->m_pViewShell ) pFrame->GetFrame().SetIsClosing_Impl(); m_pData->m_pViewShell->DiscardClients_Impl(); - m_pData->m_pViewShell->pImp->bControllerSet = sal_False ; + m_pData->m_pViewShell->pImp->m_bControllerSet = false; if ( pFrame ) { @@ -1438,11 +1438,11 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect ) try { Reference< XViewDataSupplier > xViewDataSupplier( getModel(), UNO_QUERY_THROW ); - Reference< XIndexAccess > xViewData( xViewDataSupplier->getViewData(), UNO_SET_THROW ); + Reference< XIndexAccess > xViewData( xViewDataSupplier->getViewData() ); // find the view data item whose ViewId matches the ID of the view we're just connecting to const SfxObjectFactory& rDocFactory( rDoc.GetFactory() ); - const sal_Int32 nCount = xViewData->getCount(); + const sal_Int32 nCount = xViewData.is() ? xViewData->getCount() : 0; sal_Int32 nViewDataIndex = 0; for ( sal_Int32 i=0; i<nCount; ++i ) { diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx index be20cd2f2a47..0826e78870bb 100644 --- a/sfx2/source/view/viewimp.hxx +++ b/sfx2/source/view/viewimp.hxx @@ -25,8 +25,8 @@ * ************************************************************************/ -#ifndef _VIEWIMP_HXX -#define _VIEWIMP_HXX +#ifndef SFX_VIEWIMP_HXX +#define SFX_VIEWIMP_HXX // include --------------------------------------------------------------- @@ -56,28 +56,29 @@ struct SfxViewShell_Impl { ::osl::Mutex aMutex; ::cppu::OInterfaceContainerHelper aInterceptorContainer; - BOOL bControllerSet; + bool m_bControllerSet; SfxShellArr_Impl aArr; SvBorder aBorder; Size aOptimalSize; Size aMargin; - USHORT nPrinterLocks; - BOOL bCanPrint; - BOOL bHasPrintOptions; - BOOL bPlugInsActive; - BOOL bIsShowView; - BOOL bOwnsMenu; - BOOL bGotOwnerShip; - BOOL bGotFrameOwnerShip; - SfxScrollingMode eScroll; - USHORT nFamily; - SfxBaseController* pController; - ::svt::AcceleratorExecute* pAccExec; + USHORT m_nPrinterLocks; + bool m_bCanPrint; + bool m_bHasPrintOptions; + bool m_bPlugInsActive; + bool m_bIsShowView; + // FIXME UNUSED ??? + //bool m_bOwnsMenu; + bool m_bGotOwnership; + bool m_bGotFrameOwnership; + SfxScrollingMode m_eScroll; + USHORT m_nFamily; + ::rtl::Reference<SfxBaseController> m_pController; + ::std::auto_ptr< ::svt::AcceleratorExecute > m_pAccExec; com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aPrintOpts; ::rtl::Reference< SfxClipboardChangeListener > xClipboardListener; ::boost::shared_ptr< vcl::PrinterController > m_pPrinterController; - SfxViewShell_Impl(); + SfxViewShell_Impl(USHORT const nFlags); }; #endif diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 4ed0173be8e1..d1cfd8c2d181 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -143,18 +143,26 @@ SfxPrinterController::SfxPrinterController( const Any& i_rComplete, aRenderOptions[1].Value = i_rViewProp; aRenderOptions[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrinter" ) ); aRenderOptions[2].Value <<= sal_True; - Sequence< beans::PropertyValue > aRenderParms( mxRenderable->getRenderer( 0 , getSelectionObject(), aRenderOptions ) ); - int nProps = aRenderParms.getLength(); - for( int i = 0; i < nProps; i++ ) + try { - if( aRenderParms[i].Name.equalsAscii( "ExtraPrintUIOptions" ) ) + Sequence< beans::PropertyValue > aRenderParms( mxRenderable->getRenderer( 0 , getSelectionObject(), aRenderOptions ) ); + int nProps = aRenderParms.getLength(); + for( int i = 0; i < nProps; i++ ) { - Sequence< beans::PropertyValue > aUIProps; - aRenderParms[i].Value >>= aUIProps; - setUIOptions( aUIProps ); - break; + if( aRenderParms[i].Name.equalsAscii( "ExtraPrintUIOptions" ) ) + { + Sequence< beans::PropertyValue > aUIProps; + aRenderParms[i].Value >>= aUIProps; + setUIOptions( aUIProps ); + break; + } } } + catch( lang::IllegalArgumentException& ) + { + // the first renderer should always be available for the UI options, + // but catch the exception to be safe + } } // set some job parameters @@ -234,7 +242,13 @@ Sequence< beans::PropertyValue > SfxPrinterController::getPageParameters( int i_ if( mxRenderable.is() && pPrinter ) { Sequence< beans::PropertyValue > aJobOptions( getMergedOptions() ); - aResult = mxRenderable->getRenderer( i_nPage, getSelectionObject(), aJobOptions ); + try + { + aResult = mxRenderable->getRenderer( i_nPage, getSelectionObject(), aJobOptions ); + } + catch( lang::IllegalArgumentException& ) + { + } } return aResult; } @@ -836,7 +850,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) // execute PrinterSetupDialog PrinterSetupDialog* pPrintSetupDlg = new PrinterSetupDialog( GetWindow() ); - if ( pImp->bHasPrintOptions ) + if (pImp->m_bHasPrintOptions) { // additional controls for dialog pExecutor = new SfxDialogExecutor_Impl( this, pPrintSetupDlg ); @@ -985,7 +999,7 @@ ErrCode SfxViewShell::DoPrint( SfxPrinter* /*pPrinter*/, BOOL SfxViewShell::IsPrinterLocked() const { - return pImp->nPrinterLocks > 0; + return pImp->m_nPrinterLocks > 0; } //-------------------------------------------------------------------- @@ -994,9 +1008,13 @@ void SfxViewShell::LockPrinter( BOOL bLock) { BOOL bChanged = FALSE; if ( bLock ) - bChanged = 1 == ++pImp->nPrinterLocks; + { + bChanged = 1 == ++pImp->m_nPrinterLocks; + } else - bChanged = 0 == --pImp->nPrinterLocks; + { + bChanged = 0 == --pImp->m_nPrinterLocks; + } if ( bChanged ) { diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 5c65c967434f..968d0cbe8676 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -240,9 +240,21 @@ static ::rtl::OUString RetrieveLabelFromCommand( } //========================================================================= -SfxViewShell_Impl::SfxViewShell_Impl() +SfxViewShell_Impl::SfxViewShell_Impl(USHORT const nFlags) : aInterceptorContainer( aMutex ) -, pAccExec(0) +, m_bControllerSet(false) +, m_nPrinterLocks(0) +, m_bCanPrint(SFX_VIEW_CAN_PRINT == (nFlags & SFX_VIEW_CAN_PRINT)) +, m_bHasPrintOptions( + SFX_VIEW_HAS_PRINTOPTIONS == (nFlags & SFX_VIEW_HAS_PRINTOPTIONS)) +, m_bPlugInsActive(true) +, m_bIsShowView(SFX_VIEW_NO_SHOW != (nFlags & SFX_VIEW_NO_SHOW)) +, m_bGotOwnership(false) +, m_bGotFrameOwnership(false) +, m_eScroll(SCROLLING_DEFAULT) +, m_nFamily(0xFFFF) // undefined, default set by TemplateDialog +, m_pController(0) +, m_pAccExec(0) {} //========================================================================= @@ -374,7 +386,9 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) { SFX_REQUEST_ARG(rReq, pItem, SfxUInt16Item, nId, FALSE); if (pItem) - pImp->nFamily = pItem->GetValue(); + { + pImp->m_nFamily = pItem->GetValue(); + } break; } @@ -674,7 +688,9 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) case SID_PLUGINS_ACTIVE: { SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nId, FALSE); - BOOL bActive = pShowItem ? pShowItem->GetValue() : !pImp->bPlugInsActive; + bool const bActive = (pShowItem) + ? pShowItem->GetValue() + : !pImp->m_bPlugInsActive; // ggf. recorden if ( !rReq.IsAPI() ) rReq.AppendItem( SfxBoolItem( nId, bActive ) ); @@ -684,7 +700,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) rReq.Done(TRUE); // ausfuehren - if ( !pShowItem || bActive != pImp->bPlugInsActive ) + if (!pShowItem || (bActive != pImp->m_bPlugInsActive)) { SfxFrame* pTopFrame = &GetFrame()->GetTopFrame(); if ( pTopFrame != &GetFrame()->GetFrame() ) @@ -704,7 +720,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) SfxViewShell *pView = pTopFrame->GetCurrentViewFrame()->GetViewShell(); if ( pView ) { - pView->pImp->bPlugInsActive = bActive; + pView->pImp->m_bPlugInsActive = bActive; Rectangle aVisArea = GetObjectShell()->GetVisArea(); VisAreaChanged(aVisArea); @@ -758,7 +774,7 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet ) case SID_SETUPPRINTER: case SID_PRINTER_NAME: { - BOOL bEnabled = pImp->bCanPrint && !pImp->nPrinterLocks; + bool bEnabled = pImp->m_bCanPrint && !pImp->m_nPrinterLocks; bEnabled = bEnabled && !Application::GetSettings().GetMiscSettings().GetDisablePrinting(); if ( bEnabled ) { @@ -812,7 +828,8 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet ) // PlugIns running case SID_PLUGINS_ACTIVE: { - rSet.Put( SfxBoolItem( SID_PLUGINS_ACTIVE, !pImp->bPlugInsActive) ); + rSet.Put( SfxBoolItem( SID_PLUGINS_ACTIVE, + !pImp->m_bPlugInsActive) ); break; } /* @@ -832,7 +849,7 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet ) */ case SID_STYLE_FAMILY : { - rSet.Put( SfxUInt16Item( SID_STYLE_FAMILY, pImp->nFamily ) ); + rSet.Put( SfxUInt16Item( SID_STYLE_FAMILY, pImp->m_nFamily ) ); break; } } @@ -1155,8 +1172,10 @@ void SfxViewShell::InvalidateBorder() DBG_ASSERT( GetViewFrame(), "SfxViewShell without SfxViewFrame" ); GetViewFrame()->InvalidateBorderImpl( this ); - if ( pImp->pController ) - pImp->pController->BorderWidthsChanged_Impl(); + if (pImp->m_pController.is()) + { + pImp->m_pController->BorderWidthsChanged_Impl(); + } } //-------------------------------------------------------------------- @@ -1171,8 +1190,10 @@ void SfxViewShell::SetBorderPixel( const SvBorder &rBorder ) GetViewFrame()->SetBorderPixelImpl( this, rBorder ); // notify related controller that border size is changed - if ( pImp->pController ) - pImp->pController->BorderWidthsChanged_Impl(); + if (pImp->m_pController.is()) + { + pImp->m_pController->BorderWidthsChanged_Impl(); + } } } @@ -1247,7 +1268,7 @@ SfxViewShell::SfxViewShell ) : SfxShell(this) - ,pImp( new SfxViewShell_Impl ) +, pImp( new SfxViewShell_Impl(nFlags) ) ,pIPClientList( 0 ) ,pFrame(pViewFrame) ,pSubShell(0) @@ -1257,22 +1278,12 @@ SfxViewShell::SfxViewShell DBG_CTOR(SfxViewShell, 0); //pImp->pPrinterCommandQueue = new SfxAsyncPrintExec_Impl( this ); - pImp->pController = 0; - pImp->bIsShowView = - !(SFX_VIEW_NO_SHOW == (nFlags & SFX_VIEW_NO_SHOW)); - - pImp->bCanPrint = SFX_VIEW_CAN_PRINT == (nFlags & SFX_VIEW_CAN_PRINT); - pImp->bHasPrintOptions = - SFX_VIEW_HAS_PRINTOPTIONS == (nFlags & SFX_VIEW_HAS_PRINTOPTIONS); - pImp->bPlugInsActive = TRUE; - pImp->bGotOwnerShip = FALSE; - pImp->bGotFrameOwnerShip = FALSE; + if ( pViewFrame->GetParentViewFrame() ) - pImp->bPlugInsActive = pViewFrame->GetParentViewFrame()->GetViewShell()->pImp->bPlugInsActive; - pImp->eScroll = SCROLLING_DEFAULT; - pImp->nPrinterLocks = 0; - pImp->bControllerSet = FALSE; - pImp->nFamily = 0xFFFF; // undefined, default set by TemplateDialog + { + pImp->m_bPlugInsActive = pViewFrame->GetParentViewFrame() + ->GetViewShell()->pImp->m_bPlugInsActive; + } SetMargin( pViewFrame->GetMargin_Impl() ); SetPool( &pViewFrame->GetObjectShell()->GetPool() ); @@ -1301,16 +1312,10 @@ SfxViewShell::~SfxViewShell() pImp->xClipboardListener = NULL; } - if ( pImp->pController ) + if (pImp->m_pController.is()) { - pImp->pController->ReleaseShell_Impl(); - pImp->pController->release(); - pImp->pController = NULL; - } - - if (pImp->pAccExec) - { - DELETEZ( pImp->pAccExec ); + pImp->m_pController->ReleaseShell_Impl(); + pImp->m_pController.clear(); } //DELETEZ( pImp->pPrinterCommandQueue ); @@ -1660,7 +1665,8 @@ void SfxViewShell::Notify( SfxBroadcaster& rBC, SFX_ITEMSET_ARG( pSet, pItem, SfxUnoAnyItem, SID_VIEW_DATA, sal_False ); if ( pItem ) { - pImp->pController->restoreViewData( pItem->GetValue() ); + pImp->m_pController->restoreViewData( + pItem->GetValue() ); pSet->ClearItem( SID_VIEW_DATA ); } @@ -1679,13 +1685,15 @@ void SfxViewShell::Notify( SfxBroadcaster& rBC, BOOL SfxViewShell::ExecKey_Impl(const KeyEvent& aKey) { - if (!pImp->pAccExec) + if (!pImp->m_pAccExec.get()) { - pImp->pAccExec = ::svt::AcceleratorExecute::createAcceleratorHelper(); - pImp->pAccExec->init(::comphelper::getProcessServiceFactory(), pFrame->GetFrame().GetFrameInterface()); + pImp->m_pAccExec.reset( + ::svt::AcceleratorExecute::createAcceleratorHelper() ); + pImp->m_pAccExec->init(::comphelper::getProcessServiceFactory(), + pFrame->GetFrame().GetFrameInterface()); } - return pImp->pAccExec->execute(aKey.GetKeyCode()); + return pImp->m_pAccExec->execute(aKey.GetKeyCode()); } //-------------------------------------------------------------------- @@ -1828,7 +1836,7 @@ void SfxViewShell::CheckIPClient_Impl( SfxInPlaceClient *pIPClient, const Rectan ( ( pIPClient->GetObjectMiscStatus() & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE ) != 0 ); // this method is called when either a client is created or the "Edit/Plugins" checkbox is checked - if ( !pIPClient->IsObjectInPlaceActive() && pImp->bPlugInsActive ) + if ( !pIPClient->IsObjectInPlaceActive() && pImp->m_bPlugInsActive ) { // object in client is currently not active // check if the object wants to be activated always or when it becomes at least partially visible @@ -1844,7 +1852,7 @@ void SfxViewShell::CheckIPClient_Impl( SfxInPlaceClient *pIPClient, const Rectan } } } - else if ( !pImp->bPlugInsActive ) + else if (!pImp->m_bPlugInsActive) { // object in client is currently active and "Edit/Plugins" checkbox is selected // check if the object wants to be activated always or when it becomes at least partially visible @@ -1858,7 +1866,7 @@ void SfxViewShell::CheckIPClient_Impl( SfxInPlaceClient *pIPClient, const Rectan BOOL SfxViewShell::PlugInsActive() const { - return pImp->bPlugInsActive; + return pImp->m_bPlugInsActive; } //-------------------------------------------------------------------- @@ -1884,14 +1892,14 @@ void SfxViewShell::DiscardClients_Impl() SfxScrollingMode SfxViewShell::GetScrollingMode() const { - return pImp->eScroll; + return pImp->m_eScroll; } //-------------------------------------------------------------------- void SfxViewShell::SetScrollingMode( SfxScrollingMode eMode ) { - pImp->eScroll = eMode; + pImp->m_eScroll = eMode; } //-------------------------------------------------------------------- @@ -1958,7 +1966,7 @@ void SfxViewShell::MarginChanged() BOOL SfxViewShell::IsShowView_Impl() const { - return pImp->bIsShowView; + return pImp->m_bIsShowView; } //-------------------------------------------------------------------- @@ -1990,9 +1998,8 @@ SfxInPlaceClientList* SfxViewShell::GetIPClientList_Impl( BOOL bCreate ) const void SfxViewShell::SetController( SfxBaseController* pController ) { - pImp->pController = pController; - pImp->pController->acquire(); - pImp->bControllerSet = TRUE; + pImp->m_pController = pController; + pImp->m_bControllerSet = true; // there should be no old listener, but if there is one, it should be disconnected if ( pImp->xClipboardListener.is() ) @@ -2004,12 +2011,12 @@ void SfxViewShell::SetController( SfxBaseController* pController ) Reference < XController > SfxViewShell::GetController() { - return pImp->pController; + return pImp->m_pController.get(); } SfxBaseController* SfxViewShell::GetBaseController_Impl() const { - return pImp->pController; + return pImp->m_pController.get(); } void SfxViewShell::AddContextMenuInterceptor_Impl( const REFERENCE< XCONTEXTMENUINTERCEPTOR >& xInterceptor ) @@ -2054,6 +2061,7 @@ void Change( Menu* pMenu, SfxViewShell* pView ) if ( pSlot ) { pMenu->InsertItem( pSlot->GetSlotId(), pMenu->GetItemText( nId ), pMenu->GetItemBits( nId ), nPos ); + pMenu->SetItemCommand( pSlot->GetSlotId(), aCmd ); pMenu->RemoveItem( nPos+1 ); break; } @@ -2131,20 +2139,20 @@ void SfxViewShell::TakeOwnerShip_Impl() { // currently there is only one reason to take OwnerShip: a hidden frame is printed // so the ViewShell will check this on EndPrint (->prnmon.cxx) - pImp->bGotOwnerShip = TRUE; + pImp->m_bGotOwnership = true; } void SfxViewShell::TakeFrameOwnerShip_Impl() { // currently there is only one reason to take OwnerShip: a hidden frame is printed // so the ViewShell will check this on EndPrint (->prnmon.cxx) - pImp->bGotFrameOwnerShip = TRUE; + pImp->m_bGotFrameOwnership = true; } void SfxViewShell::CheckOwnerShip_Impl() { BOOL bSuccess = FALSE; - if( pImp->bGotOwnerShip ) + if (pImp->m_bGotOwnership) { com::sun::star::uno::Reference < com::sun::star::util::XCloseable > xModel( GetObjectShell()->GetModel(), com::sun::star::uno::UNO_QUERY ); @@ -2162,7 +2170,7 @@ void SfxViewShell::CheckOwnerShip_Impl() } } - if( !bSuccess && pImp->bGotFrameOwnerShip ) + if (!bSuccess && pImp->m_bGotFrameOwnership) { // document couldn't be closed or it shouldn't, now try at least to close the frame com::sun::star::uno::Reference < com::sun::star::util::XCloseable > xFrame( @@ -2182,19 +2190,23 @@ void SfxViewShell::CheckOwnerShip_Impl() long SfxViewShell::HandleNotifyEvent_Impl( NotifyEvent& rEvent ) { - if ( pImp->pController ) - return pImp->pController->HandleEvent_Impl( rEvent ); + if (pImp->m_pController.is()) + { + return pImp->m_pController->HandleEvent_Impl( rEvent ); + } return 0; } BOOL SfxViewShell::HasKeyListeners_Impl() { - return pImp->pController ? pImp->pController->HasKeyListeners_Impl() : FALSE; + return (pImp->m_pController.is()) + ? pImp->m_pController->HasKeyListeners_Impl() : FALSE; } BOOL SfxViewShell::HasMouseClickListeners_Impl() { - return pImp->pController ? pImp->pController->HasMouseClickListeners_Impl() : FALSE; + return (pImp->m_pController.is()) + ? pImp->m_pController->HasMouseClickListeners_Impl() : FALSE; } void SfxViewShell::SetAdditionalPrintOptions( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& rOpts ) |