diff options
Diffstat (limited to 'sw/source/ui')
72 files changed, 916 insertions, 976 deletions
diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx index 4a4de8b648b9..7698fe58c580 100644 --- a/sw/source/ui/app/appopt.cxx +++ b/sw/source/ui/app/appopt.cxx @@ -35,6 +35,8 @@ #include <cmdid.h> // Funktion-Ids #endif +#include <com/sun/star/i18n/ScriptType.hpp> + #define _SVSTDARR_STRINGSDTOR #include <svtools/svstdarr.hxx> @@ -54,6 +56,7 @@ #include <svx/optgrid.hxx> #include <svx/svxdlg.hxx> #include <svx/dialogs.hrc> +#include <i18npool/mslangid.hxx> #include <fontcfg.hxx> #include <optload.hxx> #include <optcomp.hxx> @@ -191,19 +194,25 @@ SfxItemSet* SwModule::CreateItemSet( USHORT nId ) pRet->Put(SwPtrItem(FN_PARAM_PRINTER, pPrt));*/ SvtLinguConfig aLinguCfg; + Locale aLocale; + LanguageType nLang; + + using namespace ::com::sun::star::i18n::ScriptType; Any aLang = aLinguCfg.GetProperty(C2U("DefaultLocale")); - Locale aLocale; aLang >>= aLocale; - pRet->Put(SvxLanguageItem(SvxLocaleToLanguage( aLocale ), SID_ATTR_LANGUAGE)); + nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aLocale), LATIN); + pRet->Put(SvxLanguageItem(nLang, SID_ATTR_LANGUAGE)); aLang = aLinguCfg.GetProperty(C2U("DefaultLocale_CJK")); aLang >>= aLocale; - pRet->Put(SvxLanguageItem(SvxLocaleToLanguage( aLocale ), SID_ATTR_CHAR_CJK_LANGUAGE)); + nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aLocale), ASIAN); + pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CJK_LANGUAGE)); aLang = aLinguCfg.GetProperty(C2U("DefaultLocale_CTL")); aLang >>= aLocale; - pRet->Put(SvxLanguageItem(SvxLocaleToLanguage( aLocale ), SID_ATTR_CHAR_CTL_LANGUAGE)); + nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aLocale), COMPLEX); + pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CTL_LANGUAGE)); } if(bTextDialog) pRet->Put(SwPtrItem(FN_PARAM_STDFONTS, GetStdFontConfig())); diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index dd5ecb185c2d..06289c10f38a 100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -1083,15 +1083,10 @@ void SwDocShell::GetState(SfxItemSet& rSet) break; case SID_SOURCEVIEW: { - if(IsLoading()) - rSet.DisableItem(nWhich); - else - { - SfxViewShell* pCurrView = GetView() ? (SfxViewShell*)GetView() - : SfxViewShell::Current(); - BOOL bSourceView = 0 != PTR_CAST(SwSrcView, pCurrView); - rSet.Put(SfxBoolItem(SID_SOURCEVIEW, bSourceView)); - } + SfxViewShell* pCurrView = GetView() ? (SfxViewShell*)GetView() + : SfxViewShell::Current(); + BOOL bSourceView = 0 != PTR_CAST(SwSrcView, pCurrView); + rSet.Put(SfxBoolItem(SID_SOURCEVIEW, bSourceView)); } break; case SID_HTML_MODE: @@ -1116,18 +1111,10 @@ void SwDocShell::GetState(SfxItemSet& rSet) case SID_BROWSER_MODE: case FN_PRINT_LAYOUT: { - SfxViewShell* pViewShell = SfxViewShell::Current(); - BOOL bDisable = 0 != PTR_CAST(SwPagePreView, pViewShell) || - 0 != PTR_CAST(SwSrcView, pViewShell); - if (bDisable) - rSet.DisableItem( nWhich ); - else - { - sal_Bool bState = GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE); - if(FN_PRINT_LAYOUT == nWhich) - bState = !bState; - rSet.Put( SfxBoolItem( nWhich, bState)); - } + sal_Bool bState = GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE); + if(FN_PRINT_LAYOUT == nWhich) + bState = !bState; + rSet.Put( SfxBoolItem( nWhich, bState)); } break; @@ -1337,44 +1324,42 @@ uno::Reference< frame::XController > /* -----------------------------12.02.01 12:08-------------------------------- ---------------------------------------------------------------------------*/ +static const char* pEventNames[] = +{ + "OnPageCountChange", + "OnMailMerge", + "OnMailMergeFinished", + "OnFieldMerge", + "OnFieldMergeFinished", + "OnLayoutFinished" +}; + Sequence< OUString > SwDocShell::GetEventNames() { Sequence< OUString > aRet = SfxObjectShell::GetEventNames(); sal_Int32 nLen = aRet.getLength(); - aRet.realloc(nLen + 2); + aRet.realloc(nLen + 6); OUString* pNames = aRet.getArray(); - pNames[nLen++] = OUString::createFromAscii("OnMailMerge"); - pNames[nLen] = OUString::createFromAscii("OnPageCountChange"); + pNames[nLen++] = GetEventName(0); + pNames[nLen++] = GetEventName(1); + pNames[nLen++] = GetEventName(2); + pNames[nLen++] = GetEventName(3); + pNames[nLen++] = GetEventName(4); + pNames[nLen] = GetEventName(5); + return aRet; } -/* -void SwTmpPersist::FillClass( SvGlobalName * pClassName, - ULONG * pClipFormat, - String * pAppName, - String * pLongUserName, - String * pUserName, - sal_Int32 nFileFormat ) const -{ - pDShell->SwDocShell::FillClass( pClassName, pClipFormat, pAppName, - pLongUserName, pUserName, nFileFormat ); -} -BOOL SwTmpPersist::Save() -{ - if( SaveChilds() ) - return SvPersist::Save(); - return FALSE; -} +static sal_Int32 nEvents=13; -BOOL SwTmpPersist::SaveCompleted( SvStorage * pStor ) +rtl::OUString SwDocShell::GetEventName( sal_Int32 nIndex ) { - if( SaveCompletedChilds( pStor ) ) - return SvPersist::SaveCompleted( pStor ); - return FALSE; -} */ + if ( nIndex<nEvents ) + return ::rtl::OUString::createFromAscii(pEventNames[nIndex]); + return rtl::OUString(); +} const ::sfx2::IXmlIdRegistry* SwDocShell::GetXmlIdRegistry() const { return pDoc ? &pDoc->GetXmlIdRegistry() : 0; } - diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index 182bda09d7b8..3fd1e879b063 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -943,10 +943,10 @@ void SwDocShell::Execute(SfxRequest& rReq) bDone = TRUE; SfxEventConfiguration* pEvent = SFX_APP()->GetEventConfig(); SvxMacro aMac(aEmptyStr, aEmptyStr, STARBASIC); - pEvent->ConfigureEvent(SFX_EVENT_OPENDOC, aMac, this); - pEvent->ConfigureEvent(SFX_EVENT_CLOSEDOC, aMac, this); - pEvent->ConfigureEvent(SFX_EVENT_ACTIVATEDOC, aMac, this); - pEvent->ConfigureEvent(SFX_EVENT_DEACTIVATEDOC, aMac, this); + pEvent->ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_OPENDOC ), aMac, this); + pEvent->ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_PREPARECLOSEDOC ), aMac, this); + pEvent->ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_ACTIVATEDOC ), aMac, this); + pEvent->ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_DEACTIVATEDOC ), aMac, this); ReloadFromHtml(aTempFile.GetURL(), pSrcView); nSlot = 0; } @@ -983,6 +983,8 @@ void SwDocShell::Execute(SfxRequest& rReq) //pSavePrinter darf nicht wieder geloescht werden } pViewFrm->GetBindings().SetState(SfxBoolItem(SID_SOURCEVIEW, nSlot == SID_VIEWSHELL2)); + pViewFrm->GetBindings().Invalidate( SID_BROWSER_MODE ); + pViewFrm->GetBindings().Invalidate( FN_PRINT_LAYOUT ); } break; case SID_GET_COLORTABLE: @@ -1780,7 +1782,10 @@ void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView ) SwView* pTempView = _pView ? _pView : (SwView*)GetView(); if( pTempView ) { - pTempView->GetViewFrame()->GetBindings().Invalidate(FN_SHADOWCURSOR); + SfxBindings& rBind = pTempView->GetViewFrame()->GetBindings(); + rBind.Invalidate(FN_SHADOWCURSOR); + rBind.Invalidate(SID_BROWSER_MODE); + rBind.Invalidate(FN_PRINT_LAYOUT); if( !GetDoc()->getPrinter( false ) ) { @@ -1793,8 +1798,8 @@ void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView ) GetDoc()->CheckDefaultPageFmt(); // <-- - //Wenn wir die BrowseView einschalten, darf es nur diese eine - //Sicht auf das Dokument geben, alle anderen werden geschlossen. + // Currently there can be only one view (layout) if the document is viewed in Web layout + // So if there are more views we are in print layout and for toggling to Web layout all other views must be closed SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, 0, FALSE); do { if( pTmpFrm != pTempView->GetViewFrame() ) diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx index e355dcba5e64..630d836c785b 100644 --- a/sw/source/ui/app/docshini.cxx +++ b/sw/source/ui/app/docshini.cxx @@ -37,6 +37,7 @@ #ifndef _SVX_DIALOGS_HRC #include <svx/dialogs.hrc> #endif +#include <i18npool/mslangid.hxx> #include <sot/storinfo.hxx> #include <sot/storage.hxx> #include <svtools/zforlist.hxx> @@ -58,6 +59,7 @@ #endif #include <linguistic/lngprops.hxx> #include <com/sun/star/document/UpdateDocMode.hpp> +#include <com/sun/star/i18n/ScriptType.hpp> #include <rtl/logfile.hxx> #include <sfx2/docfilt.hxx> #include <svx/xtable.hxx> @@ -791,9 +793,9 @@ void SwDocShell::SubInitNew() SvtLinguConfig().GetOptions( aLinguOpt ); - sal_Int16 nVal = aLinguOpt.nDefaultLanguage, - eCJK = aLinguOpt.nDefaultLanguage_CJK, - eCTL = aLinguOpt.nDefaultLanguage_CTL; + sal_Int16 nVal = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN), + eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN), + eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX); aDfltSet.Put( SvxLanguageItem( nVal, RES_CHRATR_LANGUAGE ) ); aDfltSet.Put( SvxLanguageItem( eCJK, RES_CHRATR_CJK_LANGUAGE ) ); aDfltSet.Put( SvxLanguageItem( eCTL, RES_CHRATR_CTL_LANGUAGE ) ); diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx index 41814d006339..7841176d47e1 100644 --- a/sw/source/ui/app/docstyle.cxx +++ b/sw/source/ui/app/docstyle.cxx @@ -37,6 +37,7 @@ #include <hintids.hxx> #include <svtools/itemiter.hxx> #include <svtools/eitem.hxx> +#include <svtools/syslocale.hxx> #include <svx/boxitem.hxx> #include <svx/numitem.hxx> // --> OD 2008-02-13 #newlistlevelattrs# @@ -609,7 +610,7 @@ String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit) { IntlWrapper aIntlWrapper( ::comphelper::getProcessServiceFactory(), - GetAppLocaleData().getLocale()); + SvtSysLocale().GetLocaleData().getLocale()); String sPlus(String::CreateFromAscii(" + ")); if ( SFX_STYLE_FAMILY_PAGE == nFamily ) diff --git a/sw/source/ui/app/mn.src b/sw/source/ui/app/mn.src index e13d2418cc58..c58eaa369fc0 100644 --- a/sw/source/ui/app/mn.src +++ b/sw/source/ui/app/mn.src @@ -441,26 +441,26 @@ {\ Identifier = FN_DELETE_NOTE ;\ HelpID = FN_DELETE_NOTE ;\ - Text [ en-US ] = "Delete ~Note" ;\ + Text [ en-US ] = "Delete ~Comment" ;\ };\ MenuItem\ {\ Identifier = FN_DELETE_NOTE_AUTHOR ;\ HelpID = FN_DELETE_NOTE_AUTHOR ;\ - Text [ en-US ] = "Delete ~All Notes by $1" ;\ + Text [ en-US ] = "Delete ~All Comments by $1" ;\ };\ MenuItem\ {\ Identifier = FN_DELETE_ALL_NOTES ;\ HelpID = FN_DELETE_ALL_NOTES ;\ - Text [ en-US ] = "~Delete All Notes" ;\ + Text [ en-US ] = "~Delete All Comments" ;\ };\ /* MenuItem\ {\ Identifier = FN_HIDE_NOTE ;\ HelpID = FN_HIDE_NOTE ;\ - Text [ en-US ] = "~Hide note" ;\ + Text [ en-US ] = "~Hide comment" ;\ };\ MenuItem\ {\ @@ -472,7 +472,7 @@ {\ Identifier = FN_HIDE_ALL_NOTES ;\ HelpID = FN_HIDE_ALL_NOTES ;\ - Text [ en-US ] = "Hide all ~notes" ;\ + Text [ en-US ] = "Hide all ~comments" ;\ }; */ @@ -956,6 +956,10 @@ Menu MN_GRF_POPUPMENU { MN_ALIGN_FRAME MN_MOUSE_FRAME_WITH_CONTOUR + // --> OD 2009-07-14 #i73249# + SEPARATOR ; + MN_TITLE_DESCRIPTION_SHAPE + // <-- SEPARATOR ; MenuItem { @@ -989,6 +993,10 @@ Menu MN_OLE_POPUPMENU { MN_ALIGN_FRAME MN_MOUSE_FRAME_WITH_CONTOUR + // --> OD 2009-07-14 #i73249# + SEPARATOR ; + MN_TITLE_DESCRIPTION_SHAPE + // <-- SEPARATOR ; MenuItem { @@ -1013,6 +1021,10 @@ Menu MN_FRM_POPUPMENU { MN_ALIGN_FRAME MN_MOUSE_FRAME_WITHOUT_CONTOUR + // --> OD 2009-07-07 #i73249# + SEPARATOR ; + MN_TITLE_DESCRIPTION_SHAPE + // <-- SEPARATOR ; MN_FRM MN_FRM_CAPTION_ITEM diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx index 694c2514ef93..c84273770667 100644 --- a/sw/source/ui/app/swmodule.cxx +++ b/sw/source/ui/app/swmodule.cxx @@ -221,11 +221,6 @@ SwModule::SwModule( SfxObjectFactory* pWebFact, ERRCODE_AREA_SW_END, pSwResMgr ); - SfxEventConfiguration::RegisterEvent(SW_EVENT_MAIL_MERGE, SW_RES(STR_PRINT_MERGE_MACRO), String::CreateFromAscii("OnMailMerge")); - SfxEventConfiguration::RegisterEvent(SW_EVENT_MAIL_MERGE_END, SW_RES(STR_PRINT_MERGE_MACRO), String::CreateFromAscii("OnMailMergeFinished")); - SfxEventConfiguration::RegisterEvent(SW_EVENT_FIELD_MERGE, String(), String::CreateFromAscii("OnFieldMerge")); - SfxEventConfiguration::RegisterEvent(SW_EVENT_FIELD_MERGE_FINISHED, String(), String::CreateFromAscii("OnFieldMergeFinished")); - SfxEventConfiguration::RegisterEvent(SW_EVENT_PAGE_COUNT, SW_RES(STR_PAGE_COUNT_MACRO), String::CreateFromAscii("OnPageCountChange")); pModuleConfig = new SwModuleOptions; //Die brauchen wie sowieso diff --git a/sw/source/ui/cctrl/actctrl.cxx b/sw/source/ui/cctrl/actctrl.cxx index 4fbbbb9048bf..dfb2ef0ae4e6 100644 --- a/sw/source/ui/cctrl/actctrl.cxx +++ b/sw/source/ui/cctrl/actctrl.cxx @@ -71,6 +71,15 @@ long NumEditAction::Notify( NotifyEvent& rNEvt ) Beschreibung: KeyInput fuer ShortName - Edits ohne Spaces ------------------------------------------------------------------------*/ +NoSpaceEdit::NoSpaceEdit( Window* pParent, const ResId& rResId) + : Edit(pParent, rResId), + sForbiddenChars(String::CreateFromAscii(" ")) +{ +} + +NoSpaceEdit::~NoSpaceEdit() +{ +} void NoSpaceEdit::KeyInput(const KeyEvent& rEvt) { diff --git a/sw/source/ui/config/fontcfg.cxx b/sw/source/ui/config/fontcfg.cxx index 14793b511c6f..34ffa8f215b9 100644 --- a/sw/source/ui/config/fontcfg.cxx +++ b/sw/source/ui/config/fontcfg.cxx @@ -33,10 +33,12 @@ #include <fontcfg.hxx> +#include <i18npool/mslangid.hxx> #include <vcl/outdev.hxx> #include <svtools/lingucfg.hxx> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/i18n/ScriptType.hpp> #include <swtypes.hxx> #include <unomid.h> @@ -116,9 +118,10 @@ SwStdFontConfig::SwStdFontConfig() : SvtLinguConfig().GetOptions( aLinguOpt ); - sal_Int16 eWestern = aLinguOpt.nDefaultLanguage, - eCJK = aLinguOpt.nDefaultLanguage_CJK, - eCTL = aLinguOpt.nDefaultLanguage_CTL; + sal_Int16 eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN), + eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN), + eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX); + for(sal_Int16 i = 0; i < DEF_FONT_COUNT; i++) { sDefaultFonts[i] = GetDefaultFor(i, @@ -163,9 +166,10 @@ void SwStdFontConfig::Commit() SvtLinguConfig().GetOptions( aLinguOpt ); - sal_Int16 eWestern = aLinguOpt.nDefaultLanguage, - eCJK = aLinguOpt.nDefaultLanguage_CJK, - eCTL = aLinguOpt.nDefaultLanguage_CTL; + sal_Int16 eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN), + eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN), + eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX); + for(sal_uInt16 nProp = 0; nProp < sal::static_int_cast< sal_uInt16, sal_Int32 >( aNames.getLength() ); nProp++) @@ -198,9 +202,10 @@ BOOL SwStdFontConfig::IsFontDefault(USHORT nFontType) const SvtLinguConfig().GetOptions( aLinguOpt ); - sal_Int16 eWestern = aLinguOpt.nDefaultLanguage, - eCJK = aLinguOpt.nDefaultLanguage_CJK, - eCTL = aLinguOpt.nDefaultLanguage_CTL; + sal_Int16 eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN), + eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN), + eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX); + String sDefFont(GetDefaultFor(FONT_STANDARD, eWestern)); String sDefFontCJK(GetDefaultFor(FONT_STANDARD_CJK, eCJK)); String sDefFontCTL(GetDefaultFor(FONT_STANDARD_CTL, eCTL)); @@ -320,9 +325,11 @@ void SwStdFontConfig::ChangeInt( USHORT nFontType, sal_Int32 nHeight ) { SvtLinguOptions aLinguOpt; SvtLinguConfig().GetOptions( aLinguOpt ); - sal_Int16 eWestern = aLinguOpt.nDefaultLanguage, - eCJK = aLinguOpt.nDefaultLanguage_CJK, - eCTL = aLinguOpt.nDefaultLanguage_CTL; + + sal_Int16 eWestern = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN), + eCJK = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, ::com::sun::star::i18n::ScriptType::ASIAN), + eCTL = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, ::com::sun::star::i18n::ScriptType::COMPLEX); + // #i92090# default height value sets back to -1 const sal_Int32 nDefaultHeight = GetDefaultHeightFor(nFontType, lcl_LanguageOfType(nFontType, eWestern, eCJK, eCTL)); const bool bIsDefaultHeight = nHeight == nDefaultHeight; diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src index 96719f17bd58..41ba789789ff 100644 --- a/sw/source/ui/config/optdlg.src +++ b/sw/source/ui/config/optdlg.src @@ -173,7 +173,7 @@ TabPage TP_CONTENT_OPT { Pos = MAP_APPFONT ( 12 , 119 ) ; Size = MAP_APPFONT ( 108 , 10 ) ; - Text [ en-US ] = "~Notes" ; + Text [ en-US ] = "~Comments" ; }; FixedLine FL_SETTINGS { @@ -323,7 +323,7 @@ TabPage TP_OPTPRINT_PAGE { Pos = MAP_APPFONT ( 180 , 27 ) ; Size = MAP_APPFONT ( 74 , 10 ) ; - Text [ en-US ] = "Notes ~only" ; + Text [ en-US ] = "Comments ~only" ; }; RadioButton RB_END { @@ -347,7 +347,7 @@ TabPage TP_OPTPRINT_PAGE { Pos = MAP_APPFONT ( 174 , 3 ) ; Size = MAP_APPFONT ( 80 , 8 ) ; - Text [ en-US ] = "Notes" ; + Text [ en-US ] = "Comments" ; Group = TRUE ; }; FixedLine FL_4 diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 0a9414ffeac3..70db2cdf008b 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -782,7 +782,9 @@ IMPL_LINK( SwCaptionOptPage, ShowEntryHdl, SvxCheckListBox *, EMPTYARG ) break; } aPosBox.SelectEntryPos(pOpt->GetPos()); - aPosBox.Enable( pOpt->GetObjType() != GRAPHIC_CAP && aPosText.IsEnabled() ); + aPosBox.Enable( pOpt->GetObjType() != GRAPHIC_CAP && + pOpt->GetObjType() != OLE_CAP && + aPosText.IsEnabled() ); aPosBox.SelectEntryPos(pOpt->GetPos()); USHORT nLevelPos = ( pOpt->GetLevel() < MAXLEVEL ) ? pOpt->GetLevel() + 1 : 0; diff --git a/sw/source/ui/config/usrpref.cxx b/sw/source/ui/config/usrpref.cxx index e4b232269cc5..1170f3506b31 100644 --- a/sw/source/ui/config/usrpref.cxx +++ b/sw/source/ui/config/usrpref.cxx @@ -33,7 +33,7 @@ #include <tools/stream.hxx> - +#include <svtools/syslocale.hxx> #include "swtypes.hxx" #include "hintids.hxx" @@ -72,7 +72,7 @@ SwMasterUsrPref::SwMasterUsrPref(BOOL bWeb) : aCursorConfig(*this), pWebColorConfig(bWeb ? new SwWebColorConfig(*this) : 0) { - MeasurementSystem eSystem = GetAppLocaleData().getMeasurementSystemEnum(); + MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); eUserMetric = MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH; eHScrollMetric = eUserMetric; eVScrollMetric = eUserMetric; diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx index af43528016f9..661a73f312ad 100644 --- a/sw/source/ui/config/viewopt.cxx +++ b/sw/source/ui/config/viewopt.cxx @@ -58,6 +58,7 @@ #include <crstate.hxx> #include <svtools/colorcfg.hxx> #include <svtools/accessibilityoptions.hxx> +#include <svtools/syslocale.hxx> #include <svx/acorrcfg.hxx> @@ -237,7 +238,7 @@ SwViewOption::SwViewOption() : nCore2Options = VIEWOPT_CORE2_BLACKFONT | VIEWOPT_CORE2_HIDDENPARA; nUIOptions = VIEWOPT_2_MODIFIED | VIEWOPT_2_GRFKEEPZOOM |VIEWOPT_2_ANY_RULER; - if(MEASURE_METRIC != GetAppLocaleData().getMeasurementSystemEnum()) + if(MEASURE_METRIC != SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()) aSnapSize.Width() = aSnapSize.Height() = 720; // 1/2" else aSnapSize.Width() = aSnapSize.Height() = 567; // 1 cm diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 07e9b0a0eec0..cb815a93f1a6 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -1131,7 +1131,9 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, for( n = 0; n < nCols; ++n ) { if( aRbHeadlColnms.IsChecked() ) - rSh.SwEditShell::Insert( aColFlds[ n ]->sColumn ); + { + rSh.SwEditShell::Insert2( aColFlds[ n ]->sColumn ); + } rSh.GoNextCell(); } } @@ -1227,7 +1229,9 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, { rtl::OUString sVal = xColumn->getString(); if(!xColumn->wasNull()) - rSh.SwEditShell::Insert( sVal ); + { + rSh.SwEditShell::Insert2( sVal ); + } } } catch(Exception& diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index 93fad7cb699d..603af1c31111 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -701,7 +701,7 @@ void SwNewDBMgr::ImportDBEntry(SwWrtShell* pSh) if (i < nLength - 1) sStr += '\t'; } - pSh->SwEditShell::Insert(sStr); + pSh->SwEditShell::Insert2(sStr); pSh->SwFEShell::SplitNode(); // Zeilenvorschub } } @@ -932,9 +932,9 @@ BOOL SwNewDBMgr::MergePrint( SwView& rView, do { nStartRow = pImpl->pMergeData ? pImpl->pMergeData->xResultSet->getRow() : 0; { - SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE, pSh->GetView().GetViewFrame()->GetObjectShell())); + SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_FIELD_MERGE), pSh->GetView().GetViewFrame()->GetObjectShell())); pSh->ViewShell::UpdateFlds(); - SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, pSh->GetView().GetViewFrame()->GetObjectShell())); + SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, SwDocShell::GetEventName(STR_SW_EVENT_FIELD_MERGE_FINISHED), pSh->GetView().GetViewFrame()->GetObjectShell())); ++rOpt.nMergeAct; // launch MailMergeEvent if required @@ -1455,9 +1455,9 @@ BOOL SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, SwDoc* pWorkDoc = ((SwDocShell*)(&xWorkDocSh))->GetDoc(); SwNewDBMgr* pOldDBMgr = pWorkDoc->GetNewDBMgr(); pWorkDoc->SetNewDBMgr( this ); - SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE, xWorkDocSh)); + SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_FIELD_MERGE), xWorkDocSh)); pWorkDoc->UpdateFlds(NULL, false); - SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, xWorkDocSh)); + SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, SwDocShell::GetEventName(STR_SW_EVENT_FIELD_MERGE_FINISHED), xWorkDocSh)); // alle versteckten Felder/Bereiche entfernen pWorkDoc->RemoveInvisibleContent(); @@ -2858,7 +2858,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh, aDescriptor[daCursor] <<= xResSet; SfxObjectShellRef xDocShell = rSh.GetView().GetViewFrame()->GetObjectShell(); - SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, xDocShell)); + SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), xDocShell)); { //copy rSh to aTempFile ::rtl::OUString sTempURL; @@ -2924,7 +2924,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh, //remove the temporary file SWUnoHelper::UCB_DeleteFile( sTempURL ); } - SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE_END, rSh.GetView().GetViewFrame()->GetObjectShell())); + SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE_END, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE_END), rSh.GetView().GetViewFrame()->GetObjectShell())); // reset the cursor inside xResSet = NULL; @@ -3248,18 +3248,21 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, SwWrtShell& rWorkShell = pWorkView->GetWrtShell(); pWorkView->AttrChangedNotify( &rWorkShell );//Damit SelectShell gerufen wird. - // merge the data - SwDoc* pWorkDoc = rWorkShell.GetDoc(); - SwNewDBMgr* pWorkDBMgr = pWorkDoc->GetNewDBMgr(); - pWorkDoc->SetNewDBMgr( this ); - pWorkDoc->EmbedAllLinks(); - if(UNDO_UI_DELETE_INVISIBLECNTNT == rWorkShell.GetUndoIds()) - rWorkShell.Undo(); - // create a layout - rWorkShell.CalcLayout(); - SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE, rWorkShell.GetView().GetViewFrame()->GetObjectShell())); + // merge the data + SwDoc* pWorkDoc = rWorkShell.GetDoc(); + SwNewDBMgr* pWorkDBMgr = pWorkDoc->GetNewDBMgr(); + pWorkDoc->SetNewDBMgr( this ); + pWorkDoc->EmbedAllLinks(); + if(UNDO_UI_DELETE_INVISIBLECNTNT == rWorkShell.GetUndoIds()) + rWorkShell.Undo(); + // #i69485# lock fields to prevent access to the result set while calculating layout
+ rWorkShell.LockExpFlds();
+ // create a layout + rWorkShell.CalcLayout(); + rWorkShell.UnlockExpFlds(); + SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_FIELD_MERGE), rWorkShell.GetView().GetViewFrame()->GetObjectShell())); rWorkShell.ViewShell::UpdateFlds(); - SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, rWorkShell.GetView().GetViewFrame()->GetObjectShell())); + SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, SwDocShell::GetEventName(STR_SW_EVENT_FIELD_MERGE_FINISHED), rWorkShell.GetView().GetViewFrame()->GetObjectShell())); // strip invisible content and convert fields to text rWorkShell.RemoveInvisibleContent(); @@ -3284,11 +3287,13 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, String sNewPageDescName = lcl_FindUniqueName(pTargetShell, sStartingPageDesc, nDocNo ); pTargetShell->GetDoc()->MakePageDesc( sNewPageDescName ); SwPageDesc* pTargetPageDesc = pTargetShell->FindPageDescByName( sNewPageDescName ); - if(pSourcePageDesc && pTargetPageDesc) + const SwPageDesc* pWorkPageDesc = rWorkShell.FindPageDescByName( sStartingPageDesc ); + + if(pWorkPageDesc && pTargetPageDesc) { - pTargetDoc->CopyPageDesc( *pSourcePageDesc, *pTargetPageDesc, sal_False ); + pTargetDoc->CopyPageDesc( *pWorkPageDesc, *pTargetPageDesc, sal_False ); sModifiedStartingPageDesc = sNewPageDescName; - lcl_CopyFollowPageDesc( *pTargetShell, *pSourcePageDesc, *pTargetPageDesc, nDocNo ); + lcl_CopyFollowPageDesc( *pTargetShell, *pWorkPageDesc, *pTargetPageDesc, nDocNo ); } } if(nDocNo == 1 || bPageStylesWithHeaderFooter) @@ -3396,4 +3401,3 @@ void SwConnectionDisposedListener_Impl::disposing( const EventObject& rSource ) } } } - diff --git a/sw/source/ui/dbui/mailmergehelper.cxx b/sw/source/ui/dbui/mailmergehelper.cxx index 0fff9f762131..0423137cc3c3 100644 --- a/sw/source/ui/dbui/mailmergehelper.cxx +++ b/sw/source/ui/dbui/mailmergehelper.cxx @@ -627,8 +627,16 @@ SwMergeAddressItem SwAddressIterator::Next() aRet.bIsColumn = true; xub_StrLen nClose = sAddress.Search('>'); DBG_ASSERT(nClose != STRING_NOTFOUND, "closing '>' not found"); - aRet.sText = sAddress.Copy(1, nClose - 1); - sAddress.Erase(0, nClose + 1); + if( nClose != STRING_NOTFOUND ) + { + aRet.sText = sAddress.Copy(1, nClose - 1); + sAddress.Erase(0, nClose + 1); + } + else + { + aRet.sText = sAddress.Copy(1, 1); + sAddress.Erase(0, 1); + } } else { diff --git a/sw/source/ui/dbui/makefile.mk b/sw/source/ui/dbui/makefile.mk index b1aa16f694c3..40d6807c2ead 100644 --- a/sw/source/ui/dbui/makefile.mk +++ b/sw/source/ui/dbui/makefile.mk @@ -79,6 +79,7 @@ EXCEPTIONSFILES= \ $(SLO)$/mmaddressblockpage.obj \ $(SLO)$/mmconfigitem.obj \ $(SLO)$/mmlayoutpage.obj \ + $(SLO)$/mmgreetingspage.obj \ $(SLO)$/mmoutputpage.obj SLOFILES = \ diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx index e2fcf188a3b3..03bd61021306 100644 --- a/sw/source/ui/dbui/mmgreetingspage.cxx +++ b/sw/source/ui/dbui/mmgreetingspage.cxx @@ -42,6 +42,7 @@ #include <vcl/msgbox.hxx> #include <mmgreetingspage.hrc> #include <dbui.hrc> +#include <com/sun/star/sdb/XColumn.hpp> #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <helpid.h> @@ -117,6 +118,7 @@ IMPL_LINK(SwGreetingsHandler, IndividualHdl_Impl, CheckBox*, EMPTYARG) m_pWizard->UpdateRoadmap(); m_pWizard->enableButtons(WZB_NEXT, m_pWizard->isStateEnabled(MM_PREPAREMERGEPAGE)); } + UpdatePreview(); return 0; } /*-- 30.04.2004 10:42:57--------------------------------------------------- @@ -133,12 +135,12 @@ IMPL_LINK(SwGreetingsHandler, GreetingHdl_Impl, PushButton*, pButton) { ListBox* pToInsert = pButton == m_pMalePB ? m_pMaleLB : m_pFemaleLB; pToInsert->SelectEntryPos(pToInsert->InsertEntry(pDlg->GetAddress())); - UpdatePreview(); if(m_bIsTabPage) { m_pWizard->UpdateRoadmap(); m_pWizard->enableButtons(WZB_NEXT, m_pWizard->isStateEnabled(MM_PREPAREMERGEPAGE)); } + UpdatePreview(); } delete pDlg; return 0; @@ -182,9 +184,54 @@ IMPL_LINK(SwMailMergeGreetingsPage, GreetingSelectHdl_Impl, ListBox*, EMPTYARG) -----------------------------------------------------------------------*/ void SwMailMergeGreetingsPage::UpdatePreview() { - String sPreview = m_aFemaleLB.GetSelectEntry(); - sPreview += '\n'; - sPreview += m_aMaleLB.GetSelectEntry(); + //find out which type of greeting should be selected: + bool bFemale = false; + bool bNoValue = !m_pFemaleColumnLB->IsEnabled(); + if( !bNoValue ) + { + ::rtl::OUString sFemaleValue = m_aFemaleFieldCB.GetText(); + ::rtl::OUString sFemaleColumn = m_aFemaleColumnLB.GetSelectEntry(); + Reference< sdbcx::XColumnsSupplier > xColsSupp( m_pWizard->GetConfigItem().GetResultSet(), UNO_QUERY); + Reference < container::XNameAccess> xColAccess = xColsSupp.is() ? xColsSupp->getColumns() : 0; + if(sFemaleValue.getLength() && sFemaleColumn.getLength() && + xColAccess.is() && + xColAccess->hasByName(sFemaleColumn)) + { + //get the content and exchange it in the address string + Any aCol = xColAccess->getByName(sFemaleColumn); + Reference< sdb::XColumn > xColumn; + aCol >>= xColumn; + if(xColumn.is()) + { + try + { + ::rtl::OUString sFemaleColumnValue = xColumn->getString(); + bFemale = sFemaleColumnValue == sFemaleValue; + //bNoValue = !sFemaleColumnValue.getLength(); + if( !bNoValue ) + { + //no last name value marks the greeting also als neutral + SwMailMergeConfigItem& rConfig = m_pWizard->GetConfigItem(); + ::rtl::OUString sLastNameColumn = rConfig.GetAssignedColumn(MM_PART_LASTNAME); + if ( xColAccess->hasByName(sLastNameColumn) ) + { + aCol = xColAccess->getByName(sLastNameColumn); + aCol >>= xColumn; + ::rtl::OUString sLastNameColumnValue = xColumn->getString(); + bNoValue = !sLastNameColumnValue.getLength(); + } + } + } + catch( sdbc::SQLException& ) + { + DBG_ERROR("SQLException caught"); + } + } + } + } + + String sPreview = bFemale ? m_aFemaleLB.GetSelectEntry() : + bNoValue ? m_aNeutralCB.GetText() : m_aMaleLB.GetSelectEntry(); sPreview = SwAddressPreview::FillData(sPreview, m_pWizard->GetConfigItem()); m_aPreviewWIN.SetAddress(sPreview); @@ -284,6 +331,12 @@ SwMailMergeGreetingsPage::SwMailMergeGreetingsPage( SwMailMergeWizard* _pParent) Link aLBoxLink = LINK(this, SwMailMergeGreetingsPage, GreetingSelectHdl_Impl); m_aFemaleLB.SetSelectHdl(aLBoxLink); m_aMaleLB.SetSelectHdl(aLBoxLink); + m_aFemaleColumnLB.SetSelectHdl(aLBoxLink); + m_aFemaleFieldCB.SetSelectHdl(aLBoxLink); + m_aFemaleFieldCB.SetModifyHdl(aLBoxLink); + m_aNeutralCB.SetSelectHdl(aLBoxLink); + m_aNeutralCB.SetModifyHdl(aLBoxLink); + Link aDataLink = LINK(this, SwMailMergeGreetingsPage, InsertDataHdl_Impl); m_aPrevSetIB.SetClickHdl(aDataLink); m_aNextSetIB.SetClickHdl(aDataLink); @@ -348,13 +401,9 @@ sal_Bool SwMailMergeGreetingsPage::commitPage( CommitPageReason ) { const SwDBData& rDBData = rConfig.GetCurrentDBData(); Sequence< ::rtl::OUString> aAssignment = rConfig.GetColumnAssignment( rDBData ); - sal_Int32 nPos = m_aFemaleColumnLB.GetSelectEntryPos(); if(aAssignment.getLength() <= MM_PART_GENDER) aAssignment.realloc(MM_PART_GENDER + 1); - if( nPos > 0 ) - aAssignment[MM_PART_GENDER] = m_aFemaleColumnLB.GetSelectEntry(); - else - aAssignment[MM_PART_GENDER] = ::rtl::OUString(); + aAssignment[MM_PART_GENDER] = m_aFemaleColumnLB.GetSelectEntry(); rConfig.SetColumnAssignment( rDBData, aAssignment ); } if(m_aFemaleFieldCB.GetText() != m_aFemaleFieldCB.GetSavedValue()) diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index cd04ebeb2e59..ddb37e3c8eeb 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -614,8 +614,6 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig sCondition += String(rFemaleGenderValue); sCondition.AppendAscii("\" OR NOT "); sCondition += String(sNameColumnBase); - sHideParagraphsExpression += '!'; - sHideParagraphsExpression += sNameColumnBase; break; case SwMailMergeConfigItem::NEUTRAL: sCondition = sNameColumnBase; diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index 72fc1e122a8e..eb1f75d57979 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -1000,14 +1000,14 @@ IMPL_LINK(SwMailMergeOutputPage, PrintHdl_Impl, PushButton*, EMPTYARG) } SfxObjectShell* pObjSh = pTargetView->GetViewFrame()->GetObjectShell(); - SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, pObjSh)); + SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), pObjSh)); rSh.GetNewDBMgr()->SetMergeType( DBMGR_MERGE_DOCUMENTS ); SfxDispatcher *pDis = pTargetView->GetViewFrame()->GetDispatcher(); SfxBoolItem aMergeSilent(SID_SILENT, sal_False); m_pWizard->enableButtons(WZB_CANCEL, sal_False); pDis->Execute(SID_PRINTDOCDIRECT, SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD, &aMergeSilent, 0L); - SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE_END, pObjSh)); + SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE_END, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE_END), pObjSh)); pTargetView->SetMailMergeConfigItem(0, 0, sal_False); m_pWizard->enableButtons(WZB_CANCEL, sal_True); diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx index 1e978dbdac4c..585151383893 100644 --- a/sw/source/ui/dialog/ascfldlg.cxx +++ b/sw/source/ui/dialog/ascfldlg.cxx @@ -35,6 +35,8 @@ #endif #include <hintids.hxx> #include <rtl/textenc.h> +#include <i18npool/mslangid.hxx> +#include <com/sun/star/i18n/ScriptType.hpp> #include <svtools/lingucfg.hxx> #include <fontcfg.hxx> #include <swmodule.hxx> @@ -234,14 +236,14 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh, switch(nAppScriptType) { case SCRIPTTYPE_ASIAN: - aOpt.SetLanguage(aLinguOpt.nDefaultLanguage_CJK); + aOpt.SetLanguage(MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, SCRIPTTYPE_ASIAN)); break; case SCRIPTTYPE_COMPLEX: - aOpt.SetLanguage(aLinguOpt.nDefaultLanguage_CTL); + aOpt.SetLanguage(MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, SCRIPTTYPE_COMPLEX)); break; //SCRIPTTYPE_LATIN: default: - aOpt.SetLanguage(aLinguOpt.nDefaultLanguage); + aOpt.SetLanguage(MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, SCRIPTTYPE_LATIN)); } } } diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 2f90c9fddef3..9626f5104db9 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -34,29 +34,22 @@ #undef SW_DLLIMPLEMENTATION #endif -#include "hintids.hxx" -#include "regionsw.hxx" +#include <hintids.hxx> +#include <regionsw.hxx> #include <svtools/urihelper.hxx> #include <svtools/PasswordHelper.hxx> #include <vcl/svapp.hxx> -#ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> -#endif #include <svtools/stritem.hxx> #include <svtools/eitem.hxx> -#ifndef _PASSWD_HXX //autogen #include <sfx2/passwd.hxx> -#endif #include <sfx2/docfilt.hxx> #include <sfx2/request.hxx> #include <sfx2/docfile.hxx> #include <sfx2/linkmgr.hxx> #include <sfx2/docinsert.hxx> #include <sfx2/filedlghelper.hxx> -#ifndef _SVX_SIZEITEM_HXX //autogen - #include <svx/sizeitem.hxx> -#endif #include <svx/htmlcfg.hxx> #include <comphelper/storagehelper.hxx> @@ -65,15 +58,9 @@ #include <section.hxx> #include <docary.hxx> #include <doc.hxx> // fuers SwSectionFmt-Array -#ifndef _BASESH_HXX #include <basesh.hxx> -#endif -#ifndef _WDOCSH_HXX #include <wdocsh.hxx> -#endif -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <swmodule.hxx> #include <wrtsh.hxx> #include <swundo.hxx> // fuer Undo-Ids @@ -82,27 +69,15 @@ #include <swunodef.hxx> #include <shellio.hxx> -#ifndef _HELPID_H #include <helpid.h> -#endif -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _REGIONSW_HRC #include <regionsw.hrc> -#endif -#ifndef _COMCORE_HRC #include <comcore.hrc> -#endif -#ifndef _GLOBALS_HRC #include <globals.hrc> -#endif #include <sfx2/bindings.hxx> #include <svx/htmlmode.hxx> #include <svx/dlgutil.hxx> -#ifndef _SVX_DIALOGS_HRC #include <svx/dialogs.hrc> -#endif #include <svx/svxdlg.hxx> #include <svx/flagsdef.hxx> @@ -115,7 +90,65 @@ SV_IMPL_PTRARR( SwSectionFmts, SwSectionFmtPtr ) SV_IMPL_OP_PTRARR_SORT( SectReprArr, SectReprPtr ) -static void lcl_ReadSections( SwWrtShell& rSh, SfxMedium& rMedium, ComboBox& rBox ); +static void lcl_ReadSections( SfxMedium& rMedium, ComboBox& rBox ); + +void lcl_FillList( SwWrtShell& rSh, ComboBox& rSubRegions, ComboBox* pAvailNames, const SwSectionFmt* pNewFmt ) +{ + const SwSectionFmt* pFmt; + if( !pNewFmt ) + { + USHORT nCount = rSh.GetSectionFmtCount(); + for(USHORT i=0;i<nCount;i++) + { + SectionType eTmpType; + if( !(pFmt = &rSh.GetSectionFmt(i))->GetParent() && + pFmt->IsInNodesArr() && + (eTmpType = pFmt->GetSection()->GetType()) != TOX_CONTENT_SECTION + && TOX_HEADER_SECTION != eTmpType ) + { + String* pString = new String(pFmt->GetSection()->GetName()); + if(pAvailNames) + pAvailNames->InsertEntry(*pString); + rSubRegions.InsertEntry(*pString); + lcl_FillList( rSh, rSubRegions, pAvailNames, pFmt ); + } + } + } + else + { + SwSections aTmpArr; + USHORT nCnt = pNewFmt->GetChildSections(aTmpArr,SORTSECT_POS); + if( nCnt ) + { + SectionType eTmpType; + for( USHORT n = 0; n < nCnt; ++n ) + if( (pFmt = aTmpArr[n]->GetFmt())->IsInNodesArr()&& + (eTmpType = pFmt->GetSection()->GetType()) != TOX_CONTENT_SECTION + && TOX_HEADER_SECTION != eTmpType ) + { + String* pString = new String(pFmt->GetSection()->GetName()); + if(pAvailNames) + pAvailNames->InsertEntry(*pString); + rSubRegions.InsertEntry(*pString); + lcl_FillList( rSh, rSubRegions, pAvailNames, pFmt ); + } + } + } +} + +void lcl_FillSubRegionList( SwWrtShell& rSh, ComboBox& rSubRegions, ComboBox* pAvailNames ) +{ + lcl_FillList( rSh, rSubRegions, pAvailNames, 0 ); + IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess(); + for( IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin(); + ppMark != pMarkAccess->getMarksEnd(); + ppMark++) + { + const ::sw::mark::IMark* pBkmk = ppMark->get(); + if( pBkmk->IsExpanded() ) + rSubRegions.InsertEntry( pBkmk->GetName() ); + } +} /* -----------------25.06.99 15:38------------------- @@ -275,6 +308,7 @@ SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh ) aFilePB ( this, SW_RES( PB_FILE ) ), aSubRegionFT ( this, SW_RES( FT_SUBREG ) ) , aSubRegionED ( this, SW_RES( LB_SUBREG ) ) , + bSubRegionsFilled( false ), aProtectFL ( this, SW_RES( FL_PROTECT ) ), aProtectCB ( this, SW_RES( CB_PROTECT ) ), @@ -330,6 +364,8 @@ SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh ) aFilePB.SetClickHdl ( LINK( this, SwEditRegionDlg, FileSearchHdl )); aFileNameED.SetModifyHdl( LINK( this, SwEditRegionDlg, FileNameHdl )); aSubRegionED.SetModifyHdl( LINK( this, SwEditRegionDlg, FileNameHdl )); + aSubRegionED.AddEventListener( LINK( this, SwEditRegionDlg, SubRegionEventHdl )); + aSubRegionED.EnableAutocomplete( sal_True, sal_True ); aTree.SetHelpId(HID_REGION_TREE); aTree.SetSelectionMode( MULTIPLE_SELECTION ); @@ -667,6 +703,8 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox ) aDismiss.Enable(); String aFile = pRepr->GetFile(); String sSub = pRepr->GetSubRegion(); + bSubRegionsFilled = false; + aSubRegionED.Clear(); if(aFile.Len()||sSub.Len()) { aFileCB.Check(TRUE); @@ -1174,6 +1212,8 @@ IMPL_LINK( SwEditRegionDlg, FileNameHdl, Edit *, pEdit ) SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData(); if(pEdit == &aFileNameED) { + bSubRegionsFilled = false; + aSubRegionED.Clear(); if( aDDECB.IsChecked() ) { String sLink( pEdit->GetText() ); @@ -1371,7 +1411,7 @@ IMPL_LINK( SwEditRegionDlg, DlgClosedHdl, sfx2::FileDialogHelper *, _pFileDlg ) const SfxPoolItem* pItem; if ( SFX_ITEM_SET == pMedium->GetItemSet()->GetItemState( SID_PASSWORD, FALSE, &pItem ) ) sPassword = ( (SfxStringItem*)pItem )->GetValue(); - ::lcl_ReadSections( rSh, *pMedium, aSubRegionED ); + ::lcl_ReadSections( *pMedium, aSubRegionED ); delete pMedium; } } @@ -1390,6 +1430,36 @@ IMPL_LINK( SwEditRegionDlg, DlgClosedHdl, sfx2::FileDialogHelper *, _pFileDlg ) Application::SetDefDialogParent( m_pOldDefDlgParent ); return 0; } +/*-- 03.09.2009 16:24:18--------------------------------------------------- + + -----------------------------------------------------------------------*/ +IMPL_LINK( SwEditRegionDlg, SubRegionEventHdl, VclWindowEvent *, pEvent ) +{ + if( !bSubRegionsFilled && pEvent && pEvent->GetId() == VCLEVENT_DROPDOWN_PRE_OPEN ) + { + //if necessary fill the names bookmarks/sections/tables now + + rtl::OUString sFileName = aFileNameED.GetText(); + if(sFileName.getLength()) + { + SfxMedium* pMedium = rSh.GetView().GetDocShell()->GetMedium(); + INetURLObject aAbs; + if( pMedium ) + aAbs = pMedium->GetURLObject(); + sFileName = URIHelper::SmartRel2Abs( + aAbs, sFileName, URIHelper::GetMaybeFileHdl() ); + + //load file and set the shell + SfxMedium aMedium( sFileName, STREAM_STD_READ ); + sFileName = aMedium.GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); + ::lcl_ReadSections( aMedium, aSubRegionED ); + } + else + lcl_FillSubRegionList( rSh, aSubRegionED, 0 ); + bSubRegionsFilled = true; + } + return 0; +} /* -----------------------------08.05.2002 15:00------------------------------ @@ -1404,7 +1474,7 @@ Image SwEditRegionDlg::BuildBitmap(BOOL bProtect,BOOL bHidden, BOOL bHighContras Beschreibung: Hilfsfunktion - Bereichsnamen aus dem Medium lesen --------------------------------------------------------------------*/ -static void lcl_ReadSections( SwWrtShell& /*rSh*/, SfxMedium& rMedium, ComboBox& rBox ) +static void lcl_ReadSections( SfxMedium& rMedium, ComboBox& rBox ) { rBox.Clear(); uno::Reference < embed::XStorage > xStg; @@ -1580,6 +1650,7 @@ SwInsertSectionTabPage::SwInsertSectionTabPage( aCurName.SetModifyHdl ( LINK( this, SwInsertSectionTabPage, NameEditHdl)); aDDECB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, DDEHdl )); ChangeProtectHdl(&aProtectCB); + aSubRegionED.EnableAutocomplete( sal_True, sal_True ); } /* -----------------21.05.99 10:31------------------- * @@ -1603,16 +1674,7 @@ void SwInsertSectionTabPage::SetWrtShell(SwWrtShell& rSh) aDDECommandFT .Hide(); } - FillList(); - IDocumentMarkAccess* const pMarkAccess = m_pWrtSh->getIDocumentMarkAccess(); - for( IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin(); - ppMark != pMarkAccess->getMarksEnd(); - ppMark++) - { - const ::sw::mark::IMark* pBkmk = ppMark->get(); - if( pBkmk->IsExpanded() ) - aSubRegionED.InsertEntry( pBkmk->GetName() ); - } + lcl_FillSubRegionList( *m_pWrtSh, aSubRegionED, &aCurName ); SwSection* pSect = ((SwInsertSectionTabDialog*)GetTabDialog())->GetSection(); if( pSect ) // etwas vorgegeben ? @@ -1875,7 +1937,7 @@ IMPL_LINK( SwInsertSectionTabPage, DlgClosedHdl, sfx2::FileDialogHelper *, _pFil m_sFilePasswd = ( (SfxStringItem*)pItem )->GetValue(); aFileNameED.SetText( INetURLObject::decode( m_sFileName, INET_HEX_ESCAPE, INetURLObject::DECODE_UNAMBIGUOUS, RTL_TEXTENCODING_UTF8 ) ); - ::lcl_ReadSections( *m_pWrtSh, *pMedium, aSubRegionED ); + ::lcl_ReadSections( *pMedium, aSubRegionED ); delete pMedium; } } @@ -1886,52 +1948,6 @@ IMPL_LINK( SwInsertSectionTabPage, DlgClosedHdl, sfx2::FileDialogHelper *, _pFil return 0; } -/*-------------------------------------------------------------------- - Beschreibung: Liste der verwendeten Namen fuellen - --------------------------------------------------------------------*/ - -void SwInsertSectionTabPage::FillList( const SwSectionFmt* pNewFmt ) -{ - const SwSectionFmt* pFmt; - if( !pNewFmt ) - { - USHORT nCount = m_pWrtSh->GetSectionFmtCount(); - for(USHORT i=0;i<nCount;i++) - { - SectionType eTmpType; - if( !(pFmt = &m_pWrtSh->GetSectionFmt(i))->GetParent() && - pFmt->IsInNodesArr() && - (eTmpType = pFmt->GetSection()->GetType()) != TOX_CONTENT_SECTION - && TOX_HEADER_SECTION != eTmpType ) - { - String* pString = new String(pFmt->GetSection()->GetName()); - aCurName.InsertEntry(*pString); - aSubRegionED.InsertEntry(*pString); - FillList( pFmt ); - } - } - } - else - { - SwSections aTmpArr; - USHORT nCnt = pNewFmt->GetChildSections(aTmpArr,SORTSECT_POS); - if( nCnt ) - { - SectionType eTmpType; - for( USHORT n = 0; n < nCnt; ++n ) - if( (pFmt = aTmpArr[n]->GetFmt())->IsInNodesArr()&& - (eTmpType = pFmt->GetSection()->GetType()) != TOX_CONTENT_SECTION - && TOX_HEADER_SECTION != eTmpType ) - { - String* pString = new String(pFmt->GetSection()->GetName()); - aCurName.InsertEntry(*pString); - aSubRegionED.InsertEntry(*pString); - FillList( pFmt ); - } - } - } -} - // -------------------------------------------------------------- // Numerierungsformat Umsetzung: diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index ea6ab45f4ec1..f3dc55f26f4d 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -3778,6 +3778,7 @@ BOOL SwTrnsfrDdeLink::WriteData( SvStream& rStrm ) // remove mark pServerObject->SetNoServer(); // this removes the connection between SwServerObject and mark + // N.B. ppMark was not loaded from file and cannot have xml:id pMarkAccess->deleteMark(ppMark); // recreate as Bookmark diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx index 7a63ad665aef..6bea77137ac6 100644 --- a/sw/source/ui/docvw/PostItMgr.cxx +++ b/sw/source/ui/docvw/PostItMgr.cxx @@ -74,6 +74,7 @@ #include <svtools/langtab.hxx> #include <svtools/smplhint.hxx> +#include <svx/svdview.hxx> #include <svx/eeitem.hxx> #include <svx/langitem.hxx> #include <svx/outliner.hxx> @@ -307,8 +308,9 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) /* else if ( rHint.IsA(TYPE(SwRedlineHint) ) ) { - SwRedline* pRedline = const_cast<SwRedline*>(((SwRedlineHint&)rHint).GetRedline()); - switch ( ((SwRedlineHint&)rHint).Which() ) + const SwRedlineHint rRedlineHint = static_cast<const SwRedlineHint&>(rHint); + SwRedline* pRedline = const_cast<SwRedline*>(rRedlineHint.GetRedline()); + switch ( rRedlineHint.Which() ) { case SWREDLINE_INSERTED : { @@ -325,7 +327,8 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } case SWREDLINE_FOCUS: { - Focus(rBC); + if (rRedlineHint.GetView()== mpView) + Focus(rBC); break; } } @@ -333,8 +336,9 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) */ else if ( rHint.IsA(TYPE(SwFmtFldHint) ) ) { - SwFmtFld* pFld = const_cast <SwFmtFld*>( ((SwFmtFldHint&)rHint).GetField() ); - switch ( ((SwFmtFldHint&)rHint).Which() ) + const SwFmtFldHint& rFmtHint = static_cast<const SwFmtFldHint&>(rHint); + SwFmtFld* pFld = const_cast <SwFmtFld*>( rFmtHint.GetField() ); + switch ( rFmtHint.Which() ) { case SWFMTFLD_INSERTED : { @@ -351,9 +355,10 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) if (bEmpty && !mvPostItFlds.empty()) PrepareView(true); } - else { + else + { DBG_ERROR( "Inserted field not in document!" ); - } + } break; } case SWFMTFLD_REMOVED: @@ -371,18 +376,22 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } case SWFMTFLD_FOCUS: { - Focus(rBC); + if (rFmtHint.GetView()== mpView) + Focus(rBC); break; } case SWFMTFLD_CHANGED: { - SwFmtFld* pFmtFld = dynamic_cast<SwFmtFld*>(&rBC); + SwFmtFld* pFmtFld = dynamic_cast<SwFmtFld*>(&rBC); for(std::list<SwMarginItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) { - if ( pFmtFld == (*i)->GetBroadCaster() ) + if ( pFmtFld == (*i)->GetBroadCaster() ) { if ((*i)->pPostIt) + { (*i)->pPostIt->SetPostItText(); + mbLayout = true; + } break; } } @@ -390,10 +399,10 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } case SWFMTFLD_LANGUAGE: { - SwFmtFld* pFmtFld = dynamic_cast<SwFmtFld*>(&rBC); + SwFmtFld* pFmtFld = dynamic_cast<SwFmtFld*>(&rBC); for(std::list<SwMarginItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) { - if ( pFmtFld == (*i)->GetBroadCaster() ) + if ( pFmtFld == (*i)->GetBroadCaster() ) { if ((*i)->pPostIt) { @@ -1914,3 +1923,27 @@ sal_uInt16 SwPostItMgr::SearchReplace(const SwFmtFld &pFld, const ::com::sun::st } return aResult; } + +void SwPostItMgr::AssureStdModeAtShell() +{ + //#i103373# #i103645# + // deselect any drawing or frame and leave editing mode + SdrView* pSdrView = mpWrtShell->GetDrawView(); + if ( pSdrView && pSdrView->IsTextEdit() ) + { + sal_Bool bLockView = mpWrtShell->IsViewLocked(); + mpWrtShell->LockView( sal_True ); + mpWrtShell->EndTextEdit(); + mpWrtShell->LockView( bLockView ); + } + + if( mpWrtShell->IsSelFrmMode() || mpWrtShell->IsObjSelected()) + { + mpWrtShell->UnSelectFrm(); + mpWrtShell->LeaveSelFrmMode(); + mpWrtShell->EnterStdMode(); + + mpWrtShell->DrawSelChanged(); + mpView->StopShellTimer(); + } +} diff --git a/sw/source/ui/docvw/docvw.src b/sw/source/ui/docvw/docvw.src index de4305bc730e..0220d9d9eddf 100644 --- a/sw/source/ui/docvw/docvw.src +++ b/sw/source/ui/docvw/docvw.src @@ -315,12 +315,12 @@ String STR_POSTIT_YESTERDAY String STR_DELETE_ALL_NOTES { - Text [ en-US ] = "All Notes" ; + Text [ en-US ] = "All Comments" ; }; String STR_DELETE_AUTHOR_NOTES { - Text [ en-US ] = "Notes by " ; + Text [ en-US ] = "Comments by " ; }; String STR_NODATE diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 8236791701ef..7d8e38443ca0 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -1405,8 +1405,8 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) if( rKeyCode.GetFullCode() == (KEY_A | KEY_MOD1 |KEY_SHIFT) && rSh.HasDrawView() && (0 != (nLclSelectionType = rSh.GetSelectionType()) && - ((nLclSelectionType & nsSelectionType::SEL_FRM) || - ((nLclSelectionType & nsSelectionType::SEL_DRW|nsSelectionType::SEL_DRW_FORM) && + ((nLclSelectionType & (nsSelectionType::SEL_FRM|nsSelectionType::SEL_GRF)) || + ((nLclSelectionType & (nsSelectionType::SEL_DRW|nsSelectionType::SEL_DRW_FORM)) && rSh.GetDrawView()->GetMarkedObjectList().GetMarkCount() == 1)))) { SdrHdlList& rHdlList = (SdrHdlList&)rSh.GetDrawView()->GetHdlList(); @@ -5568,11 +5568,12 @@ void QuickHelpData::Stop( SwWrtShell& rSh ) void QuickHelpData::FillStrArr( SwWrtShell& rSh, const String& rWord ) { - pCalendarWrapper->LoadDefaultCalendar( rSh.GetCurLang() ); + salhelper::SingletonRef<SwCalendarWrapper>* pCalendar = s_getCalendarWrapper(); + (*pCalendar)->LoadDefaultCalendar( rSh.GetCurLang() ); { uno::Sequence< i18n::CalendarItem > aNames( - pCalendarWrapper->getMonths() ); + (*pCalendar)->getMonths() ); for( int n = 0; n < 2; ++n ) { for( long nPos = 0, nEnd = aNames.getLength(); nPos < nEnd; ++nPos ) @@ -5592,7 +5593,7 @@ void QuickHelpData::FillStrArr( SwWrtShell& rSh, const String& rWord ) } } if( !n ) // get data for the second loop - aNames = pCalendarWrapper->getDays(); + aNames = (*pCalendar)->getDays(); } } diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx index bf60c53372b2..13f832acfccf 100644 --- a/sw/source/ui/docvw/edtwin2.cxx +++ b/sw/source/ui/docvw/edtwin2.cxx @@ -94,6 +94,11 @@ #include <PostItMgr.hxx> #include <fmtfld.hxx> +// --> OD 2009-08-18 #i104300# +#include <IDocumentMarkAccess.hxx> +#include <ndtxt.hxx> +// <-- + /*-------------------------------------------------------------------- Beschreibung: KeyEvents --------------------------------------------------------------------*/ @@ -205,6 +210,38 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) sSuffix.EqualsAscii( pMarkToOLE )) sTxt = sTxt.Copy( 0, nFound - 1); } + // --> OD 2009-08-18 #i104300# + // special handling if target is a cross-reference bookmark + { + String sTmpSearchStr = sTxt.Copy( 1, sTxt.Len() ); + IDocumentMarkAccess* const pMarkAccess = + rSh.getIDocumentMarkAccess(); + IDocumentMarkAccess::const_iterator_t ppBkmk = + pMarkAccess->findBookmark( sTmpSearchStr ); + if ( ppBkmk != pMarkAccess->getBookmarksEnd() && + IDocumentMarkAccess::GetType( *(ppBkmk->get()) ) + == IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK ) + { + SwTxtNode* pTxtNode = ppBkmk->get()->GetMarkStart().nNode.GetNode().GetTxtNode(); + if ( pTxtNode ) + { + sTxt = pTxtNode->GetExpandTxt( 0, pTxtNode->Len(), true, true ); + + if( sTxt.Len() ) + { + sTxt.EraseAllChars( 0xad ); + for( sal_Unicode* p = sTxt.GetBufferAccess(); *p; ++p ) + { + if( *p < 0x20 ) + *p = 0x20; + else if(*p == 0x2011) + *p = '-'; + } + } + } + } + } + // <-- // --> OD 2007-07-26 #i80029# BOOL bExecHyperlinks = rView.GetDocShell()->IsReadOnly(); if ( !bExecHyperlinks ) diff --git a/sw/source/ui/docvw/postit.cxx b/sw/source/ui/docvw/postit.cxx index 8b4c46b6f2c1..e693f87e7a35 100644 --- a/sw/source/ui/docvw/postit.cxx +++ b/sw/source/ui/docvw/postit.cxx @@ -91,6 +91,7 @@ #include <vcl/svapp.hxx> #include <vcl/gradient.hxx> #include <vcl/salbtype.hxx> // FRound +#include <vcl/msgbox.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/tuple/b2dtuple.hxx> @@ -269,6 +270,8 @@ void PostItTxt::KeyInput( const KeyEvent& rKeyEvt ) bool bIsProtected = mpMarginWin->IsProtected(); if (!bIsProtected || (bIsProtected && !mpMarginWin->Engine()->GetEditEngine().DoesKeyChangeText(rKeyEvt)) ) bDone = mpOutlinerView->PostKeyEvent( rKeyEvt ); + else + InfoBox( this, SW_RES( MSG_READONLY_CONTENT )).Execute(); } if (bDone) mpMarginWin->ResizeIfNeccessary(aOldHeight,mpMarginWin->GetPostItTextHeight()); @@ -436,33 +439,6 @@ void PostItTxt::Command( const CommandEvent& rCEvt ) mpMarginWin->DocView()->HandleWheelCommands(rCEvt); } } - else if (rCEvt.GetCommand() == COMMAND_SELECTIONCHANGE) - { - if ( mpOutlinerView ) - { - const CommandSelectionChangeData *pData = rCEvt.GetSelectionChangeData(); - ESelection aSelection = mpOutlinerView->GetEditView().GetSelection(); - aSelection.nStartPos = sal::static_int_cast<sal_uInt16, ULONG>(pData->GetStart()); - aSelection.nEndPos = sal::static_int_cast<sal_uInt16, ULONG>(pData->GetEnd()); - mpOutlinerView->GetEditView().SetSelection(aSelection); - } - } - else if (rCEvt.GetCommand() == COMMAND_PREPARERECONVERSION) - { - if ( mpOutlinerView && mpOutlinerView->HasSelection() ) - { - EditEngine *aEditEngine = mpOutlinerView->GetEditView().GetEditEngine(); - ESelection aSelection = mpOutlinerView->GetEditView().GetSelection(); - aSelection.Adjust(); - if( aSelection.nStartPara != aSelection.nEndPara ) - { - xub_StrLen aParaLen = aEditEngine->GetTextLen( aSelection.nStartPara ); - aSelection.nEndPara = aSelection.nStartPara; - aSelection.nEndPos = aParaLen; - mpOutlinerView->GetEditView().SetSelection( aSelection ); - } - } - } else { if ( mpOutlinerView ) @@ -477,40 +453,6 @@ void PostItTxt::DataChanged( const DataChangedEvent& aData) Window::DataChanged( aData ); } -XubString PostItTxt::GetSurroundingText() const -{ - if( mpOutlinerView ) - { - EditEngine *aEditEngine = mpOutlinerView->GetEditView().GetEditEngine(); - if( mpOutlinerView->HasSelection() ) - return mpOutlinerView->GetSelected(); - else - { - ESelection aSelection = mpOutlinerView->GetEditView().GetSelection(); - XubString aStr = aEditEngine->GetText(aSelection.nStartPara); - return aStr; - } - } - else - return XubString::EmptyString(); -} - -Selection PostItTxt::GetSurroundingTextSelection() const -{ - if( mpOutlinerView ) - { - if( mpOutlinerView->HasSelection() ) - return Selection( 0, mpOutlinerView->GetSelected().Len() ); - else - { - ESelection aSelection = mpOutlinerView->GetEditView().GetSelection(); - return Selection( aSelection.nStartPos, aSelection.nEndPos ); - } - } - else - return Selection( 0, 0 ); -} - IMPL_LINK( PostItTxt, WindowEventListener, VclSimpleEvent*, pWinEvent ) { if ( pWinEvent && pWinEvent->ISA( VclWindowEvent ) ) @@ -549,6 +491,22 @@ IMPL_LINK( PostItTxt, WindowEventListener, VclSimpleEvent*, pWinEvent ) return sal_True; } +XubString PostItTxt::GetSurroundingText() const +{ + if( mpOutlinerView ) + return mpOutlinerView->GetSurroundingText(); + else + return XubString::EmptyString(); +} + +Selection PostItTxt::GetSurroundingTextSelection() const +{ + if( mpOutlinerView ) + return mpOutlinerView->GetSurroundingTextSelection(); + else + return Selection( 0, 0 ); +} + /************** SwMarginWin***********************************++*/ SwMarginWin::SwMarginWin(Window* pParent, WinBits nBits,SwPostItMgr* aMgr,SwPostItBits aBits) : Window(pParent, nBits), @@ -735,6 +693,15 @@ void SwMarginWin::ShowAnkorOnly(const Point &aPoint) mpShadow->setVisible(false); } +SfxItemSet SwMarginWin::DefaultItem() +{ + SfxItemSet aItem( mpView->GetDocShell()->GetPool() ); + aItem.Put(SvxFontHeightItem(200,100,EE_CHAR_FONTHEIGHT)); + aItem.Put(SvxFontItem(FAMILY_SWISS,GetSettings().GetStyleSettings().GetFieldFont().GetName(), + EMPTYSTRING,PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO)); + return aItem; +} + void SwMarginWin::InitControls() { // actual window which holds the user text @@ -779,11 +746,7 @@ void SwMarginWin::InitControls() mpPostItTxt->SetTextView(mpOutlinerView); mpOutlinerView->SetOutputArea( PixelToLogic( Rectangle(0,0,1,1) ) ); - SfxItemSet item(aShell->GetPool()); - item.Put(SvxFontHeightItem(200,100,EE_CHAR_FONTHEIGHT)); - item.Put(SvxFontItem(FAMILY_SWISS,GetSettings().GetStyleSettings().GetFieldFont().GetName(), - EMPTYSTRING,PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO)); - mpOutlinerView->SetAttribs(item); + mpOutlinerView->SetAttribs(DefaultItem()); // TODO: ?? EEHorizontalTextDirection aDefHoriTextDir = Application::GetSettings().GetLayoutRTL() ? EE_HTEXTDIR_R2L : EE_HTEXTDIR_L2R; @@ -965,7 +928,7 @@ void SwMarginWin::SetPosAndSize() { mpAnkor->SetAnkorState(AS_ALL); SwMarginWin* pWin = GetTopReplyNote(); - if (IsFollow() && pWin ) + if (pWin) pWin->Ankor()->SetAnkorState(AS_END); } } @@ -973,9 +936,9 @@ void SwMarginWin::SetPosAndSize() void SwMarginWin::DoResize() { - long aTextHeight = LogicToPixel( mpOutliner->CalcTextSize()).Height(); - unsigned long aWidth = GetSizePixel().Width(); - long aHeight = GetSizePixel().Height(); + long aTextHeight = LogicToPixel( mpOutliner->CalcTextSize()).Height(); + long aHeight = GetSizePixel().Height(); + unsigned long aWidth = GetSizePixel().Width(); if (mbMeta) { @@ -999,7 +962,6 @@ void SwMarginWin::DoResize() mpVScrollbar->Hide(); } - mpPostItTxt->SetPosSizePixel(0, 0, aWidth, aHeight); mpMeta->SetPosSizePixel(0,aHeight,GetSizePixel().Width()-GetMetaButtonAreaWidth(),GetMetaHeight()); mpOutliner->SetPaperSize( PixelToLogic( Size(aWidth,aHeight) ) ) ; mpOutlinerView->SetOutputArea( PixelToLogic( Rectangle(0,0,aWidth,aHeight) ) ); @@ -1007,11 +969,21 @@ void SwMarginWin::DoResize() { // if we do not have a scrollbar anymore, we want to see the complete text mpOutlinerView->SetVisArea( PixelToLogic( Rectangle(0,0,aWidth,aHeight) ) ); } - mpVScrollbar->SetPosSizePixel( aWidth, 0, GetScrollbarWidth(), aHeight ); + + if (!Application::GetSettings().GetLayoutRTL()) + { + mpPostItTxt->SetPosSizePixel(0, 0, aWidth, aHeight); + mpVScrollbar->SetPosSizePixel( aWidth, 0, GetScrollbarWidth(), aHeight); + } + else + { + mpPostItTxt->SetPosSizePixel((aTextHeight > aHeight) && !IsPreview() ? GetScrollbarWidth() : 0 , 0, aWidth, aHeight); + mpVScrollbar->SetPosSizePixel( 0, 0, GetScrollbarWidth(), aHeight); + } + mpVScrollbar->SetVisibleSize( PixelToLogic(Size(0,aHeight)).Height() ); mpVScrollbar->SetPageSize( PixelToLogic(Size(0,aHeight)).Height() * 8 / 10 ); mpVScrollbar->SetLineSize( mpOutliner->GetTextHeight() / 10 ); - //mpVScrollbar->SetThumbPos( mpOutlinerView->GetVisArea().Top()+ mpOutlinerView->GetEditView().GetCursor()->GetOffsetY()); SetScrollbar(); mpVScrollbar->SetRange( Range(0, mpOutliner->GetTextHeight())); @@ -1025,10 +997,6 @@ void SwMarginWin::DoResize() Point aRight = PixelToLogic( Point( aBase.X() - (METABUTTON_WIDTH-1)*fx.GetNumerator()/fx.GetDenominator(), aBase.Y()+17*fy.GetNumerator()/fy.GetDenominator() ) ); Point aBottom = PixelToLogic( Point( aBase.X() - (METABUTTON_WIDTH+2)*fx.GetNumerator()/fx.GetDenominator(), aBase.Y()+20*fy.GetNumerator()/fy.GetDenominator() ) ); - //Point aLeft = PixelToLogic(Point(mpMeta->GetPosPixel().X()+mpMeta->GetPosPixel().X()+GetSizePixel().Width()-(GetMetaButtonWidth()+10)+5,mpMeta->GetPosPixel().Y()+17)); - //Point aRight = PixelToLogic(Point(mpMeta->GetPosPixel().X()+mpMeta->GetPosPixel().X()+GetSizePixel().Width()-(GetMetaButtonWidth()+10)+11,mpMeta->GetPosPixel().Y()+17)); - //Point aBottom = PixelToLogic(Point(mpMeta->GetPosPixel().X()+mpMeta->GetPosPixel().X()+GetSizePixel().Width()-(GetMetaButtonWidth()+10)+8,mpMeta->GetPosPixel().Y()+20)); - aPopupTriangle.clear(); aPopupTriangle.append(basegfx::B2DPoint(aLeft.X(),aLeft.Y())); aPopupTriangle.append(basegfx::B2DPoint(aRight.X(),aRight.Y())); @@ -1220,6 +1188,8 @@ void SwMarginWin::HideNote() void SwMarginWin::ActivatePostIt() { + mpMgr->AssureStdModeAtShell(); + mpOutliner->ClearModifyFlag(); mpOutliner->GetUndoManager().Clear(); @@ -1280,6 +1250,8 @@ void SwMarginWin::ToggleInsMode() void SwMarginWin::ExecuteCommand(USHORT nSlot) { + mpMgr->AssureStdModeAtShell(); + switch (nSlot) { case FN_POSTIT: @@ -1444,9 +1416,7 @@ void SwMarginWin::ResetAttributes() { mpOutlinerView->RemoveAttribsKeepLanguages(TRUE); mpOutliner->RemoveFields(TRUE); - SfxItemSet aSet( mpView->GetDocShell()->GetPool() ); - aSet.Put(SvxFontHeightItem(200,100,EE_CHAR_FONTHEIGHT)); - mpOutlinerView->SetAttribs(aSet); + mpOutlinerView->SetAttribs(DefaultItem()); } sal_Int32 SwMarginWin::GetScrollbarWidth() @@ -1504,7 +1474,7 @@ void SwMarginWin::SetViewState(ShadowState bState) { mpAnkor->SetAnkorState(AS_ALL); SwMarginWin* pWin = GetTopReplyNote(); - if (IsFollow() && pWin) + if (pWin) pWin->Ankor()->SetAnkorState(AS_END); mpAnkor->setLineSolid(true); } @@ -1567,7 +1537,7 @@ bool SwMarginWin::IsAnyStackParentVisible() SwMarginWin* SwMarginWin::GetTopReplyNote() { SwMarginWin* pTopNote = 0; - SwMarginWin* pMarginWin = mpMgr->GetNextPostIt(KEY_PAGEUP, this); + SwMarginWin* pMarginWin = IsFollow() ? mpMgr->GetNextPostIt(KEY_PAGEUP, this) : 0; while (pMarginWin) { pTopNote = pMarginWin; @@ -1627,11 +1597,7 @@ void SwPostIt::SetPostItText() else { Engine()->Clear(); - SfxItemSet item( DocView()->GetDocShell()->GetPool() ); - item.Put(SvxFontHeightItem(200,100,EE_CHAR_FONTHEIGHT)); - item.Put(SvxFontItem(FAMILY_SWISS,GetSettings().GetStyleSettings().GetFieldFont().GetName(), - EMPTYSTRING,PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO)); - View()->SetAttribs(item); + View()->SetAttribs(DefaultItem()); View()->InsertText(mpFld->GetPar2(),false); } @@ -1646,19 +1612,19 @@ void SwPostIt::UpdateData() { if ( Engine()->IsModified() ) { - SwPosition * pPos = mpFmtFld->GetTxtFld()->GetPosition(); - if ( pPos ) - { - SwField* pOldField = mpFld->Copy(); - mpFld->SetPar2(Engine()->GetEditEngine().GetText()); - mpFld->SetTextObject(Engine()->CreateParaObject()); - DocView()->GetDocShell()->GetDoc()->AppendUndo(new SwUndoFieldFromDoc(*pPos, *pOldField, *mpFld, 0, true)); - delete pOldField; - delete pPos; - // so we get a new layout of notes (ankor position is still the same and we would otherwise not get one) - Mgr()->SetLayout(); - DocView()->GetDocShell()->SetModified(); - } + SwTxtFld* pTxtFld = mpFmtFld->GetTxtFld(); + SwPosition aPosition( pTxtFld->GetTxtNode() ); + aPosition.nContent = *pTxtFld->GetStart(); + SwField* pOldField = mpFld->Copy(); + mpFld->SetPar2(Engine()->GetEditEngine().GetText()); + mpFld->SetTextObject(Engine()->CreateParaObject()); + DocView()->GetDocShell()->GetDoc()->AppendUndo(new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true)); + delete pOldField; + // so we get a new layout of notes (anchor position is still the same and we would otherwise not get one) + Mgr()->SetLayout(); + // #i98686# if we have several views, all notes should update their text + mpFmtFld->Broadcast(SwFmtFldHint( 0, SWFMTFLD_CHANGED)); + DocView()->GetDocShell()->SetModified(); } Engine()->ClearModifyFlag(); Engine()->GetUndoManager().Clear(); @@ -1698,11 +1664,12 @@ sal_uInt32 SwPostIt::MoveCaret() //returns true, if there is another note right before this note bool SwPostIt::CalcFollow() { - SwPosition * pPos = mpFmtFld->GetTxtFld()->GetPosition(); - const SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode(); - SwTxtAttr* pTxtAttr = pTxtNd ? pTxtNd->GetTxtAttr( pPos->nContent.GetIndex()-1,RES_TXTATR_FIELD ) : 0; + SwTxtFld* pTxtFld = mpFmtFld->GetTxtFld(); + SwPosition aPosition( pTxtFld->GetTxtNode() ); + aPosition.nContent = *pTxtFld->GetStart(); + SwTxtAttr * const pTxtAttr = pTxtFld->GetTxtNode().GetTxtAttrForCharAt( + aPosition.nContent.GetIndex() - 1, RES_TXTATR_FIELD ); const SwField* pFld = pTxtAttr ? pTxtAttr->GetFld().GetFld() : 0; - delete pPos; return pFld && (pFld->Which()== RES_POSTITFLD); } @@ -1710,18 +1677,20 @@ bool SwPostIt::CalcFollow() sal_uInt32 SwPostIt::CountFollowing() { sal_uInt32 aCount = 1; // we start with 1, so we have to subtract one at the end again - SwPosition * pPos = mpFmtFld->GetTxtFld()->GetPosition(); - const SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode(); + SwTxtFld* pTxtFld = mpFmtFld->GetTxtFld(); + SwPosition aPosition( pTxtFld->GetTxtNode() ); + aPosition.nContent = *pTxtFld->GetStart(); - SwTxtAttr* pTxtAttr = pTxtNd ? pTxtNd->GetTxtAttr( pPos->nContent.GetIndex()+1,RES_TXTATR_FIELD ) : 0; + SwTxtAttr * pTxtAttr = pTxtFld->GetTxtNode().GetTxtAttrForCharAt( + aPosition.nContent.GetIndex() + 1, RES_TXTATR_FIELD ); SwField* pFld = pTxtAttr ? const_cast<SwField*>(pTxtAttr->GetFld().GetFld()) : 0; while (pFld && (pFld->Which()== RES_POSTITFLD)) { aCount++; - pTxtAttr = pTxtNd ? pTxtNd->GetTxtAttr( pPos->nContent.GetIndex() + aCount,RES_TXTATR_FIELD ) : 0; + pTxtAttr = pTxtFld->GetTxtNode().GetTxtAttrForCharAt( + aPosition.nContent.GetIndex() + aCount, RES_TXTATR_FIELD ); pFld = pTxtAttr ? const_cast<SwField*>(pTxtAttr->GetFld().GetFld()) : 0; } - delete pPos; return aCount - 1; } @@ -1820,24 +1789,18 @@ void SwPostIt::InitAnswer(OutlinerParaObject* pText) //remove all attributes and reset our standard ones View()->GetEditView().RemoveAttribsKeepLanguages(true); - SfxItemSet aNormalSet( DocView()->GetDocShell()->GetPool() ); - aNormalSet.Put(SvxFontHeightItem(200,100,EE_CHAR_FONTHEIGHT)); - aNormalSet.Put(SvxFontItem(FAMILY_SWISS,GetSettings().GetStyleSettings().GetFieldFont().GetName(), - EMPTYSTRING,PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO)); - View()->SetAttribs(aNormalSet); + View()->SetAttribs(DefaultItem()); // lets insert an undo step so the initial text can be easily deleted // but do not use UpdateData() directly, would set modified state again and reentrance into Mgr Engine()->SetModifyHdl( Link() ); - SwPosition * pPos = mpFmtFld->GetTxtFld()->GetPosition(); - if ( pPos ) - { - SwField* pOldField = mpFld->Copy(); - mpFld->SetPar2(Engine()->GetEditEngine().GetText()); - mpFld->SetTextObject(Engine()->CreateParaObject()); - DocView()->GetDocShell()->GetDoc()->AppendUndo(new SwUndoFieldFromDoc(*pPos, *pOldField, *mpFld, 0, true)); - delete pOldField; - delete pPos; - } + SwTxtFld* pTxtFld = mpFmtFld->GetTxtFld(); + SwPosition aPosition( pTxtFld->GetTxtNode() ); + aPosition.nContent = *pTxtFld->GetStart(); + SwField* pOldField = mpFld->Copy(); + mpFld->SetPar2(Engine()->GetEditEngine().GetText()); + mpFld->SetTextObject(Engine()->CreateParaObject()); + DocView()->GetDocShell()->GetDoc()->AppendUndo(new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true)); + delete pOldField; Engine()->SetModifyHdl( LINK( this, SwPostIt, ModifyHdl ) ); Engine()->ClearModifyFlag(); Engine()->GetUndoManager().Clear(); @@ -1899,11 +1862,7 @@ void SwRedComment::SetPostItText() Engine()->EnableUndo( FALSE ); Engine()->Clear(); - SfxItemSet item( DocView()->GetDocShell()->GetPool() ); - item.Put(SvxFontHeightItem(200,100,EE_CHAR_FONTHEIGHT)); - item.Put(SvxFontItem(FAMILY_SWISS,GetSettings().GetStyleSettings().GetFieldFont().GetName(), - EMPTYSTRING,PITCH_DONTKNOW,RTL_TEXTENCODING_DONTKNOW,EE_CHAR_FONTINFO)); - View()->SetAttribs(item); + View()->SetAttribs(DefaultItem()); View()->InsertText(pRedline->GetComment(),false); Engine()->ClearModifyFlag(); diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx index 85036cad7130..19ba5aefdf25 100644 --- a/sw/source/ui/docvw/srcedtw.cxx +++ b/sw/source/ui/docvw/srcedtw.cxx @@ -395,8 +395,10 @@ void TextViewOutWin::MouseButtonUp( const MouseEvent &rEvt ) if ( pTextView ) { pTextView->MouseButtonUp( rEvt ); - ((SwSrcEditWindow*)GetParent())->GetSrcView()->GetViewFrame()-> - GetBindings().Invalidate( SID_TABLE_CELL ); + SfxBindings& rBindings = ((SwSrcEditWindow*)GetParent())->GetSrcView()->GetViewFrame()->GetBindings(); + rBindings.Invalidate( SID_TABLE_CELL ); + rBindings.Invalidate( SID_CUT ); + rBindings.Invalidate( SID_COPY ); } } @@ -459,6 +461,7 @@ void TextViewOutWin::KeyInput( const KeyEvent& rKEvt ) if(bChange) bDone = pTextView->KeyInput( rKEvt ); + SfxBindings& rBindings = ((SwSrcEditWindow*)GetParent())->GetSrcView()->GetViewFrame()->GetBindings(); if ( !bDone ) { if ( !SfxViewShell::Current()->KeyInput( rKEvt ) ) @@ -466,7 +469,6 @@ void TextViewOutWin::KeyInput( const KeyEvent& rKEvt ) } else { - SfxBindings& rBindings = ((SwSrcEditWindow*)GetParent())->GetSrcView()->GetViewFrame()->GetBindings(); rBindings.Invalidate( SID_TABLE_CELL ); if ( rKEvt.GetKeyCode().GetGroup() == KEYGROUP_CURSOR ) rBindings.Update( SID_BASICIDE_STAT_POS ); @@ -478,6 +480,10 @@ void TextViewOutWin::KeyInput( const KeyEvent& rKEvt ) if( rKEvt.GetKeyCode().GetCode() == KEY_INSERT ) rBindings.Invalidate( SID_ATTR_INSERT ); } + + rBindings.Invalidate( SID_CUT ); + rBindings.Invalidate( SID_COPY ); + SwDocShell* pDocShell = pSrcEditWin->GetSrcView()->GetDocShell(); if(pSrcEditWin->GetTextEngine()->IsModified()) { diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx index f35efbe41253..dfb7823a1216 100644 --- a/sw/source/ui/fldui/fldmgr.cxx +++ b/sw/source/ui/fldui/fldmgr.cxx @@ -1615,7 +1615,7 @@ USHORT SwFldMgr::GetCurrLanguage() const SwWrtShell* pSh = pWrtShell ? pWrtShell : ::lcl_GetShell(); if( pSh ) return pSh->GetCurLang(); - return SvxLocaleToLanguage( GetAppLocaleData().getLocale() ); + return SvxLocaleToLanguage( SvtSysLocale().GetLocaleData().getLocale() ); } void SwFieldType::_GetFldName() diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx index 23b85f9e8339..0de17286fcad 100644 --- a/sw/source/ui/fldui/fldtdlg.cxx +++ b/sw/source/ui/fldui/fldtdlg.cxx @@ -136,7 +136,7 @@ SwFldDlg::SwFldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent) ::comphelper::getProcessServiceFactory(), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "/org.openoffice.Office.DataAccess/ApplicationIntegration/InstalledFeatures/Writer" ) ), + "/org.openoffice.Office.DataAccess/Policies/Features/Writer" ) ), -1, utl::OConfigurationTreeRoot::CM_READONLY); diff --git a/sw/source/ui/inc/actctrl.hxx b/sw/source/ui/inc/actctrl.hxx index d087a0a55753..789d6883c29a 100644 --- a/sw/source/ui/inc/actctrl.hxx +++ b/sw/source/ui/inc/actctrl.hxx @@ -66,10 +66,8 @@ protected: virtual void Modify(); public: - NoSpaceEdit( Window* pParent, const ResId& rResId) - : Edit(pParent, rResId), - sForbiddenChars(String::CreateFromAscii(" ")) - {} + NoSpaceEdit( Window* pParent, const ResId& rResId); + virtual ~NoSpaceEdit(); void SetForbiddenChars(const String& rSet){sForbiddenChars = rSet;} const String& GetForbiddenChars(){return sForbiddenChars;} }; diff --git a/sw/source/ui/inc/fldmgr.hxx b/sw/source/ui/inc/fldmgr.hxx index e174ef56ffcf..6919e636fc58 100644 --- a/sw/source/ui/inc/fldmgr.hxx +++ b/sw/source/ui/inc/fldmgr.hxx @@ -229,7 +229,7 @@ inline const String& SwFldMgr::GetCurFldPar1() const inline const String& SwFldMgr::GetCurFldPar2() const { return aCurPar2; } -inline ULONG SwFldMgr::GetCurFldFmt() const +inline ULONG SwFldMgr::GetCurFldFmt() const { return nCurFmt; } diff --git a/sw/source/ui/inc/insrc.hxx b/sw/source/ui/inc/insrc.hxx deleted file mode 100644 index 85655f151bc5..000000000000 --- a/sw/source/ui/inc/insrc.hxx +++ /dev/null @@ -1,85 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: insrc.hxx,v $ - * $Revision: 1.4 $ - * - * 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 _INSRC_HXX -#define _INSRC_HXX - -#include <svx/stddlg.hxx> - -#ifndef _FIXED_HXX //autogen -#include <vcl/fixed.hxx> -#endif - -#ifndef _FIELD_HXX //autogen -#include <vcl/field.hxx> -#endif - -#ifndef _BUTTON_HXX //autogen -#include <vcl/button.hxx> -#endif - -#ifndef _GROUP_HXX //autogen -#include <vcl/group.hxx> -#endif -#include <tools/string.hxx> - -#ifndef _BUTTON_HXX //autogen -#include <vcl/button.hxx> -#endif - -class SwView; -class SwInsRowColDlg : public SvxStandardDialog -{ - FixedText aCount; - NumericField aCountEdit; - FixedLine aInsFL; - - RadioButton aBeforeBtn; - RadioButton aAfterBtn; - FixedLine aPosFL; - - String aRow; - String aCol; - - OKButton aOKBtn; - CancelButton aCancelBtn; - HelpButton aHelpBtn; - - SwView& rView; - BOOL bColumn; - -protected: - virtual void Apply(); - -public: - SwInsRowColDlg( SwView& rView, BOOL bCol ); -}; - -#endif - diff --git a/sw/source/ui/inc/regionsw.hxx b/sw/source/ui/inc/regionsw.hxx index 6ad32074cae7..f5dbec86d1ef 100644 --- a/sw/source/ui/inc/regionsw.hxx +++ b/sw/source/ui/inc/regionsw.hxx @@ -33,35 +33,23 @@ #include <hintids.hxx> #include <vcl/field.hxx> #include <vcl/lstbox.hxx> -#ifndef _EDIT_HXX //autogen #include <vcl/edit.hxx> -#endif -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif -#ifndef _COMBOBOX_HXX //autogen #include <vcl/combobox.hxx> -#endif -#ifndef _GROUP_HXX //autogen #include <vcl/group.hxx> -#endif #include <svtools/svtreebx.hxx> #include <sfx2/basedlgs.hxx> #include <sfx2/tabdlg.hxx> #include <svx/brshitem.hxx> -#ifndef _CONDEDIT_HXX #include <condedit.hxx> -#endif #include <section.hxx> #include <fmtclds.hxx> #include <fmtftntx.hxx> #include <fmtclbl.hxx> #include <numberingtypelistbox.hxx> -#include "svx/frmdiritem.hxx" +#include <svx/frmdiritem.hxx> #include <vcl/image.hxx> #include <svx/paraprev.hxx> #include <svx/lrspitem.hxx> @@ -179,6 +167,7 @@ class SwEditRegionDlg : public SfxModalDialog PushButton aFilePB; FixedText aSubRegionFT; ComboBox aSubRegionED; + bool bSubRegionsFilled; FixedLine aProtectFL; TriStateBox aProtectCB; @@ -239,6 +228,7 @@ class SwEditRegionDlg : public SfxModalDialog DECL_LINK( FileNameHdl, Edit* ); DECL_LINK( DDEHdl, CheckBox* ); DECL_LINK( DlgClosedHdl, sfx2::FileDialogHelper* ); + DECL_LINK( SubRegionEventHdl, VclWindowEvent * ); BOOL CheckPasswd(CheckBox* pBox = 0); @@ -308,8 +298,6 @@ class SwInsertSectionTabPage : public SfxTabPage DECL_LINK( DDEHdl, CheckBox* ); DECL_LINK( DlgClosedHdl, sfx2::FileDialogHelper* ); - void FillList( const SwSectionFmt* pFmt = 0 ); - public: SwInsertSectionTabPage(Window *pParent, const SfxItemSet &rAttrSet); virtual ~SwInsertSectionTabPage(); diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx index 5656f6df1ab4..3c526c11d193 100644 --- a/sw/source/ui/inc/wrtsh.hxx +++ b/sw/source/ui/inc/wrtsh.hxx @@ -165,6 +165,8 @@ public: // Selektion von Rahmen aufheben void UnSelectFrm(); + void Invalidate(); + // Tabellenzellen selektieren fuer Bearbeiten von Formeln in der Ribbonbar inline void SelTblCells( const Link &rLink, BOOL bMark = TRUE ); inline void EndSelTblCells(); diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx index 0f3ae1d61764..865908568cd6 100644 --- a/sw/source/ui/lingu/olmenu.cxx +++ b/sw/source/ui/lingu/olmenu.cxx @@ -62,6 +62,7 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/frame/XModuleManager.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/i18n/ScriptType.hpp> #include <svx/dlgutil.hxx> #include <svtools/itemset.hxx> #include <svx/langitem.hxx> @@ -168,7 +169,7 @@ LanguageType lcl_CheckLanguage( SvtLinguOptions aLinguOpt; SvtLinguConfig().GetOptions( aLinguOpt ); // The default document language from "Tools/Options - Language Settings - Languages: Western" - aLangList[0] = aLinguOpt.nDefaultLanguage; + aLangList[0] = MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, ::com::sun::star::i18n::ScriptType::LATIN); // The one from "Tools/Options - Language Settings - Languages: User interface" aLangList[1] = rSettings.GetUILanguage(); // The one from "Tools/Options - Language Settings - Languages: Locale setting" diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx index 5ea6c1012baf..3f0c634f2b24 100644 --- a/sw/source/ui/misc/pgfnote.cxx +++ b/sw/source/ui/misc/pgfnote.cxx @@ -48,6 +48,7 @@ #include <vcl/field.hxx> #include <vcl/svapp.hxx> #include <unotools/localedatawrapper.hxx> +#include <svtools/syslocale.hxx> #include <svx/sizeitem.hxx> #include <svx/pageitem.hxx> #include <svtools/eitem.hxx> @@ -183,7 +184,7 @@ SwFootNotePage::SwFootNotePage(Window *pParent, const SfxItemSet &rSet) : SetMetric( aMaxHeightEdit, aMetric ); SetMetric( aDistEdit, aMetric ); SetMetric( aLineDistEdit, aMetric ); - MeasurementSystem eSys = GetAppLocaleData().getMeasurementSystemEnum(); + MeasurementSystem eSys = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); long nHeightValue = MEASURE_METRIC != eSys ? 1440 : 1134; aMaxHeightEdit.SetValue(aMaxHeightEdit.Normalize(nHeightValue),FUNIT_TWIP);; } diff --git a/sw/source/ui/misc/redlndlg.src b/sw/source/ui/misc/redlndlg.src index 81bc3e6fad93..e653f7e546a4 100644 --- a/sw/source/ui/misc/redlndlg.src +++ b/sw/source/ui/misc/redlndlg.src @@ -64,7 +64,7 @@ ModalDialog DLG_MOD_REDLINE_ACCEPT { HelpID = HID_REDLINE_AUTOFMT_ACCEPT ; REDLNDLG - Text [ en-US ] = "Accept or Reject AutoFormat Changes"; + Text [ en-US ] = "Accept or Reject AutoCorrect Changes"; }; Menu MN_REDLINE_POPUP diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx index c8422f665b7d..07745f3c01bb 100644 --- a/sw/source/ui/ribbar/inputwin.cxx +++ b/sw/source/ui/ribbar/inputwin.cxx @@ -461,8 +461,8 @@ IMPL_LINK( SwInputWindow, SelTblCellsNotify, SwWrtShell *, pCaller ) aPam.Move( fnMoveForward, fnGoSection ); IDocumentContentOperations* pIDCO = pWrtShell->getIDocumentContentOperations(); - pIDCO->Delete( aPam ); - pIDCO->Insert( aPam, sNew, true ); + pIDCO->DeleteRange( aPam ); + pIDCO->InsertString( aPam, sNew ); pWrtShell->EndAllAction(); sOldFml = sNew; } @@ -499,7 +499,7 @@ IMPL_LINK( SwInputWindow, ModifyHdl, InputEdit*, EMPTYARG ) sNew += CH_LRE; sNew += aEdit.GetText(); sNew += CH_PDF; - pWrtShell->SwEditShell::Insert( sNew ); + pWrtShell->SwEditShell::Insert2( sNew ); pWrtShell->EndAllAction(); sOldFml = sNew; } diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx index 054220be6707..1a34e2972956 100755 --- a/sw/source/ui/shells/annotsh.cxx +++ b/sw/source/ui/shells/annotsh.cxx @@ -347,7 +347,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) case SID_INSERT_ZWSP : cIns = CHAR_ZWSP ; break; case SID_INSERT_ZWNBSP: cIns = CHAR_ZWNBSP; break; } - pOLV->InsertText( String(cIns), TRUE ); + pOLV->InsertText( String(cIns)); rReq.Done(); break; } @@ -799,16 +799,18 @@ void SwAnnotationShell::ExecClpbrd(SfxRequest &rReq) switch (nSlot) { case SID_CUT: - pOLV->Cut(); + if ( (pPostItMgr->GetActivePostIt()->GetStatus()!=SwPostItHelper::DELETED) && pOLV->HasSelection() ) + pOLV->Cut(); break; case SID_COPY: - pOLV->Copy(); + if( pOLV->HasSelection() ) + pOLV->Copy(); break; case SID_PASTE: if (pPostItMgr->GetActivePostIt()->GetStatus()!=SwPostItHelper::DELETED) pOLV->Paste(); break; - case FN_PASTESPECIAL: + case SID_PASTE_SPECIAL: { if (pPostItMgr->GetActivePostIt()->GetStatus()!=SwPostItHelper::DELETED) { @@ -886,7 +888,7 @@ void SwAnnotationShell::StateClpbrd(SfxItemSet &rSet) break; } case SID_PASTE: - case FN_PASTESPECIAL: + case SID_PASTE_SPECIAL: { if( !bPastePossible ) rSet.DisableItem( nWhich ); @@ -1380,6 +1382,8 @@ void SwAnnotationShell::ExecUndo(SfxRequest &rReq) } } + rView.GetViewFrame()->GetBindings().InvalidateAll(sal_False); + if (rView.GetPostItMgr()->GetActivePostIt()) rView.GetPostItMgr()->GetActivePostIt()->ResizeIfNeccessary(aOldHeight,rView.GetPostItMgr()->GetActivePostIt()->GetPostItTextHeight()); } @@ -1595,7 +1599,7 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) aFontSet.Set( aOldSet ); // String einfuegen - pOLV->InsertText( sSym, TRUE ); + pOLV->InsertText( sSym); // attributieren (Font setzen) SfxItemSet aSetFont( *aFontSet.GetPool(), aFontSet.GetRanges() ); diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index 0c17c85dd301..9f5ee6195e81 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -301,11 +301,9 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq) if ( rSh.HasSelection() ) { SwTransferable* pTransfer = new SwTransferable( rSh ); -/*??*/ uno::Reference< - datatransfer::XTransferable > xRef( - pTransfer ); +/*??*/ uno::Reference< datatransfer::XTransferable > xRef( pTransfer ); - if ( nId == SID_CUT ) + if ( nId == SID_CUT && !rSh.IsSelObjProtected(FLYPROTECT_CONTENT|FLYPROTECT_PARENT) ) pTransfer->Cut(); else { @@ -405,7 +403,7 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq) } break; - case FN_PASTESPECIAL: + case SID_PASTE_SPECIAL: { TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( @@ -481,10 +479,10 @@ void SwBaseShell::StateClpbrd(SfxItemSet &rSet) rSet.DisableItem( SID_PASTE ); break; - case FN_PASTESPECIAL: + case SID_PASTE_SPECIAL: if( !GetView().IsPasteSpecialAllowed() ) { - rSet.DisableItem( FN_PASTESPECIAL ); + rSet.DisableItem( SID_PASTE_SPECIAL ); rSet.DisableItem( SID_PASTE_UNFORMATTED ); } break; @@ -539,6 +537,8 @@ void SwBaseShell::ExecUndo(SfxRequest &rReq) default: DBG_ERROR("falscher Dispatcher"); } + + GetView().GetViewFrame()->GetBindings().InvalidateAll(sal_False); } /*-------------------------------------------------------------------- diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx index d56cb88e9db8..11874ca5b151 100644 --- a/sw/source/ui/shells/drwtxtex.cxx +++ b/sw/source/ui/shells/drwtxtex.cxx @@ -828,15 +828,20 @@ void SwDrawTextShell::ExecClpbrd(SfxRequest &rReq) return; OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView(); + + ESelection aSel(pOLV->GetSelection()); + const sal_Bool bCopy = (aSel.nStartPara != aSel.nEndPara) || (aSel.nStartPos != aSel.nEndPos); sal_uInt16 nId = rReq.GetSlot(); switch( nId ) { case SID_CUT: - pOLV->Cut(); + if (bCopy) + pOLV->Cut(); return; case SID_COPY: - pOLV->Copy(); + if (bCopy) + pOLV->Copy(); return; case SID_PASTE: @@ -888,8 +893,8 @@ void SwDrawTextShell::StateClpbrd(SfxItemSet &rSet) } break; - case FN_PASTESPECIAL: - rSet.DisableItem( FN_PASTESPECIAL ); + case SID_PASTE_SPECIAL: + rSet.DisableItem( SID_PASTE_SPECIAL ); break; // --> OD 2008-06-20 #151110# case SID_CLIPBOARD_FORMAT_ITEMS: diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx index 99a2bf71bca7..9f1d49ebe067 100644 --- a/sw/source/ui/shells/drwtxtsh.cxx +++ b/sw/source/ui/shells/drwtxtsh.cxx @@ -514,7 +514,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq) case SID_INSERT_ZWSP : cIns = CHAR_ZWSP ; break; case SID_INSERT_ZWNBSP: cIns = CHAR_ZWNBSP; break; } - pOLV->InsertText( String(cIns), TRUE ); + pOLV->InsertText( String(cIns)); rReq.Done(); } break; @@ -640,6 +640,7 @@ void SwDrawTextShell::ExecUndo(SfxRequest &rReq) pUndoManager->Redo(0); } bCallBase = FALSE; + GetView().GetViewFrame()->GetBindings().InvalidateAll(sal_False); } break; } @@ -856,7 +857,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) aFontSet.Set( aOldSet ); // String einfuegen - pOLV->InsertText( sSym, TRUE ); + pOLV->InsertText( sSym ); // attributieren (Font setzen) SfxItemSet aFontAttribSet( *aFontSet.GetPool(), aFontSet.GetRanges() ); diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx index 3f61bab9a20e..f7957a66077a 100644 --- a/sw/source/ui/shells/frmsh.cxx +++ b/sw/source/ui/shells/frmsh.cxx @@ -50,6 +50,10 @@ #include <sfx2/request.hxx> #include <sfx2/objface.hxx> #include <svx/hlnkitem.hxx> +// --> OD 2009-07-07 #i73249# +#include <svx/svdview.hxx> +#include <vcl/msgbox.hxx> +// <-- #include <fmturl.hxx> @@ -82,6 +86,9 @@ #include <shells.hrc> #include "swabstdlg.hxx" #include "misc.hrc" +// --> OD 2009-07-14 #i73249# +#include <svx/dialogs.hrc> +// <-- using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -414,8 +421,13 @@ void SwFrameShell::Execute(SfxRequest &rReq) } aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell()))); aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName())); - if(nSel & nsSelectionType::SEL_OLE) - aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText())); + if( nSel & nsSelectionType::SEL_OLE ) + { + // --> OD 2009-07-13 #i73249# +// aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText())); + aSet.Put( SfxStringItem( FN_SET_FRM_ALT_NAME, rSh.GetObjTitle() ) ); + // <-- + } const SwRect &rPg = rSh.GetAnyCurRect(RECT_PAGE); SwFmtFrmSize aFrmSize(ATT_VAR_SIZE, rPg.Width(), rPg.Height()); @@ -472,7 +484,10 @@ void SwFrameShell::Execute(SfxRequest &rReq) } if (SFX_ITEM_SET == pOutSet->GetItemState(FN_SET_FRM_ALT_NAME, TRUE, &pItem)) { - rSh.SetAlternateText(((const SfxStringItem*)pItem)->GetValue()); + // --> OD 2009-07-13 #i73249# +// rSh.SetAlternateText(((const SfxStringItem*)pItem)->GetValue()); + rSh.SetObjTitle(((const SfxStringItem*)pItem)->GetValue()); + // <-- } // Vorlagen-AutoUpdate SwFrmFmt* pFmt = rSh.GetCurFrmFmt(); @@ -587,6 +602,40 @@ void SwFrameShell::Execute(SfxRequest &rReq) rReq.SetReturnValue(SfxBoolItem(nSlot, bMirror)); } break; + // --> OD 2009-07-14 #i73249# + case FN_TITLE_DESCRIPTION_SHAPE: + { + bUpdateMgr = FALSE; + SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList(); + if ( pSdrView && + pSdrView->GetMarkedObjectCount() == 1 ) + { + String aDescription(rSh.GetObjDescription()); + String aTitle(rSh.GetObjTitle()); + + SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); + OSL_ENSURE(pFact, "Dialogdiet fail!"); + AbstractSvxObjectTitleDescDialog* pDlg = + pFact->CreateSvxObjectTitleDescDialog( NULL, + aTitle, + aDescription, + RID_SVXDLG_OBJECT_TITLE_DESC ); + OSL_ENSURE(pDlg, "Dialogdiet fail!"); + + if ( pDlg->Execute() == RET_OK ) + { + pDlg->GetDescription(aDescription); + pDlg->GetTitle(aTitle); + + rSh.SetObjDescription(aDescription); + rSh.SetObjTitle(aTitle); + } + + delete pDlg; + } + } + break; + // <-- default: ASSERT( !this, "falscher Dispatcher" ); return; @@ -822,6 +871,20 @@ void SwFrameShell::GetState(SfxItemSet& rSet) rSet.DisableItem( nWhich ); } break; + // --> OD 2009-07-07 #i73249# + case FN_TITLE_DESCRIPTION_SHAPE: + { + SwWrtShell &rWrtSh = GetShell(); + SdrView* pSdrView = rWrtSh.GetDrawViewWithValidMarkList(); + if ( !pSdrView || + pSdrView->GetMarkedObjectCount() != 1 ) + { + rSet.DisableItem( nWhich ); + } + + } + break; + // <-- default: /* do nothing */; break; diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx index 62a3af2f6f28..7203d9c91ebb 100644 --- a/sw/source/ui/shells/grfsh.cxx +++ b/sw/source/ui/shells/grfsh.cxx @@ -154,8 +154,13 @@ void SwGrfShell::Execute(SfxRequest &rReq) aSet.Put( aFrmSize ); aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName())); - if(nSlot == FN_FORMAT_GRAFIC_DLG) - aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText())); + if ( nSlot == FN_FORMAT_GRAFIC_DLG ) + { + // --> OD 2009-07-13 #i73249# +// aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText())); + aSet.Put( SfxStringItem( FN_SET_FRM_ALT_NAME, rSh.GetObjTitle() ) ); + // <-- + } pRect = &rSh.GetAnyCurRect(RECT_PAGE_PRT); aFrmSize.SetWidth( pRect->Width() ); @@ -324,10 +329,15 @@ void SwGrfShell::Execute(SfxRequest &rReq) sFilterNm, 0 ); } } - if( SFX_ITEM_SET == pSet->GetItemState( + if ( SFX_ITEM_SET == pSet->GetItemState( FN_SET_FRM_ALT_NAME, TRUE, &pItem )) - rSh.SetAlternateText( - ((const SfxStringItem*)pItem)->GetValue() ); + { + // --> OD 2009-07-13 #i73249# +// rSh.SetAlternateText( +// ((const SfxStringItem*)pItem)->GetValue() ); + rSh.SetObjTitle( ((const SfxStringItem*)pItem)->GetValue() ); + // <-- + } SfxItemSet aGrfSet( rSh.GetAttrPool(), RES_GRFATR_BEGIN, RES_GRFATR_END-1 ); diff --git a/sw/source/ui/shells/shells.src b/sw/source/ui/shells/shells.src index 9036f05fd983..8a5a29046bd6 100644 --- a/sw/source/ui/shells/shells.src +++ b/sw/source/ui/shells/shells.src @@ -98,7 +98,7 @@ String STR_REDLINE_DELETED }; String STR_REDLINE_AUTOFMT { - Text [ en-US ] = "AutoFormat"; + Text [ en-US ] = "AutoCorrect"; Text [ x-comment ] = " "; }; String STR_REDLINE_FORMATED @@ -118,12 +118,12 @@ String STR_REDLINE_FMTCOLLSET }; String STR_REDLINE_TITLE { - Text [ en-US ] = "AutoFormat"; + Text [ en-US ] = "AutoCorrect"; Text [ x-comment ] = " "; }; String STR_REDLINE_MSG { - Text [ en-US ] = "AutoFormat completed.\nYou can accept or reject all changes,\nor accept or reject particular changes."; + Text [ en-US ] = "AutoCorrect completed.\nYou can accept or reject all changes,\nor accept or reject particular changes."; Text [ x-comment ] = " "; }; String STR_REDLINE_ACCEPT_ALL diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx index 599be5f1f1e1..0dedb918aaf5 100644 --- a/sw/source/ui/shells/textfld.cxx +++ b/sw/source/ui/shells/textfld.cxx @@ -382,7 +382,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) SwFmtFld* pSwFmtFld = static_cast<SwFmtFld*>(pFirst); if ( pSwFmtFld->GetFld() == pPostIt ) { - pSwFmtFld->Broadcast( SwFmtFldHint( 0, SWFMTFLD_FOCUS ) ); + pSwFmtFld->Broadcast( SwFmtFldHint( 0, SWFMTFLD_FOCUS, &GetView() ) ); break; } pFirst = aIter++; @@ -402,7 +402,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) sComment = pRedline->GetComment(); if ( sComment == String(rtl::OUString::createFromAscii("")) ) GetView().GetDocShell()->Broadcast(SwRedlineHint(pRedline,SWREDLINE_INSERTED)); - const_cast<SwRedline*>(pRedline)->Broadcast(SwRedlineHint(pRedline,SWREDLINE_FOCUS)); + const_cast<SwRedline*>(pRedline)->Broadcast(SwRedlineHint(pRedline,SWREDLINE_FOCUS,&GetView())); } */ diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx index 742e93b646c2..7e38c1297d0b 100644 --- a/sw/source/ui/shells/textsh.cxx +++ b/sw/source/ui/shells/textsh.cxx @@ -819,7 +819,11 @@ void SwTextShell::StateInsert( SfxItemSet &rSet ) rSh.Push(); const BOOL bCrsrInHidden = rSh.SelectHiddenRange(); - rSh.Pop(FALSE); + // --> OD 2009-08-05 #i103839#, #b6855246# + // Do not call method <SwCrsrShell::Pop(..)> with 1st parameter = <FALSE> + // in order to avoid that the view jumps to the visible cursor. + rSh.Pop(); + // <-- while ( nWhich ) { @@ -827,8 +831,11 @@ void SwTextShell::StateInsert( SfxItemSet &rSet ) { case SID_INSERT_SOUND: case SID_INSERT_VIDEO: + /*!SvxPluginFileDlg::IsAvailable( nWhich ) || + + discussed with mba: for performance reasons we skip the IsAvailable call here + */ if ( GetShell().IsSelFrmMode() || - !SvxPluginFileDlg::IsAvailable( nWhich ) || SFX_CREATE_MODE_EMBEDDED == eCreateMode || bCrsrInHidden ) { rSet.DisableItem( nWhich ); diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index 8928a505dd87..977dc77c98d3 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -488,9 +488,10 @@ void SwTextShell::Execute(SfxRequest &rReq) RES_CHRATR_CJK_LANGUAGE + 1, RES_CHRATR_CTL_LANGUAGE - 1, RES_CHRATR_CTL_LANGUAGE + 1, RES_CHRATR_END-1, RES_PARATR_BEGIN, RES_PARATR_END-1, - RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, - RES_TXTATR_CJK_RUBY, RES_TXTATR_UNKNOWN_CONTAINER, + RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, + RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY, + RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, 0 }; @@ -1044,7 +1045,14 @@ void SwTextShell::Execute(SfxRequest &rReq) // --> OD 2008-03-18 #refactorlists# String sContinuedListId; const SwNumRule* pRule = - rWrtSh.SearchNumRule( FALSE, TRUE, FALSE, -1, sContinuedListId ); + rWrtSh.SearchNumRule( false, true, false, -1, sContinuedListId ); + // --> OD 2009-08-26 #i86492# + // Search also for bullet list + if ( !pRule ) + { + pRule = rWrtSh.SearchNumRule( false, false, false, -1, sContinuedListId ); + } + // <-- if ( pRule ) { rWrtSh.SetCurNumRule( *pRule, false, sContinuedListId ); @@ -1623,14 +1631,23 @@ void SwTextShell::GetState( SfxItemSet &rSet ) break; case FN_NUM_CONTINUE: { - if ( rSh.GetCurNumRule() ) - rSet.DisableItem(nWhich); - else + // --> OD 2009-08-26 #i86492# + // Allow continuation of previous list, even if at current cursor + // a list is active. +// if ( rSh.GetCurNumRule() ) +// rSet.DisableItem(nWhich); +// else + // <-- { - // --> OD 2008-03-18 #refactorlists# + // --> OD 2009-08-26 #i86492# + // Search also for bullet list String aDummy; const SwNumRule* pRule = - rSh.SearchNumRule( FALSE, TRUE, FALSE, -1, aDummy ); + rSh.SearchNumRule( false, true, false, -1, aDummy ); + if ( !pRule ) + { + pRule = rSh.SearchNumRule( false, false, false, -1, aDummy ); + } // <-- if ( !pRule ) rSet.DisableItem(nWhich); diff --git a/sw/source/ui/table/insrc.cxx b/sw/source/ui/table/insrc.cxx deleted file mode 100644 index 0589b1351538..000000000000 --- a/sw/source/ui/table/insrc.cxx +++ /dev/null @@ -1,94 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: insrc.cxx,v $ - * $Revision: 1.10 $ - * - * 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. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sw.hxx" -#ifdef SW_DLLIMPLEMENTATION -#undef SW_DLLIMPLEMENTATION -#endif - - -#include <sfx2/dispatch.hxx> -#include <svtools/eitem.hxx> -#include <svtools/intitem.hxx> - -#include "cmdid.h" -#include "swtypes.hxx" -#include "insrc.hxx" -#include "view.hxx" -#include "table.hrc" -#include "insrc.hrc" - -void SwInsRowColDlg::Apply() -{ - USHORT nSlot = bColumn ? FN_TABLE_INSERT_COL : FN_TABLE_INSERT_ROW; - SfxUInt16Item aCountItem( nSlot, static_cast< UINT16 >(aCountEdit.GetValue()) ); - SfxBoolItem aAfter( FN_PARAM_INSERT_AFTER, aAfterBtn.IsChecked() ); - rView.GetViewFrame()->GetDispatcher()->Execute( nSlot, - SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD, - &aCountItem, &aAfter, 0L); -} - - - -SwInsRowColDlg::SwInsRowColDlg(SwView& rVw, BOOL bCol ) - : SvxStandardDialog( rVw.GetWindow(), SW_RES(DLG_INS_ROW_COL) ), - aCount( this, SW_RES( FT_COUNT ) ), - aCountEdit( this, SW_RES( ED_COUNT ) ), - aInsFL( this, SW_RES( FL_INS ) ), - aBeforeBtn( this, SW_RES( CB_POS_BEFORE ) ), - aAfterBtn( this, SW_RES( CB_POS_AFTER ) ), - aPosFL( this, SW_RES( FL_POS ) ), - aRow(SW_RES(STR_ROW)), - aCol(SW_RES(STR_COL)), - aOKBtn( this, SW_RES( BT_OK ) ), - aCancelBtn( this, SW_RES( BT_CANCEL ) ), - aHelpBtn( this, SW_RES( BT_HELP ) ), - rView(rVw), - bColumn( bCol ) -{ - FreeResource(); - String aTmp( GetText() ); - if( bColumn ) - { - aTmp += aCol; - SetHelpId( FN_TABLE_INSERT_COL_DLG ); - } - else - { - aTmp += aRow; - SetHelpId( FN_TABLE_INSERT_ROW_DLG ); - } - SetText( aTmp ); -} - - - - diff --git a/sw/source/ui/table/insrc.hrc b/sw/source/ui/table/insrc.hrc deleted file mode 100644 index e07c7cb2f1d5..000000000000 --- a/sw/source/ui/table/insrc.hrc +++ /dev/null @@ -1,43 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: insrc.hrc,v $ - * $Revision: 1.4 $ - * - * 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. - * - ************************************************************************/ -#define FT_COUNT 1 -#define ED_COUNT 2 -#define FL_INS 3 - -#define CB_POS_BEFORE 10 -#define CB_POS_AFTER 11 -#define FL_POS 12 - -#define STR_ROW 20 -#define STR_COL 21 - -#define BT_OK 100 -#define BT_CANCEL 101 -#define BT_HELP 102 diff --git a/sw/source/ui/table/insrc.src b/sw/source/ui/table/insrc.src deleted file mode 100644 index 3c8c0e1311ba..000000000000 --- a/sw/source/ui/table/insrc.src +++ /dev/null @@ -1,155 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: insrc.src,v $ - * $Revision: 1.32 $ - * - * 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 "table.hrc" -#include "insrc.hrc" -#include "helpid.h" - // #define DLG_INS_ROW_COL 256 -ModalDialog DLG_INS_ROW_COL -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 136 , 84 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Einfgen : Einfgen */ - Text [ en-US ] = "Insert" ; - Moveable = TRUE ; - OKButton BT_OK - { - Pos = MAP_APPFONT ( 80 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BT_CANCEL - { - Pos = MAP_APPFONT ( 80 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BT_HELP - { - Pos = MAP_APPFONT ( 80 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - RadioButton CB_POS_BEFORE - { - Pos = MAP_APPFONT ( 12 , 49 ) ; - Size = MAP_APPFONT ( 56 , 10 ) ; - Text [ en-US ] = "~Before" ; - TabStop = TRUE ; - }; - RadioButton CB_POS_AFTER - { - Pos = MAP_APPFONT ( 12 , 62 ) ; - Size = MAP_APPFONT ( 56 , 10 ) ; - Text [ en-US ] = "A~fter" ; - TabStop = TRUE ; - Check = TRUE ; - }; - NumericField ED_COUNT - { - Border = TRUE ; - Pos = MAP_APPFONT ( 44 , 14 ) ; - Size = MAP_APPFONT ( 24 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - Maximum = 99 ; - Value = 1 ; - First = 1 ; - Last = 5 ; - }; - FixedLine FL_INS - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 68 , 8 ) ; - Text [ en-US ] = "Insert" ; - }; - FixedLine FL_POS - { - Pos = MAP_APPFONT ( 6 , 38 ) ; - Size = MAP_APPFONT ( 68 , 8 ) ; - Text [ en-US ] = "Position"; - }; - FixedText FT_COUNT - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 30 , 8 ) ; - Text [ en-US ] = "~Number" ; - Left = TRUE ; - }; - String STR_ROW - { - Text [ en-US ] = " Rows" ; - }; - String STR_COL - { - Text [ en-US ] = " Columns" ; - }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index 8fe6b9511f8f..93ae56fbca73 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -1580,6 +1580,10 @@ void SwPagePreView::GetState( SfxItemSet& rSet ) { switch(nWhich) { + case SID_BROWSER_MODE: + case FN_PRINT_LAYOUT: + rSet.DisableItem(nWhich); + break; case FN_START_OF_DOCUMENT: { if ( pPagePrevwLay->IsPageVisible( 1 ) ) @@ -2304,13 +2308,11 @@ void SwPagePreView::DocSzChgd( const Size &rSz ) aDocSz = rSz; - // die neue Anzahl von Seiten bestimmen - USHORT nNewCnt = GetViewShell()->GetNumPages(); - if( nNewCnt == mnPageCount ) - return; + // --> OD 2009-08-20 #i96726# + // Due to the multiple page layout it is needed to trigger recalculation + // of the page preview layout, even if the count of pages is not changing. + mnPageCount = GetViewShell()->GetNumPages(); - // dann eine neue Startseite berechnen - mnPageCount = nNewCnt; if( aVisArea.GetWidth() ) { ChgPage( SwPagePreViewWin::MV_CALC, TRUE ); @@ -2318,6 +2320,7 @@ void SwPagePreView::DocSzChgd( const Size &rSz ) aViewWin.Invalidate(); } + // <-- } /*-------------------------------------------------------------------- @@ -2492,6 +2495,10 @@ SfxPrinter* SwPagePreView::GetPrinter( BOOL bCreate ) USHORT SwPagePreView::SetPrinter( SfxPrinter *pNew, USHORT nDiffFlags, bool ) { ViewShell &rSh = *GetViewShell(); + SfxPrinter* pOld = rSh.getIDocumentDeviceAccess()->getPrinter( false ); + if ( pOld && pOld->IsPrinting() ) + return SFX_PRINTERROR_BUSY; + SwEditShell &rESh = (SwEditShell&)rSh; //Buh... if( ( SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP ) & nDiffFlags ) { diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx index 34cfebe663a1..d30e85c5ee71 100644 --- a/sw/source/ui/uiview/srcview.cxx +++ b/sw/source/ui/uiview/srcview.cxx @@ -57,6 +57,7 @@ #include <sfx2/app.hxx> #include <sfx2/objface.hxx> #include <sfx2/viewfrm.hxx> +#include <sfx2/bindings.hxx> #include <sfx2/docfilt.hxx> #include <sfx2/fcontnr.hxx> #include <sfx2/request.hxx> @@ -457,17 +458,21 @@ void SwSrcView::Execute(SfxRequest& rReq) break; case SID_UNDO: pTextView->Undo(); + GetViewFrame()->GetBindings().InvalidateAll(FALSE); break; case SID_REDO: pTextView->Redo(); + GetViewFrame()->GetBindings().InvalidateAll(FALSE); break; case SID_REPEAT: break; case SID_CUT: - pTextView->Cut(); + if(pTextView->HasSelection()) + pTextView->Cut(); break; case SID_COPY: - pTextView->Copy(); + if(pTextView->HasSelection()) + pTextView->Copy(); break; case SID_PASTE: pTextView->Paste(); @@ -588,6 +593,8 @@ void SwSrcView::GetState(SfxItemSet& rSet) case SID_DIRECTEXPORTDOCASPDF: case SID_EXPORTDOC: case SID_REPEAT: + case SID_BROWSER_MODE: + case FN_PRINT_LAYOUT: rSet.DisableItem(nWhich); break; case SID_CUT: @@ -731,6 +738,10 @@ USHORT SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem, USHORT SwSrcView::SetPrinter(SfxPrinter* pNew, USHORT nDiffFlags, bool ) { SwDocShell* pDocSh = GetDocShell(); + SfxPrinter* pOld = pDocSh->GetDoc()->getPrinter( false ); + if ( pOld && pOld->IsPrinting() ) + return SFX_PRINTERROR_BUSY; + if ( (SFX_PRINTER_JOBSETUP | SFX_PRINTER_PRINTER) & nDiffFlags ) { pDocSh->GetDoc()->setPrinter( pNew, true, true ); diff --git a/sw/source/ui/uiview/uivwimp.cxx b/sw/source/ui/uiview/uivwimp.cxx index d9634fc301ec..4154139f6ee1 100644 --- a/sw/source/ui/uiview/uivwimp.cxx +++ b/sw/source/ui/uiview/uivwimp.cxx @@ -335,48 +335,14 @@ void SAL_CALL SwClipboardChangeListener::changedContents( const CLIP_NMSPC::Clip SfxBindings& rBind = pView->GetViewFrame()->GetBindings(); rBind.Invalidate( SID_PASTE ); - rBind.Invalidate( FN_PASTESPECIAL ); + rBind.Invalidate( SID_PASTE_SPECIAL ); rBind.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS ); } } void SwClipboardChangeListener::AddRemoveListener( BOOL bAdd ) { - try - { - do { - -#ifdef _DONT_WORD_FOR_WEBTOP_ -JP 4.7.2001: change for WebTop - get Clipboard from the Window. - Reference< XMultiServiceFactory > xFact( - ::comphelper::getProcessServiceFactory() ); - if( !xFact.is() ) - break; - Reference< XClipboard > xClipboard( xFact->createInstance( - ::rtl::OUString::createFromAscii( - "com.sun.star.datatransfer.clipboard.SystemClipboard" )), - UNO_QUERY ); -#else - Reference< XClipboard > xClipboard( - pView->GetEditWin().GetClipboard() ); -#endif - if( !xClipboard.is() ) - break; - - Reference< XClipboardNotifier > xClpbrdNtfr( xClipboard, UNO_QUERY ); - if( xClpbrdNtfr.is() ) - { - Reference< XClipboardListener > xClipEvtLstnr( this ); - if( bAdd ) - xClpbrdNtfr->addClipboardListener( xClipEvtLstnr ); - else - xClpbrdNtfr->removeClipboardListener( xClipEvtLstnr ); - } - } while ( FALSE ); - } - catch( const uno::Exception& ) - { - } + pView->AddRemoveClipboardListener( Reference< XClipboardListener >( this ), bAdd ); } diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index 5e3afd2ed8fa..a13f25d8933e 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -56,93 +56,46 @@ #include <svx/extrusionbar.hxx> #include <svx/fontworkbar.hxx> #include <unotxvw.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _SWHINTS_HXX #include <swhints.hxx> -#endif #include <swmodule.hxx> #include <inputwin.hxx> #include <chartins.hxx> #include <uivwimp.hxx> #include <uitool.hxx> #include <edtwin.hxx> -#ifndef _TEXTSH_HXX #include <textsh.hxx> -#endif -#ifndef _LISTSH_HXX #include <listsh.hxx> -#endif -#ifndef _TABSH_HXX #include <tabsh.hxx> -#endif -#ifndef _GRFSH_HXX #include <grfsh.hxx> -#endif -#ifndef _MEDIASH_HXX #include <mediash.hxx> -#endif -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <frmsh.hxx> -#ifndef _OLESH_HXX #include <olesh.hxx> -#endif -#ifndef _DRAWSH_HXX #include <drawsh.hxx> -#endif -#ifndef _DRAWBASE_HXX #include <drawbase.hxx> -#endif -#ifndef _DRFORMSH_HXX #include <drformsh.hxx> -#endif -#ifndef _DRWTXTSH_HXX #include <drwtxtsh.hxx> -#endif -#ifndef _BEZIERSH_HXX #include <beziersh.hxx> -#endif -#ifndef _GLOBDOC_HXX #include <globdoc.hxx> -#endif #include <scroll.hxx> -#ifndef _GLOBDOC_HXX #include <globdoc.hxx> -#endif #include <navipi.hxx> #include <gloshdl.hxx> #include <usrpref.hxx> -#ifndef _SRCVIEW_HXX #include <srcview.hxx> -#endif #include <doc.hxx> -#ifndef _WDOCSH_HXX +#include <drawdoc.hxx> #include <wdocsh.hxx> -#endif -#ifndef _WVIEW_HXX #include <wview.hxx> -#endif #include <workctrl.hxx> #include <wrtsh.hxx> -#ifndef _BARCFG_HXX #include <barcfg.hxx> -#endif -#ifndef _PVIEW_HXX #include <pview.hxx> -#endif #include <swdtflvr.hxx> -#ifndef _VIEW_HRC #include <view.hrc> -#endif -#ifndef _GLOBDOC_HRC #include <globdoc.hrc> -#endif -#ifndef _FRMUI_HRC #include <frmui.hrc> -#endif #include <cfgitems.hxx> #include <prtopt.hxx> #include <swprtopt.hxx> @@ -152,9 +105,7 @@ #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/scanner/ScannerContext.hpp> #include <com/sun/star/scanner/XScannerManager.hpp> -#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/unohlp.hxx> -#endif #include <rtl/ustrbuf.hxx> #include <xmloff/xmluconv.hxx> @@ -673,7 +624,7 @@ void SwView::_CheckReadonlyState() SID_UNDO, SID_REDO, SID_REPEAT, SID_PASTE, SID_PASTE_UNFORMATTED, - FN_PASTESPECIAL, SID_SBA_BRW_INSERT, + SID_PASTE_SPECIAL, SID_SBA_BRW_INSERT, SID_BACKGROUND_COLOR, FN_INSERT_BOOKMARK, SID_CHARMAP, FN_INSERT_SOFT_HYPHEN, FN_INSERT_HARDHYPHEN, FN_INSERT_HARD_SPACE, FN_INSERT_BREAK, @@ -1781,7 +1732,18 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) CreateTab(); else KillTab(); - SfxBoolItem aItem( SID_FM_DESIGN_MODE, !GetDocShell()->IsReadOnly()); + bool bReadonly = GetDocShell()->IsReadOnly(); + //#i76332# if document is to be opened in alive-mode then this has to be regarded while switching from readonly-mode to edit-mode + if( !bReadonly ) + { + SwDrawDocument * pDrawDoc = 0; + if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > (GetDocShell()->GetDoc()->GetDrawModel() ) ) ) + { + if( !pDrawDoc->GetOpenInDesignMode() ) + break;// don't touch the design mode + } + } + SfxBoolItem aItem( SID_FM_DESIGN_MODE, !bReadonly); GetDispatcher().Execute( SID_FM_DESIGN_MODE, SFX_CALLMODE_ASYNCHRON, &aItem, 0L ); } diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index 6a03909d92f9..77c06f44c494 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -1233,7 +1233,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) if (nPageCnt != nCnt) // Basic benachrichtigen { nPageCnt = nCnt; - SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_PAGE_COUNT, GetViewFrame()->GetObjectShell()), FALSE); + SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_PAGE_COUNT, SwDocShell::GetEventName(STR_SW_EVENT_PAGE_COUNT), GetViewFrame()->GetObjectShell()), FALSE); } } break; diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx index 6d219e71ab30..5e45f9a9a48c 100644 --- a/sw/source/ui/uiview/viewprt.cxx +++ b/sw/source/ui/uiview/viewprt.cxx @@ -141,6 +141,10 @@ void SetPrinter( IDocumentDeviceAccess* pIDDA, SfxPrinter* pNew, BOOL bWeb ) USHORT __EXPORT SwView::SetPrinter(SfxPrinter* pNew, USHORT nDiffFlags, bool ) { SwWrtShell &rSh = GetWrtShell(); + SfxPrinter* pOld = rSh.getIDocumentDeviceAccess()->getPrinter( false ); + if ( pOld && pOld->IsPrinting() ) + return SFX_PRINTERROR_BUSY; + if ( (SFX_PRINTER_JOBSETUP | SFX_PRINTER_PRINTER) & nDiffFlags ) { rSh.getIDocumentDeviceAccess()->setPrinter( pNew, true, true ); @@ -431,9 +435,19 @@ ErrCode SwView::DoPrint( SfxPrinter *pPrinter, PrintDialog *pDlg, BOOL bSilent, } pProgress->Stop(); - pProgress->DeleteOnEndPrint(); - pPrinter->EndJob(); - return pPrinter->GetError(); + if ( pPrinter->IsJobActive() ) + { + pProgress->DeleteOnEndPrint(); + pPrinter->EndJob(); + return pPrinter->GetError(); + } + else + { + // the next call might destroy pPrinter (in case it is not the usual document printer); so get the error before + ULONG nError = pPrinter->GetError(); + pProgress->DeleteOnEndPrint(); + return nError; + } } diff --git a/sw/source/ui/uno/swdetect.cxx b/sw/source/ui/uno/swdetect.cxx index ac2f6b5ce130..82da0914124a 100644 --- a/sw/source/ui/uno/swdetect.cxx +++ b/sw/source/ui/uno/swdetect.cxx @@ -217,7 +217,7 @@ SwFilterDetect::~SwFilterDetect() BOOL bIsStorage = aMedium.IsStorage(); if ( bIsStorage ) { - uno::Reference< embed::XStorage > xStorage = aMedium.GetStorage(); + uno::Reference< embed::XStorage > xStorage = aMedium.GetStorage( sal_False ); if ( aMedium.GetLastStorageCreationState() != ERRCODE_NONE ) { // error during storage creation means _here_ that the medium diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx index 0c67e24b8d10..2b302245f53b 100644 --- a/sw/source/ui/uno/unoatxt.cxx +++ b/sw/source/ui/uno/unoatxt.cxx @@ -416,7 +416,8 @@ sal_Bool lcl_CopySelToDoc( SwDoc* pInsDoc, OTextCursorHelper* pxCursor, SwXTextR if(pxCursor) { SwPaM* pUnoCrsr = pxCursor->GetPaM(); - bRet |= (true == pxCursor->GetDoc()->Copy( *pUnoCrsr, aPos, false )); + bRet = pxCursor->GetDoc()->CopyRange( *pUnoCrsr, aPos, false ) + || bRet; } else { @@ -424,7 +425,8 @@ sal_Bool lcl_CopySelToDoc( SwDoc* pInsDoc, OTextCursorHelper* pxCursor, SwXTextR if(pBkmk && pBkmk->IsExpanded()) { SwPaM aTmp(pBkmk->GetOtherMarkPos(), pBkmk->GetMarkPos()); - bRet |= (true == pxRange->GetDoc()->Copy(aTmp, aPos, false)); + bRet = pxRange->GetDoc()->CopyRange(aTmp, aPos, false) + || bRet; } } } diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx index 3acb1e25bd31..fed4c2b201cf 100644 --- a/sw/source/ui/uno/unomailmerge.cxx +++ b/sw/source/ui/uno/unomailmerge.cxx @@ -830,9 +830,9 @@ uno::Any SAL_CALL SwXMailMerge::execute( DBG_ASSERT( !pOldSrc || pOldSrc == this, "Ooops... different event source already set." ); pMgr->SetMailMergeEvtSrc( this ); // launch events for listeners - SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, xCurDocSh)); + SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), xCurDocSh)); BOOL bSucc = pMgr->MergeNew( aMergeDesc ); - SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE_END, xCurDocSh)); + SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE_END, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE_END), xCurDocSh)); pMgr->SetMailMergeEvtSrc( pOldSrc ); diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx index 19d0faa0bfce..bfdb2b1d2460 100644 --- a/sw/source/ui/uno/unomod.cxx +++ b/sw/source/ui/uno/unomod.cxx @@ -125,7 +125,10 @@ enum SwPrintSettingsPropertyHandles HANDLE_PRINTSET_PAPER_FROM_SETUP, HANDLE_PRINTSET_TABLES, HANDLE_PRINTSET_SINGLE_JOBS, - HANDLE_PRINTSET_EMPTY_PAGES + HANDLE_PRINTSET_EMPTY_PAGES, + HANDLE_PRINTSET_PROSPECT_RTL, + HANDLE_PRINTSET_PLACEHOLDER, + HANDLE_PRINTSET_HIDDEN_TEXT }; static ChainablePropertySetInfo * lcl_createViewSettingsInfo() @@ -186,14 +189,17 @@ static ChainablePropertySetInfo * lcl_createPrintSettingsInfo() { RTL_CONSTASCII_STRINGPARAM ( "PrintControls" ), HANDLE_PRINTSET_CONTROLS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "PrintDrawings" ), HANDLE_PRINTSET_DRAWINGS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "PrintGraphics" ), HANDLE_PRINTSET_GRAPHICS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, + { RTL_CONSTASCII_STRINGPARAM ( "PrintHiddenText"), HANDLE_PRINTSET_HIDDEN_TEXT , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "PrintLeftPages" ), HANDLE_PRINTSET_LEFT_PAGES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "PrintPageBackground" ), HANDLE_PRINTSET_PAGE_BACKGROUND , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "PrintProspect" ), HANDLE_PRINTSET_PROSPECT , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, + { RTL_CONSTASCII_STRINGPARAM ( "PrintProspectRTL" ), HANDLE_PRINTSET_PROSPECT_RTL , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "PrintReversed" ), HANDLE_PRINTSET_REVERSED , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "PrintRightPages" ), HANDLE_PRINTSET_RIGHT_PAGES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "PrintFaxName" ), HANDLE_PRINTSET_FAX_NAME , CPPUTYPE_OUSTRING, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "PrintPaperFromSetup" ), HANDLE_PRINTSET_PAPER_FROM_SETUP , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "PrintTables" ), HANDLE_PRINTSET_TABLES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, + { RTL_CONSTASCII_STRINGPARAM ( "PrintTextPlaceholder"), HANDLE_PRINTSET_PLACEHOLDER , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "PrintSingleJobs" ), HANDLE_PRINTSET_SINGLE_JOBS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "PrintEmptyPages" ), HANDLE_PRINTSET_EMPTY_PAGES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { 0, 0, 0, CPPUTYPE_UNKNOWN, 0, 0 } @@ -456,6 +462,24 @@ void SwXPrintSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, throw lang::IllegalArgumentException(); } break; + case HANDLE_PRINTSET_PROSPECT_RTL: + { + bVal = *(sal_Bool*)rValue.getValue(); + mpPrtOpt->SetPrintProspect_RTL(bVal); + } + break; + case HANDLE_PRINTSET_PLACEHOLDER: + { + bVal = *(sal_Bool*)rValue.getValue(); + mpPrtOpt->SetPrintTextPlaceholder(bVal); + } + break; + case HANDLE_PRINTSET_HIDDEN_TEXT: + { + bVal = *(sal_Bool*)rValue.getValue(); + mpPrtOpt->SetPrintHiddenText(bVal); + } + break; default: throw UnknownPropertyException(); } @@ -550,6 +574,21 @@ void SwXPrintSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, rValue <<= mpPrtOpt->GetFaxName(); } break; + case HANDLE_PRINTSET_PROSPECT_RTL: + { + rValue <<= mpPrtOpt->IsPrintProspect_RTL(); + } + break; + case HANDLE_PRINTSET_PLACEHOLDER: + { + rValue <<= mpPrtOpt->IsPrintTextPlaceholder(); + } + break; + case HANDLE_PRINTSET_HIDDEN_TEXT: + { + rValue <<= mpPrtOpt->IsPrintHiddenText(); + } + break; default: throw UnknownPropertyException(); } @@ -1024,3 +1063,4 @@ Sequence< OUString > SwXViewSettings::getSupportedServiceNames(void) throw( Runt pArray[0] = C2U("com.sun.star.text.ViewSettings"); return aRet; } + diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 04a26d47b324..db81543fb883 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -81,7 +81,13 @@ #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/util/XNumberFormatsSupplier.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> +#include <com/sun/star/beans/XFastPropertySet.hpp> #include <com/sun/star/document/RedlineDisplayType.hpp> +#include <com/sun/star/document/XDocumentEventBroadcaster.hpp> +#include <com/sun/star/frame/XController.hpp> +#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/script/XInvocation.hpp> +#include <com/sun/star/reflection/XIdlClassProvider.hpp> #include <svx/linkmgr.hxx> #include <svx/unofill.hxx> #include <svx/unolingu.hxx> @@ -236,15 +242,23 @@ sal_Int64 SAL_CALL SwXTextDocument::getSomething( const Sequence< sal_Int8 >& rI Any SAL_CALL SwXTextDocument::queryInterface( const uno::Type& rType ) throw(RuntimeException) { Any aRet = SwXTextDocumentBaseClass::queryInterface(rType); - if(aRet.getValueType() == getVoidCppuType()) + if ( !aRet.hasValue() ) aRet = SfxBaseModel::queryInterface(rType); - if(aRet.getValueType() == getVoidCppuType() && + if ( !aRet.hasValue() && rType == ::getCppuType((Reference<lang::XMultiServiceFactory>*)0)) { Reference<lang::XMultiServiceFactory> xTmp = this; aRet <<= xTmp; } - if(aRet.getValueType() == getVoidCppuType()) + + if ( !aRet.hasValue() + && rType != ::getCppuType((Reference< com::sun::star::document::XDocumentEventBroadcaster>*)0) + && rType != ::getCppuType((Reference< com::sun::star::frame::XController>*)0) + && rType != ::getCppuType((Reference< com::sun::star::frame::XFrame>*)0) + && rType != ::getCppuType((Reference< com::sun::star::script::XInvocation>*)0) + && rType != ::getCppuType((Reference< com::sun::star::reflection::XIdlClassProvider>*)0) + && rType != ::getCppuType((Reference< com::sun::star::beans::XFastPropertySet>*)0) + && rType != ::getCppuType((Reference< com::sun::star::awt::XWindow>*)0)) { GetNumberFormatter(); if(xNumFmtAgg.is()) diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx index ce02579370a9..e86270c55e12 100644 --- a/sw/source/ui/utlui/content.cxx +++ b/sw/source/ui/utlui/content.cxx @@ -906,16 +906,17 @@ SwContentTree::SwContentTree(Window* pParent, const ResId& rResId) : sRename(SW_RES(ST_RENAME)), sReadonlyIdx(SW_RES(ST_READONLY_IDX)), sInvisible(SW_RES(ST_INVISIBLE)), - sPostItShow(SW_RES(ST_POSTIT_SHOW)), - sPostItHide(SW_RES(ST_POSTIT_HIDE)), - sPostItDelete(SW_RES(ST_POSTIT_DELETE)), + + sPostItShow(SW_RES(ST_POSTIT_SHOW)), + sPostItHide(SW_RES(ST_POSTIT_HIDE)), + sPostItDelete(SW_RES(ST_POSTIT_DELETE)), pHiddenShell(0), - pActiveShell(0), - pConfig(SW_MOD()->GetNavigationConfig()), + pActiveShell(0), + pConfig(SW_MOD()->GetNavigationConfig()), nActiveBlock(0), - nHiddenBlock(0), + nHiddenBlock(0), nRootType(USHRT_MAX), nLastSelType(USHRT_MAX), @@ -2929,6 +2930,7 @@ void SwContentTree::EditEntry(SvLBoxEntry* pEntry, sal_uInt8 nMode) break; case CONTENT_TYPE_POSTIT: + pActiveShell->GetView().GetPostItMgr()->AssureStdModeAtShell(); if(nMode == EDIT_MODE_DELETE) { if (((SwPostItContent*)pCnt)->IsPostIt()) @@ -3097,6 +3099,7 @@ void SwContentTree::GotoContent(SwContent* pCnt) } break; case CONTENT_TYPE_POSTIT: + pActiveShell->GetView().GetPostItMgr()->AssureStdModeAtShell(); if (((SwPostItContent*)pCnt)->IsPostIt()) pActiveShell->GotoFld(*((SwPostItContent*)pCnt)->GetPostIt()); else diff --git a/sw/source/ui/utlui/initui.cxx b/sw/source/ui/utlui/initui.cxx index 98224a81edde..275b49a4c9e4 100644 --- a/sw/source/ui/utlui/initui.cxx +++ b/sw/source/ui/utlui/initui.cxx @@ -54,6 +54,7 @@ #ifndef _DBMGR_HXX #include <dbmgr.hxx> #endif +#include <svtools/syslocale.hxx> #include <unomid.h> @@ -261,7 +262,7 @@ ImpAutoFmtNameListLoader::ImpAutoFmtNameListLoader( SvStringsDtor& rLst ) p->SearchAndReplace(C2S("%1"), C2S(",,")); p->SearchAndReplace(C2S("%2"), C2S("''")); #else - LocaleDataWrapper& rLclD = GetAppLocaleData(); + const LocaleDataWrapper& rLclD = SvtSysLocale().GetLocaleData(); //unter richtigen Betriebssystemen funktioniert es auch so p->SearchAndReplace(C2S("%1"), rLclD.getDoubleQuotationMarkStart()); p->SearchAndReplace(C2S("%2"), rLclD.getDoubleQuotationMarkEnd()); diff --git a/sw/source/ui/utlui/numfmtlb.cxx b/sw/source/ui/utlui/numfmtlb.cxx index 38a4aa9a85e8..5a0030d9dd85 100644 --- a/sw/source/ui/utlui/numfmtlb.cxx +++ b/sw/source/ui/utlui/numfmtlb.cxx @@ -120,7 +120,7 @@ void NumFormatListBox::Init(short nFormatType, BOOL bUsrFmts) if (pView) eCurLanguage = pView->GetWrtShell().GetCurLang(); else - eCurLanguage = SvxLocaleToLanguage( GetAppLocaleData().getLocale() ); + eCurLanguage = SvxLocaleToLanguage( SvtSysLocale().GetLocaleData().getLocale() ); if (bUsrFmts == FALSE) { diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx index fb64e51c97f8..cb6a3888d45f 100644 --- a/sw/source/ui/utlui/uitool.cxx +++ b/sw/source/ui/utlui/uitool.cxx @@ -39,6 +39,7 @@ #include <unotools/collatorwrapper.hxx> #include <svtools/urihelper.hxx> #include <svtools/stritem.hxx> +#include <svtools/syslocale.hxx> #include <sfx2/app.hxx> #include <sfx2/docfile.hxx> #include <sfx2/docfilt.hxx> @@ -732,7 +733,7 @@ SwTwips GetTableWidth( SwFrmFmt* pFmt, SwTabCols& rCols, USHORT *pPercent, String GetAppLangDateTimeString( const DateTime& rDT ) { - LocaleDataWrapper& rAppLclData = GetAppLocaleData(); + const LocaleDataWrapper& rAppLclData = SvtSysLocale().GetLocaleData(); String sRet( rAppLclData.getDate( rDT )); ( sRet += ' ' ) += rAppLclData.getTime( rDT, FALSE, FALSE ); return sRet; diff --git a/sw/source/ui/utlui/utlui.src b/sw/source/ui/utlui/utlui.src index 2882146a8986..a67fe47aca4b 100644 --- a/sw/source/ui/utlui/utlui.src +++ b/sw/source/ui/utlui/utlui.src @@ -226,7 +226,7 @@ String STR_CONTENT_TYPE_DRAWOBJECT }; String STR_CONTENT_TYPE_POSTIT { - Text [ en-US ] = "Notes" ; + Text [ en-US ] = "Comments" ; }; String STR_CONTENT_TYPE_SINGLE_OUTLINE { @@ -270,7 +270,7 @@ String STR_CONTENT_TYPE_SINGLE_INDEX }; String STR_CONTENT_TYPE_SINGLE_POSTIT { - Text [ en-US ] = "Note" ; + Text [ en-US ] = "Comment" ; }; String STR_CONTENT_TYPE_SINGLE_DRAWOBJECT { diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx index f45c68ef7ec9..b46cbdb3a1a5 100644 --- a/sw/source/ui/wrtsh/select.cxx +++ b/sw/source/ui/wrtsh/select.cxx @@ -73,6 +73,13 @@ using namespace ::com::sun::star::util; static long nStartDragX = 0, nStartDragY = 0; static BOOL bStartDrag = FALSE; +void SwWrtShell::Invalidate() +{ + // to avoid making the slot volatile, invalidate it everytime if something could have been changed + // this is still much cheaper than asking for the state every 200 ms (and avoid background processing) + GetView().GetViewFrame()->GetBindings().Invalidate( FN_STAT_SELMODE ); +} + BOOL SwWrtShell::SelNearestWrd() { MV_KONTEXT(this); @@ -140,8 +147,9 @@ long SwWrtShell::SelAll() { const BOOL bLockedView = IsViewLocked(); LockView( TRUE ); - { + if(bBlockMode) + LeaveBlockMode(); MV_KONTEXT(this); BOOL bMoveTable = FALSE; SwPosition *pStartPos = 0; @@ -191,9 +199,7 @@ long SwWrtShell::SelAll() } } EndSelect(); - LockView( bLockedView ); - return 1; } @@ -337,6 +343,7 @@ void SwWrtShell::UnSelectFrm() // Rahmenselektion aufheben mit garantiert ungueltiger Position Point aPt(LONG_MIN, LONG_MIN); SelectObj(aPt, 0); + GetView().LeaveDrawCreate(); SwTransferable::ClearSelection( *this ); } @@ -375,6 +382,7 @@ long SwWrtShell::ResetSelect(const Point *,BOOL) */ GetChgLnk().Call(this); } + Invalidate(); SwTransferable::ClearSelection( *this ); return 1; } @@ -409,6 +417,7 @@ void SwWrtShell::SttSelect() fnKillSel = &SwWrtShell::Ignore; fnSetCrsr = &SwWrtShell::SetCrsr; bInSelect = TRUE; + Invalidate(); SwTransferable::CreateSelection( *this ); } /* @@ -577,6 +586,7 @@ void SwWrtShell::EnterStdMode() fnKillSel = &SwWrtShell::ResetSelect; } } + Invalidate(); SwTransferable::ClearSelection( *this ); } @@ -655,6 +665,7 @@ void SwWrtShell::EnterAddMode() bExtMode = FALSE; if(SwCrsrShell::HasSelection()) CreateCrsr(); + Invalidate(); } @@ -665,6 +676,7 @@ void SwWrtShell::LeaveAddMode() fnKillSel = &SwWrtShell::ResetSelect; fnSetCrsr = &SwWrtShell::SetCrsrKillSel; bAddMode = FALSE; + Invalidate(); } /* @@ -677,6 +689,7 @@ void SwWrtShell::EnterBlockMode() EnterStdMode(); bBlockMode = TRUE; CrsrToBlockCrsr(); + Invalidate(); } @@ -686,6 +699,7 @@ void SwWrtShell::LeaveBlockMode() bBlockMode = FALSE; BlockCrsrToCrsr(); EndSelect(); + Invalidate(); } // Einfuegemodus @@ -700,6 +714,7 @@ void SwWrtShell::SetInsMode( BOOL bOn ) GetView().GetViewFrame()->GetBindings().SetState( aTmp ); StartAction(); EndAction(); + Invalidate(); } //Overwrite mode is incompatible with red-lining void SwWrtShell::SetRedlineModeAndCheckInsMode( USHORT eMode ) @@ -744,6 +759,7 @@ void SwWrtShell::EnterSelFrmMode(const Point *pPos) fnDrag = &SwWrtShell::BeginFrmDrag; fnEndDrag = &SwWrtShell::UpdateLayoutFrm; SwBaseShell::SetFrmMode( FLY_DRAG_START, this ); + Invalidate(); } @@ -756,6 +772,7 @@ void SwWrtShell::LeaveSelFrmMode() bStartDrag = FALSE; Edit(); SwBaseShell::SetFrmMode( FLY_DRAG_END, this ); + Invalidate(); } /*------------------------------------------------------------------------ Beschreibung: Rahmengebundenes Macro ausfuehren @@ -799,6 +816,7 @@ long SwWrtShell::UpdateLayoutFrm(const Point *pPt, BOOL ) long SwWrtShell::ToggleAddMode() { bAddMode ? LeaveAddMode(): EnterAddMode(); + Invalidate(); return !bAddMode; } @@ -806,6 +824,7 @@ long SwWrtShell::ToggleAddMode() long SwWrtShell::ToggleBlockMode() { bBlockMode ? LeaveBlockMode(): EnterBlockMode(); + Invalidate(); return !bBlockMode; } @@ -813,6 +832,7 @@ long SwWrtShell::ToggleBlockMode() long SwWrtShell::ToggleExtMode() { bExtMode ? LeaveExtMode() : EnterExtMode(); + Invalidate(); return !bExtMode; } /* diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index a98e8ade9824..cd6bb82739ca 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -70,7 +70,6 @@ #include <svx/extrusionbar.hxx> #include <svx/fontworkbar.hxx> #include <fmtftn.hxx> -#include <fmthbsh.hxx> #include <fmtpdsc.hxx> #ifndef _WDOCSH_HXX #include <wdocsh.hxx> @@ -245,6 +244,7 @@ void SwWrtShell::Insert( const String &rStr ) BOOL bStarted = FALSE, bHasSel = HasSelection(), bCallIns = bIns /*|| bHasSel*/; + bool bDeleted = false; if( bHasSel || ( !bIns && SelectHiddenRange() ) ) { @@ -268,7 +268,7 @@ void SwWrtShell::Insert( const String &rStr ) StartUndo(UNDO_REPLACE, &aRewriter); bStarted = TRUE; - DelRight(); + bDeleted = DelRight() != 0; } /* @@ -283,7 +283,8 @@ JP 21.01.98: Ueberschreiben ueberschreibt nur die Selektion, nicht das } else */ - bCallIns ? SwEditShell::Insert( rStr ) : SwEditShell::Overwrite( rStr ); + bCallIns ? + SwEditShell::Insert2( rStr, bDeleted ) : SwEditShell::Overwrite( rStr ); if( bStarted ) @@ -1103,7 +1104,7 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum) pDoc->FindNumRulePtr(pColl->GetNumRule( FALSE ).GetValue()); if ( !pDirectCollRule ) { - pCollRule = 0L; + pCollRule = 0; } } // --> OD 2006-11-20 #i71764# @@ -1141,12 +1142,9 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum) { // check, if numbering of the outline level of the pararaph // style is active. If not, activate this outline level. - //nActivateOutlineLvl = pColl->GetOutlineLevel(); //#outline level,zhaojianwei - //ASSERT( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL, nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel(); ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(), //<-end,zhaojianwei "<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" ); - //if ( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL && //#outline level,zhaojianwei if ( pColl->IsAssignedToListLevelOfOutlineStyle() && //<-end,zhaojianwei pCollRule->Get( static_cast<USHORT>(nActivateOutlineLvl) ).GetNumberingType() == SVX_NUM_NUMBER_NONE ) @@ -1162,31 +1160,40 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum) } else { + // --> OD 2009-08-27 #i101234# // activate outline numbering, because from the precondition // it's known, that <SwEdit::HasNumber()> == FALSE bActivateOutlineRule = true; - //nActivateOutlineLvl = pColl->GetOutlineLevel(); //#outline level,zhaojianwei nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//<-end,zhaojianwei } } else if ( !pNumRule ) { - // activate outline numbering, because from the precondition - // it's known, that <SwEdit::HasNumber()> == FALSE - bActivateOutlineRule = true; - //nActivateOutlineLvl = pColl->GetOutlineLevel(); //#outline level,zhaojianwei + // --> OD 2009-08-27 #i101234# + // Check, if corresponding list level of the outline numbering + // has already a numbering format set. nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//<-end,zhaojianwei,need further consideration + if ( pCollRule->Get( static_cast<USHORT>(nActivateOutlineLvl) ).GetNumberingType() + == SVX_NUM_NUMBER_NONE ) + { + // activate outline numbering, because from the precondition + // it's known, that <SwEdit::HasNumber()> == FALSE + bActivateOutlineRule = true; + } + else + { + // turning on outline numbering at current cursor position + bContinueFoundNumRule = true; + } + // <-- } else { // check, if numbering of the outline level of the pararaph // style is active. If not, activate this outline level. - //nActivateOutlineLvl = pColl->GetOutlineLevel(); nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//#outline level,zhaojianwei - //ASSERT( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL, ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(),//#outline level,zhaojianwei "<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" ); - //if ( /*nActivateOutlineLvl >= 0 &&*/ nActivateOutlineLvl < MAXLEVEL && if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&//#outline level,zhaojianwei pCollRule->Get( static_cast<USHORT>(nActivateOutlineLvl) ).GetNumberingType() == SVX_NUM_NUMBER_NONE ) @@ -1212,12 +1219,12 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum) { if ( !pNumRule->IsAutoRule() ) { - pNumRule = 0L; + pNumRule = 0; } else if ( pNumRule == GetDoc()->GetOutlineNumRule() && !bActivateOutlineRule && !bContinueFoundNumRule ) { - pNumRule = 0L; + pNumRule = 0; } } // <-- @@ -1229,7 +1236,7 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum) if ( !pNumRule ) { pNumRule = GetDoc()->SearchNumRule( *GetCrsr()->GetPoint(), - FALSE, bNum, FALSE, 0, + false, bNum, false, 0, sContinuedListId ); bContinueFoundNumRule = pNumRule != 0; } @@ -1290,11 +1297,12 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum) } else { + // --> OD 2009-08-27 #i95907# + const SvxNumberFormat::SvxNumPositionAndSpaceMode ePosAndSpaceMode( + numfunc::GetDefaultPositionAndSpaceMode() ); // --> OD 2008-02-11 #newlistlevelattrs# - SwNumRule aNumRule( GetUniqueNumRuleName(), - // --> OD 2008-06-06 #i89178# - numfunc::GetDefaultPositionAndSpaceMode() ); - // <-- + SwNumRule aNumRule( GetUniqueNumRuleName(), ePosAndSpaceMode ); + // <-- // <-- // Zeichenvorlage an die Numerierung haengen SwCharFmt* pChrFmt; @@ -1315,9 +1323,10 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum) pChrFmt = GetCharFmtFromPool( RES_POOLCHR_BUL_LEVEL ); } - SwTxtNode * pTxtNode = - GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode(); - USHORT nWidthOfTabs = pTxtNode->GetWidthOfLeadingTabs(); + const SwTxtNode* pTxtNode = GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode(); + const SwTwips nWidthOfTabs = pTxtNode + ? pTxtNode->GetWidthOfLeadingTabs() + : 0; GetDoc()->RemoveLeadingWhiteSpace( *GetCrsr()->GetPoint() ); const bool bHtml = 0 != PTR_CAST(SwWebDocShell, pDocSh); @@ -1339,16 +1348,21 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum) aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); } - if(bHtml && nLvl) - { - // 1/2" fuer HTML - aFmt.SetLSpace(720); - aFmt.SetAbsLSpace(nLvl * 720); - } - else if ( nWidthOfTabs > 0 ) + // --> OD 2009-08-26 #i95907# + if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) { - aFmt.SetAbsLSpace(nWidthOfTabs + nLvl * 720); + if(bHtml && nLvl) + { + // 1/2" fuer HTML + aFmt.SetLSpace(720); + aFmt.SetAbsLSpace(nLvl * 720); + } + else if ( nWidthOfTabs > 0 ) + { + aFmt.SetAbsLSpace(nWidthOfTabs + nLvl * 720); + } } + // <-- // --> FME 2005-01-21 #i38904# Default alignment for // numbering/bullet should be rtl in rtl paragraph: @@ -1361,6 +1375,21 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum) aNumRule.Set( nLvl, aFmt ); } + // --> OD 2009-08-26 #i95907# + if ( pTxtNode && + ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) + { + short nTxtNodeFirstLineOffset( 0 ); + pTxtNode->GetFirstLineOfsWithNum( nTxtNodeFirstLineOffset ); + const SwTwips nTxtNodeIndent = pTxtNode->GetLeftMarginForTabCalculation() + + nTxtNodeFirstLineOffset; + if ( ( nTxtNodeIndent + nWidthOfTabs ) != 0 ) + { + const SwTwips nIndentChange = nTxtNodeIndent + nWidthOfTabs; + aNumRule.ChangeIndent( nIndentChange ); + } + } + // <-- // --> OD 2008-02-08 #newlistlevelattrs# // reset indent attribute on applying list style // --> OD 2008-03-17 #refactorlists# diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx index 42cfb1c3d64d..9141279f141b 100644 --- a/sw/source/ui/wrtsh/wrtsh2.cxx +++ b/sw/source/ui/wrtsh/wrtsh2.cxx @@ -93,10 +93,13 @@ void SwWrtShell::Insert(SwField &rFld) StartUndo(UNDO_INSERT, &aRewriter); + bool bDeleted = false; if( HasSelection() ) - DelRight(); + { + bDeleted = DelRight() != 0; + } - SwEditShell::Insert(rFld); + SwEditShell::Insert2(rFld, bDeleted); EndUndo(UNDO_INSERT); EndAllAction(); } |