diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-01-06 16:42:28 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-01-06 16:42:28 +0000 |
commit | 25913c730f07766457d08f24008cbfb97f0a60a3 (patch) | |
tree | acdcd858cd19f68597bdc872a4355dd3c335e7b1 /sw/source/ui | |
parent | 05342c68cbfedb1cc4f9832592fa277d30832162 (diff) |
CWS-TOOLING: integrate CWS os123
2008-12-10 10:15:09 +0100 os r265154 : #i94987# DateTimeValue added
2008-12-10 09:00:58 +0100 os r265150 : #i96045# ctl languages enabled
2008-12-09 18:09:10 +0100 os r265129 : syntax error fixed
2008-12-09 09:35:09 +0100 os r265056 : vertical/horizonatal metric: no bool value
2008-12-08 09:56:50 +0100 os r264974 : CWS-TOOLING: rebase CWS os123 to trunk@264807 (milestone: DEV300:m37)
2008-12-03 11:41:13 +0100 os r264762 : #i96822# database removed, too
2008-12-03 11:35:26 +0100 os r264760 : #i96822# business cards and labels should not be part of the document list
2008-12-01 11:38:26 +0100 os r264592 : #i96322# command name of ActivateStyleApply added
2008-11-27 14:59:46 +0100 va r264491 : #i95322#: Initial Revision
2008-11-27 14:53:20 +0100 va r264490 : #i95322#: New Language Directory for Persian (Farsi)
2008-11-21 08:48:55 +0100 os r264107 : #i94409# recording/executing split table
2008-11-13 13:18:57 +0100 os r263636 : #i93924# string reconversion
2008-11-12 15:58:48 +0100 os r263604 : #i94987# Date property re-add to Annotation service
2008-11-12 15:44:24 +0100 os r263603 : #i88766# ruler metric
2008-11-12 15:43:33 +0100 os r263602 : #i88766#
2008-11-11 09:15:28 +0100 os r263545 : #i94839# get real filter name from dialog instead of guessing from UI name
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/app/swmodul1.cxx | 52 | ||||
-rw-r--r-- | sw/source/ui/dbui/mailmergehelper.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 21 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 10 | ||||
-rw-r--r-- | sw/source/ui/docvw/edtwin.cxx | 107 | ||||
-rw-r--r-- | sw/source/ui/docvw/postit.cxx | 61 | ||||
-rw-r--r-- | sw/source/ui/inc/edtwin.hxx | 3 | ||||
-rw-r--r-- | sw/source/ui/inc/splittbl.hxx | 9 | ||||
-rw-r--r-- | sw/source/ui/inc/view.hxx | 4 | ||||
-rw-r--r-- | sw/source/ui/shells/tabsh.cxx | 31 | ||||
-rw-r--r-- | sw/source/ui/table/splittbl.cxx | 13 | ||||
-rw-r--r-- | sw/source/ui/uiview/viewmdi.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/uno/unomod.cxx | 94 |
13 files changed, 360 insertions, 57 deletions
diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx index 1ab26f988261..8a63254f42c1 100644 --- a/sw/source/ui/app/swmodul1.cxx +++ b/sw/source/ui/app/swmodul1.cxx @@ -53,35 +53,19 @@ #include <swmodule.hxx> #include <swtypes.hxx> #include <usrpref.hxx> -#ifndef _MODCFG_HXX #include <modcfg.hxx> -#endif -#ifndef _VIEW_HXX #include <view.hxx> -#endif -#ifndef _PVIEW_HXX #include <pview.hxx> -#endif -#ifndef _WVIEW_HXX #include <wview.hxx> -#endif #include <wrtsh.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif -#ifndef _DBMGR_HXX #include <dbmgr.hxx> -#endif #include <uinums.hxx> #include <prtopt.hxx> // fuer PrintOptions #include <navicfg.hxx> #include <doc.hxx> -#ifndef _CMDID_H #include <cmdid.h> -#endif -#ifndef _APP_HRC #include <app.hrc> -#endif #include "helpid.h" #include <unomid.h> @@ -289,7 +273,43 @@ void SwModule::ApplyUserMetric( FieldUnit eMetric, BOOL bWeb ) pTmpView = SwModule::GetNextView(pTmpView); } +} +/*-- 12.11.2008 14:47:58--------------------------------------------------- + -----------------------------------------------------------------------*/ +void SwModule::ApplyRulerMetric( FieldUnit eMetric, BOOL bHorizontal, BOOL bWeb ) +{ + SwMasterUsrPref* pPref; + if(bWeb) + { + if(!pWebUsrPref) + GetUsrPref(sal_True); + pPref = pWebUsrPref; + } + else + { + if(!pUsrPref) + GetUsrPref(sal_False); + pPref = pUsrPref; + } + if( bHorizontal ) + pPref->SetHScrollMetric(eMetric); + else + pPref->SetVScrollMetric(eMetric); + + SwView* pTmpView = SwModule::GetFirstView(); + // switch metric at the appropriate rulers + while(pTmpView) + { + if(bWeb == (0 != dynamic_cast<SwWebView *>( pTmpView ))) + { + if( bHorizontal ) + pTmpView->ChangeTabMetric(eMetric); + else + pTmpView->ChangeVLinealMetric(eMetric); + } + pTmpView = SwModule::GetNextView(pTmpView); + } } /*-----------------13.11.96 11.57------------------- diff --git a/sw/source/ui/dbui/mailmergehelper.cxx b/sw/source/ui/dbui/mailmergehelper.cxx index 83847af76163..0fff9f762131 100644 --- a/sw/source/ui/dbui/mailmergehelper.cxx +++ b/sw/source/ui/dbui/mailmergehelper.cxx @@ -87,11 +87,7 @@ String CallSaveAsDialog(String& rFilter) { uno::Reference < ui::dialogs::XFilePicker > xFP = aDialog.GetFilePicker(); sRet = xFP->getFiles().getConstArray()[0]; - rFilter = aDialog.GetCurrentFilter(); - SfxFilterMatcher aMatcher( sFactory ); - const SfxFilter* p2 = aMatcher.GetFilter4UIName( rFilter ); - if(p2) - rFilter = p2->GetFilterName(); + rFilter = aDialog.GetRealFilter(); } return sRet; } diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 42eeb568f283..6f0397bc97e3 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -77,7 +77,6 @@ #include "rowht.hxx" //add for SwTableHeightDlg #include "selglos.hxx" //add for SwSelGlossaryDlg #include "splittbl.hxx" //add for SwSplitTblDlg -#include "splittbl.hxx" //add for SwSplitTblDlg #include "srtdlg.hxx" //add for SwSortDlg #include "tautofmt.hxx" //add for SwAutoFormatDlg #include "tblnumfm.hxx" //add for SwNumFmtDlg @@ -123,6 +122,7 @@ IMPL_ABSTDLG_BASE(AbstractSwInsertAbstractDlg_Impl); IMPL_ABSTDLG_BASE(AbstractSfxSingleTabDialog_Impl); IMPL_ABSTDLG_BASE(AbstractSwAsciiFilterDlg_Impl); IMPL_ABSTDLG_BASE(VclAbstractDialog_Impl); +IMPL_ABSTDLG_BASE(AbstractSplitTableDialog_Impl); IMPL_ABSTDLG_BASE(AbstractSwBreakDlg_Impl); //add for SwBreakDlg IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl); //add for SwCharDlg, SwFootNoteOptionDlg, SwEnvDlg SwParaDlg SwTableTabDlg IMPL_ABSTDLG_BASE(AbstractSwConvertTableDlg_Impl); //add for SwConvertTableDlg @@ -211,7 +211,11 @@ void AbstractSwAsciiFilterDlg_Impl::FillOptions( SwAsciiOptions& rOptions ) } //add for SwAsciiFilterDlg end - +//add for SwSplitTblDlg +sal_uInt16 AbstractSplitTableDialog_Impl::GetSplitMode() +{ + return pDlg->GetSplitMode(); +} //add for SwBreakDlg begin String AbstractSwBreakDlg_Impl::GetTemplateName() { @@ -986,7 +990,7 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwParaDlg ( Window *pP } //add for SwParaDlg end -//add for SwTableHeightDlg SwSortDlg ,SwSplitTblDlg begin +//add for SwTableHeightDlg SwSortDlg begin VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclAbstractDialog ( Window *pParent, SwWrtShell &rSh, int nResId ) { Dialog* pDlg=NULL; @@ -996,9 +1000,6 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclAbstractDialog ( Wind pDlg = new SwTableHeightDlg( pParent, rSh); break; - case DLG_SPLIT_TABLE : - pDlg = new SwSplitTblDlg( pParent, rSh); - break; case DLG_SORTING : pDlg = new SwSortDlg( pParent, rSh); break; @@ -1016,7 +1017,13 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclAbstractDialog ( Wind return new VclAbstractDialog_Impl( pDlg ); return 0; } -//add for SwTableHeightDlg SwSortDlg ,SwSplitTblDlg end +//add for SwTableHeightDlg SwSortDlg ,end +//add for SwSplitTblDlg begin +AbstractSplitTableDialog * SwAbstractDialogFactory_Impl::CreateSplitTblDialog ( Window *pParent, SwWrtShell &rSh ) +{ + return new AbstractSplitTableDialog_Impl( new SwSplitTblDlg( pParent, rSh) ); +} +//add SwSplitTblDlg end //add for SwSelGlossaryDlg begin AbstarctSwSelGlossaryDlg * SwAbstractDialogFactory_Impl::CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId ) diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index dbb3bd853b00..75b9bfefaf1f 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -50,6 +50,7 @@ class SwRenameXNamedDlg; class SwModalRedlineAcceptDlg; class SwTOXMark; class SwWordCountDialog; +class SwSplitTblDlg; #include "itabenum.hxx" @@ -130,6 +131,12 @@ class AbstractSwBreakDlg_Impl : public AbstractSwBreakDlg // add for SwBreakDlg virtual USHORT GetPageNumber(); }; +class AbstractSplitTableDialog_Impl : public AbstractSplitTableDialog // add for +{ + DECL_ABSTDLG_BASE(AbstractSplitTableDialog_Impl, SwSplitTblDlg) + virtual sal_uInt16 GetSplitMode(); +}; + // add for SwBreakDlg end //add for SwCharDlg , SwEnvDlg , SwFootNoteOptionDlg SwParaDlg SwTableTabDlg begin @@ -459,7 +466,8 @@ public: UINT16 nDefPage = 0); virtual AbstarctSwSelGlossaryDlg * CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId ); //add for SwSelGlossaryDlg - virtual VclAbstractDialog * CreateVclAbstractDialog ( Window * pParent, SwWrtShell &rSh, int nResId ); //add for SwTableHeightDlg SwSortDlg ,SwSplitTblDlg + virtual VclAbstractDialog * CreateVclAbstractDialog ( Window * pParent, SwWrtShell &rSh, int nResId ); //add for SwTableHeightDlg SwSortDlg + virtual AbstractSplitTableDialog * CreateSplitTblDialog ( Window * pParent, SwWrtShell &rSh ); //add for SwSplitTblDlg virtual AbstractSwAutoFormatDlg * CreateSwAutoFormatDlg( Window* pParent, SwWrtShell* pShell, //add for SwAutoFormatDlg int nResId, diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index c53253ee7115..2b0b7c0931e1 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -5057,7 +5057,55 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) bInputLanguageSwitched = true; SetUseInputLanguage( sal_True ); break; + case COMMAND_SELECTIONCHANGE: + { + const CommandSelectionChangeData *pData = rCEvt.GetSelectionChangeData(); + rSh.HideCrsr(); + rSh.GoStartSentence(); + rSh.GetCrsr()->GetPoint()->nContent += sal::static_int_cast<sal_uInt16, ULONG>(pData->GetStart()); + rSh.SetMark(); + rSh.GetCrsr()->GetMark()->nContent += sal::static_int_cast<sal_uInt16, ULONG>( pData->GetEnd() - pData->GetStart() ); + rSh.ShowCrsr(); + } + break; + case COMMAND_PREPARERECONVERSION: + if( rSh.HasSelection() ) + { + if ( rSh.IsMultiSelection() ) + { + // Save the last selected area. + SwPaM *pCrsr = (SwPaM*)rSh.GetCrsr()->GetPrev(); + xub_StrLen nPosIdx = pCrsr->GetPoint()->nContent.GetIndex(); + ULONG nPosNodeIdx = pCrsr->GetPoint()->nNode.GetIndex(); + xub_StrLen nMarkIdx = pCrsr->GetMark()->nContent.GetIndex(); + ULONG nMarkNodeIdx = pCrsr->GetMark()->nNode.GetIndex(); + + // ToDo: Deselect the text behind the first paragraph break, + // if the last selected area ranges from one paragraph + // to another. + if( nPosNodeIdx != nMarkNodeIdx ) + break; + // Cancel all selection. + while( rSh._GetCrsr()->GetNext() != rSh._GetCrsr() ) + delete rSh._GetCrsr()->GetNext(); + + // Restore the last selected area. + rSh.GetCrsr()->GetPoint()->nContent = nPosIdx; + rSh.GetCrsr()->GetPoint()->nNode = nPosNodeIdx; + rSh.SetMark(); + rSh.GetCrsr()->GetMark()->nContent = nMarkIdx; + rSh.GetCrsr()->GetMark()->nNode = nMarkNodeIdx; + rSh.ShowCrsr(); + } + else + { + // Deselect the text behind the first paragraph break. + rSh.NormalizePam( FALSE ); + while( !rSh.IsSelOnePara() && rSh.MovePara( fnParaPrev, fnParaEnd )); + } + } + break; #ifdef DBG_UTIL default: ASSERT( !this, "unknown command." ); @@ -5580,3 +5628,62 @@ void SwEditWin::SetUseInputLanguage( sal_Bool bNew ) } bUseInputLanguage = bNew; } + +/*-- 13.11.2008 10:18:17--------------------------------------------------- + + -----------------------------------------------------------------------*/ +XubString SwEditWin::GetSurroundingText() const +{ + String sReturn; + SwWrtShell& rSh = rView.GetWrtShell(); + if( rSh.HasSelection() && !rSh.IsMultiSelection() && rSh.IsSelOnePara() ) + rSh.GetSelectedText( sReturn ); + else if( !rSh.HasSelection() ) + { + SwPosition *pPos = rSh.GetCrsr()->GetPoint(); + xub_StrLen nPos = pPos->nContent.GetIndex(); + + // get the sentence around the cursor + rSh.HideCrsr(); + rSh.GoStartSentence(); + rSh.SetMark(); + rSh.GoEndSentence(); + rSh.GetSelectedText( sReturn ); + + pPos->nContent = nPos; + rSh.ClearMark(); + rSh.HideCrsr(); + } + + return sReturn; +} +/*-- 13.11.2008 10:18:17--------------------------------------------------- + + -----------------------------------------------------------------------*/ +Selection SwEditWin::GetSurroundingTextSelection() const +{ + SwWrtShell& rSh = rView.GetWrtShell(); + if( rSh.HasSelection() ) + { + String sReturn; + rSh.GetSelectedText( sReturn ); + return Selection( 0, sReturn.Len() ); + } + else + { + // Return the position of the visible cursor in the sentence + // around the visible cursor. + SwPosition *pPos = rSh.GetCrsr()->GetPoint(); + xub_StrLen nPos = pPos->nContent.GetIndex(); + + rSh.HideCrsr(); + rSh.GoStartSentence(); + xub_StrLen nStartPos = rSh.GetCrsr()->GetPoint()->nContent.GetIndex(); + + pPos->nContent = nPos; + rSh.ClearMark(); + rSh.ShowCrsr(); + + return Selection( nPos - nStartPos, nPos - nStartPos ); + } +} diff --git a/sw/source/ui/docvw/postit.cxx b/sw/source/ui/docvw/postit.cxx index fbcf8cfe4977..50352f5faf79 100644 --- a/sw/source/ui/docvw/postit.cxx +++ b/sw/source/ui/docvw/postit.cxx @@ -428,6 +428,33 @@ 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 (rCEvt.GetCommand() == COMMAND_SELECTIONCHANGE) { @@ -542,6 +569,40 @@ IMPL_LINK( PostItTxt, WindowEventListener, VclSimpleEvent*, pWinEvent ) } return sal_True; } + +XubString PostItTxt::GetSurroundingText() const +{ + XubString sRet; + if( mpOutlinerView ) + { + EditEngine *aEditEngine = mpOutlinerView->GetEditView().GetEditEngine(); + if( mpOutlinerView->HasSelection() ) + sRet = mpOutlinerView->GetSelected(); + else + { + ESelection aSelection = mpOutlinerView->GetEditView().GetSelection(); + sRet = aEditEngine->GetText(aSelection.nStartPara); + } + } + return sRet; +} + +Selection PostItTxt::GetSurroundingTextSelection() const +{ + Selection aRet( 0, 0 ); + if( mpOutlinerView ) + { + if( mpOutlinerView->HasSelection() ) + aRet = Selection( 0, mpOutlinerView->GetSelected().Len() ); + else + { + ESelection aSelection = mpOutlinerView->GetEditView().GetSelection(); + aRet = Selection( aSelection.nStartPos, aSelection.nEndPos ); + } + } + return aRet; +} + /************** SwMarginWin***********************************++*/ SwMarginWin::SwMarginWin(Window* pParent, WinBits nBits,SwPostItMgr* aMgr,SwPostItBits aBits) : Window(pParent, nBits), diff --git a/sw/source/ui/inc/edtwin.hxx b/sw/source/ui/inc/edtwin.hxx index ac435694fe0f..2b39b928bca6 100644 --- a/sw/source/ui/inc/edtwin.hxx +++ b/sw/source/ui/inc/edtwin.hxx @@ -213,6 +213,9 @@ protected: virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ); + virtual XubString GetSurroundingText() const; + virtual Selection GetSurroundingTextSelection() const; + void ShowAutoTextCorrectQuickHelp( const String& rWord, SvxAutoCorrCfg* pACfg, SvxAutoCorrect* pACorr, sal_Bool bFromIME = sal_False ); public: diff --git a/sw/source/ui/inc/splittbl.hxx b/sw/source/ui/inc/splittbl.hxx index 1c6968b5b074..2fb84b2bc9a4 100644 --- a/sw/source/ui/inc/splittbl.hxx +++ b/sw/source/ui/inc/splittbl.hxx @@ -31,14 +31,8 @@ #define _SPLITTBL_HXX #include <svx/stddlg.hxx> - -#ifndef _FIXED_HXX //autogen #include <vcl/fixed.hxx> -#endif - -#ifndef _BUTTON_HXX //autogen #include <vcl/button.hxx> -#endif class SwWrtShell; @@ -54,12 +48,15 @@ class SwSplitTblDlg : public SvxStandardDialog RadioButton aBorderCopyRB; SwWrtShell &rShell; + USHORT m_nSplit; protected: virtual void Apply(); public: SwSplitTblDlg( Window *pParent, SwWrtShell &rSh ); + + USHORT GetSplitMode() const { return m_nSplit; } }; #endif diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx index 81f1173d6814..e9169bec2263 100644 --- a/sw/source/ui/inc/view.hxx +++ b/sw/source/ui/inc/view.hxx @@ -518,14 +518,14 @@ public: int StatVLineal() const { return ((Window*)pVRuler)->IsVisible(); } void ChangeVLinealMetric(FieldUnit eUnit); - BOOL GetVLinealMetric(FieldUnit& rToFill) const; + void GetVLinealMetric(FieldUnit& rToFill) const; int StatTab() const { return ((Window*)pHRuler)->IsVisible(); } SvxRuler& GetHLineal() { return *pHRuler; } SvxRuler& GetVLineal() { return *pVRuler; } void InvalidateRulerPos(); void ChangeTabMetric(FieldUnit eUnit); - BOOL GetHLinealMetric(FieldUnit& rToFill) const; + void GetHLinealMetric(FieldUnit& rToFill) const; // Handler void Execute(SfxRequest&); diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx index dc2cd85cefdd..9ef066f81953 100644 --- a/sw/source/ui/shells/tabsh.cxx +++ b/sw/source/ui/shells/tabsh.cxx @@ -1040,13 +1040,32 @@ void SwTableShell::Execute(SfxRequest &rReq) case FN_TABLE_SPLIT_TABLE: { - SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); + SFX_REQUEST_ARG( rReq, pType, SfxUInt16Item, FN_PARAM_1, sal_False ); + if( pType ) + { + switch( pType->GetValue() ) + { + case HEADLINE_NONE : + case HEADLINE_BORDERCOPY: + case HEADLINE_CNTNTCOPY: + case HEADLINE_BOXATTRCOPY: + case HEADLINE_BOXATRCOLLCOPY: + rSh.SplitTable(pType->GetValue()) ; + default: ;//wrong parameter, do nothing + } + } + else + { + SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); + DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!"); - VclAbstractDialog* pDlg = pFact->CreateVclAbstractDialog( GetView().GetWindow(), rSh ,DLG_SPLIT_TABLE ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); - pDlg->Execute(); - delete pDlg; + AbstractSplitTableDialog* pDlg = pFact->CreateSplitTblDialog( GetView().GetWindow(), rSh ); + DBG_ASSERT(pDlg, "Dialogdiet fail!"); + pDlg->Execute(); + rReq.AppendItem( SfxUInt16Item( FN_PARAM_1, pDlg->GetSplitMode() ) ); + delete pDlg; + bCallDone = sal_True; + } } break; diff --git a/sw/source/ui/table/splittbl.cxx b/sw/source/ui/table/splittbl.cxx index 8ed85e2727ff..0c8734af277a 100644 --- a/sw/source/ui/table/splittbl.cxx +++ b/sw/source/ui/table/splittbl.cxx @@ -54,7 +54,8 @@ SwSplitTblDlg::SwSplitTblDlg( Window *pParent, SwWrtShell &rSh ) : aBoxAttrCopyWithParaRB( this, SW_RES(RB_BOX_PARA )), aBoxAttrCopyNoParaRB( this, SW_RES(RB_BOX_NOPARA)), aBorderCopyRB( this, SW_RES(RB_BORDER )), - rShell(rSh) + rShell(rSh), + m_nSplit( HEADLINE_CNTNTCOPY ) { FreeResource(); aCntntCopyRB.Check(); @@ -65,15 +66,15 @@ SwSplitTblDlg::SwSplitTblDlg( Window *pParent, SwWrtShell &rSh ) : --------------------------------------------------*/ void SwSplitTblDlg::Apply() { - USHORT nSplit = HEADLINE_CNTNTCOPY; + m_nSplit = HEADLINE_CNTNTCOPY; if(aBoxAttrCopyWithParaRB.IsChecked()) - nSplit = HEADLINE_BOXATRCOLLCOPY; + m_nSplit = HEADLINE_BOXATRCOLLCOPY; if(aBoxAttrCopyNoParaRB.IsChecked()) - nSplit = HEADLINE_BOXATTRCOPY; + m_nSplit = HEADLINE_BOXATTRCOPY; else if(aBorderCopyRB.IsChecked()) - nSplit = HEADLINE_BORDERCOPY; + m_nSplit = HEADLINE_BORDERCOPY; - rShell.SplitTable( nSplit ); + rShell.SplitTable( m_nSplit ); } diff --git a/sw/source/ui/uiview/viewmdi.cxx b/sw/source/ui/uiview/viewmdi.cxx index 75484a21713d..08067ee76807 100644 --- a/sw/source/ui/uiview/viewmdi.cxx +++ b/sw/source/ui/uiview/viewmdi.cxx @@ -587,18 +587,16 @@ void SwView::ChangeVLinealMetric( FieldUnit eUnit ) /* -----------------------------07.04.01 17:09-------------------------------- ---------------------------------------------------------------------------*/ -BOOL SwView::GetVLinealMetric(FieldUnit& eToFill) const +void SwView::GetVLinealMetric(FieldUnit& eToFill) const { eToFill = pVRuler->GetUnit(); - return pVRuler != 0; } /* -----------------------------07.04.01 17:09-------------------------------- ---------------------------------------------------------------------------*/ -BOOL SwView::GetHLinealMetric(FieldUnit& eToFill) const +void SwView::GetHLinealMetric(FieldUnit& eToFill) const { eToFill = pHRuler->GetUnit(); - return pHRuler != 0; } /************************************************************************* |* diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx index 5338679e6a16..57a2a8ec6c1f 100644 --- a/sw/source/ui/uno/unomod.cxx +++ b/sw/source/ui/uno/unomod.cxx @@ -105,7 +105,9 @@ enum SwViewSettingsPropertyHandles HANDLE_VIEWSET_RASTER_RESOLUTION_X, HANDLE_VIEWSET_RASTER_RESOLUTION_Y, HANDLE_VIEWSET_RASTER_SUBDIVISION_X, - HANDLE_VIEWSET_RASTER_SUBDIVISION_Y + HANDLE_VIEWSET_RASTER_SUBDIVISION_Y, + HANDLE_VIEWSET_HORI_RULER_METRIC, + HANDLE_VIEWSET_VERT_RULER_METRIC }; enum SwPrintSettingsPropertyHandles { @@ -131,6 +133,7 @@ static ChainablePropertySetInfo * lcl_createViewSettingsInfo() static PropertyInfo aViewSettingsMap_Impl[] = { { RTL_CONSTASCII_STRINGPARAM ( "HelpURL" ), HANDLE_VIEWSET_HELP_URL , CPPUTYPE_OUSTRING, PROPERTY_NONE, 0}, + { RTL_CONSTASCII_STRINGPARAM ( "HorizontalRulerMetric"),HANDLE_VIEWSET_HORI_RULER_METRIC , CPPUTYPE_INT32, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "IsRasterVisible"), HANDLE_VIEWSET_IS_RASTER_VISIBLE, CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "IsSnapToRaster"), HANDLE_VIEWSET_IS_SNAP_TO_RASTER, CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "IsVertRulerRightAligned"),HANDLE_VIEWSET_VRULER_RIGHT , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, @@ -167,6 +170,7 @@ static ChainablePropertySetInfo * lcl_createViewSettingsInfo() { RTL_CONSTASCII_STRINGPARAM ( "ShowVertScrollBar"), HANDLE_VIEWSET_VSCROLL , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "SmoothScrolling"), HANDLE_VIEWSET_SMOOTH_SCROLLING , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "SolidMarkHandles"), HANDLE_VIEWSET_SOLID_MARK_HANDLES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, + { RTL_CONSTASCII_STRINGPARAM ( "VerticalRulerMetric"), HANDLE_VIEWSET_VERT_RULER_METRIC , CPPUTYPE_INT32, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "ZoomType"), HANDLE_VIEWSET_ZOOM_TYPE , CPPUTYPE_INT16, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "ZoomValue"), HANDLE_VIEWSET_ZOOM , CPPUTYPE_INT16, PROPERTY_NONE, 0}, { 0, 0, 0, CPPUTYPE_UNKNOWN, 0, 0 } @@ -596,6 +600,10 @@ SwXViewSettings::SwXViewSettings(sal_Bool bWebView, SwView* pVw) , mpConstViewOption ( NULL ) , bObjectValid(sal_True) , bWeb(bWebView) +, eHRulerUnit( FUNIT_CM ) +, mbApplyHRulerMetric( sal_False ) +, eVRulerUnit( FUNIT_CM ) +, mbApplyVRulerMetric( sal_False ) { // This property only exists if we have a view (ie, not at the module ) if ( !pView ) @@ -769,6 +777,34 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c throw UnknownPropertyException(); } break; + case HANDLE_VIEWSET_HORI_RULER_METRIC: + case HANDLE_VIEWSET_VERT_RULER_METRIC: + { + sal_Int32 nUnit = -1; + if( rValue >>= nUnit ) + switch( nUnit ) + { + case FUNIT_MM: + case FUNIT_CM: + case FUNIT_POINT: + case FUNIT_PICA: + case FUNIT_INCH: + if( rInfo.mnHandle == HANDLE_VIEWSET_HORI_RULER_METRIC ) + { + eHRulerUnit = nUnit; + mbApplyHRulerMetric = sal_True; + } + else + { + eVRulerUnit = nUnit; + mbApplyVRulerMetric = sal_True; + } + break; + default: + throw IllegalArgumentException(); + } + } + break; default: throw UnknownPropertyException(); } @@ -777,13 +813,31 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c void SwXViewSettings::_postSetValues () throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) { - if(mbApplyZoom && pView) - pView->SetZoom( (SvxZoomType)mpViewOption->GetZoomType(), - mpViewOption->GetZoom(), sal_True ); + if( pView ) + { + if(mbApplyZoom ) + pView->SetZoom( (SvxZoomType)mpViewOption->GetZoomType(), + mpViewOption->GetZoom(), sal_True ); + if(mbApplyHRulerMetric) + pView->ChangeTabMetric((FieldUnit)eHRulerUnit); + if(mbApplyVRulerMetric) + pView->ChangeVLinealMetric((FieldUnit)eVRulerUnit); + + } + else + { + if(mbApplyHRulerMetric) + SW_MOD()->ApplyRulerMetric( (FieldUnit)eHRulerUnit, sal_True, bWeb ); + if(mbApplyVRulerMetric) + SW_MOD()->ApplyRulerMetric( (FieldUnit)eVRulerUnit, sal_False, bWeb ); + } + SW_MOD()->ApplyUsrPref( *mpViewOption, pView, pView ? VIEWOPT_DEST_VIEW_ONLY : bWeb ? VIEWOPT_DEST_WEB : VIEWOPT_DEST_TEXT ); + + delete mpViewOption; mpViewOption = NULL; } @@ -901,6 +955,38 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u throw UnknownPropertyException(); } break; + case HANDLE_VIEWSET_HORI_RULER_METRIC: + { + if ( pView ) + { + FieldUnit eUnit; + pView->GetHLinealMetric( eUnit ); + rValue <<= (sal_Int32)eUnit; + } + else + { + const SwMasterUsrPref* pUsrPref = SW_MOD()->GetUsrPref( bWeb ); + rValue <<= (sal_Int32)pUsrPref->GetHScrollMetric(); + } + bBool = sal_False; + } + break; + case HANDLE_VIEWSET_VERT_RULER_METRIC: + { + if ( pView ) + { + FieldUnit eUnit; + pView->GetVLinealMetric( eUnit ); + rValue <<= (sal_Int32)eUnit; + } + else + { + const SwMasterUsrPref* pUsrPref = SW_MOD()->GetUsrPref( bWeb ); + rValue <<= (sal_Int32)pUsrPref->GetVScrollMetric(); + } + bBool = sal_False; + } + break; default: DBG_ERROR("Diese Id gibt's nicht!"); } if( bBool ) |