summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/postit.hxx3
-rw-r--r--sw/inc/swabstdlg.hxx9
-rw-r--r--sw/inc/swmodule.hxx1
-rw-r--r--sw/inc/unomod.hxx7
-rw-r--r--sw/sdi/swriter.sdi2
-rw-r--r--sw/source/core/unocore/unomap.cxx1
-rw-r--r--sw/source/ui/app/swmodul1.cxx52
-rw-r--r--sw/source/ui/dbui/mailmergehelper.cxx6
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx21
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx10
-rw-r--r--sw/source/ui/docvw/edtwin.cxx107
-rw-r--r--sw/source/ui/docvw/postit.cxx61
-rw-r--r--sw/source/ui/inc/edtwin.hxx3
-rw-r--r--sw/source/ui/inc/splittbl.hxx9
-rw-r--r--sw/source/ui/inc/view.hxx4
-rw-r--r--sw/source/ui/shells/tabsh.cxx31
-rw-r--r--sw/source/ui/table/splittbl.cxx13
-rw-r--r--sw/source/ui/uiview/viewmdi.cxx6
-rw-r--r--sw/source/ui/uno/unomod.cxx94
19 files changed, 380 insertions, 60 deletions
diff --git a/sw/inc/postit.hxx b/sw/inc/postit.hxx
index 1ea11993cf..82d5b008ea 100644
--- a/sw/inc/postit.hxx
+++ b/sw/inc/postit.hxx
@@ -251,7 +251,8 @@ class SwMarginWin : public Window
virtual void MouseMove( const MouseEvent& rMEvt );
virtual void Paint( const Rectangle& rRect);
virtual void GetFocus();
- void SetPosAndSize();
+
+ void SetPosAndSize();
void SetSizePixel( const Size& rNewSize );
DECL_LINK(ModifyHdl, void*);
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index b535e900b2..ec2709fe8a 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -228,6 +228,12 @@ public:
};
+class AbstractSplitTableDialog : public VclAbstractDialog // add for
+{
+public:
+ virtual sal_uInt16 GetSplitMode() = 0;
+};
+
class AbstractSwConvertTableDlg : public VclAbstractDialog // add for SwConvertTableDlg
{
public:
@@ -381,7 +387,8 @@ public:
virtual AbstarctSwSelGlossaryDlg * CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId ) = 0; //add for SwSelGlossaryDlg
- virtual VclAbstractDialog * CreateVclAbstractDialog ( Window * pParent, SwWrtShell &rSh, int nResId ) = 0; //add for SwTableHeightDlg SwSortDlg ,SwSplitTblDlg
+ virtual VclAbstractDialog * CreateVclAbstractDialog ( Window * pParent, SwWrtShell &rSh, int nResId ) = 0; //add for SwTableHeightDlg SwSortDlg
+ virtual AbstractSplitTableDialog * CreateSplitTblDialog ( Window * pParent, SwWrtShell &rSh ) = 0; //add for SwSplitTblDlg
virtual AbstractSwAutoFormatDlg * CreateSwAutoFormatDlg( Window* pParent, SwWrtShell* pShell, //add for SwAutoFormatDlg
int nResId,
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index 1001785e5e..f22dc9f569 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -162,6 +162,7 @@ public:
void ApplyUsrPref(const SwViewOption &, SwView*,
sal_uInt16 nDest = VIEWOPT_DEST_VIEW );
void ApplyUserMetric( FieldUnit eMetric, BOOL bWeb );
+ void ApplyRulerMetric( FieldUnit eMetric, BOOL bHorizontal, BOOL bWeb );
void ApplyFldUpdateFlags(SwFldUpdateFlags eFldFlags);
void ApplyLinkMode(sal_Int32 nNewLinkMode);
diff --git a/sw/inc/unomod.hxx b/sw/inc/unomod.hxx
index fd4718d653..b68859e06c 100644
--- a/sw/inc/unomod.hxx
+++ b/sw/inc/unomod.hxx
@@ -41,6 +41,7 @@
#include <cppuhelper/implbase4.hxx> // helper for implementations
#include <comphelper/ChainablePropertySet.hxx>
#include <comphelper/SettingsHelper.hxx>
+#include <usrpref.hxx>
class SwView;
class SwViewOption;
@@ -146,6 +147,12 @@ protected:
SwViewOption* mpViewOption;
const SwViewOption* mpConstViewOption;
sal_Bool bObjectValid:1, bWeb:1, mbApplyZoom;
+
+ sal_Int32 eHRulerUnit;
+ sal_Bool mbApplyHRulerMetric;
+ sal_Int32 eVRulerUnit;
+ sal_Bool mbApplyVRulerMetric;
+
virtual void _preSetValues ()
throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
virtual void _setSingleValue( const comphelper::PropertyInfo & rInfo, const ::com::sun::star::uno::Any &rValue )
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 9bba9039eb..211fa68c98 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -7801,7 +7801,7 @@ SfxVoidItem SplitCell FN_TABLE_SPLIT_CELLS
//--------------------------------------------------------------------------
SfxVoidItem SplitTable FN_TABLE_SPLIT_TABLE
-()
+(SfxUInt16Item Type FN_PARAM_1)
[
/* flags: */
AutoUpdate = FALSE,
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 1ff80d2cb8..0058346697 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -2020,6 +2020,7 @@ const SfxItemPropertyMap* SwUnoPropertyMapProvider::GetPropertyMap(sal_uInt16 nP
{SW_PROP_NMID(UNO_NAME_AUTHOR), FIELD_PROP_PAR1, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0},
{SW_PROP_NMID(UNO_NAME_CONTENT), FIELD_PROP_PAR2, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0},
{SW_PROP_NMID(UNO_NAME_DATE_TIME_VALUE), FIELD_PROP_DATE_TIME, CPPU_E2T(CPPUTYPE_DATETIME), PROPERTY_NONE, 0},
+ {SW_PROP_NMID(UNO_NAME_DATE), FIELD_PROP_DATE, CPPU_E2T(CPPUTYPE_DATE), PROPERTY_NONE, 0},
{SW_PROP_NMID(UNO_NAME_TEXT_RANGE), FIELD_PROP_TEXT, CPPU_E2T(CPPUTYPE_REFINTERFACE), PropertyAttribute::READONLY, 0},
COMMON_FLDTYP_PROPERTIES
{0,0,0,0,0,0}
diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx
index 5e086314a3..d7c7473e12 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 fd14cf00f6..c299133d2e 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 f338122506..b8f48b3b3f 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 17efae0860..cfc8180063 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 c362c61dbf..313f9e033c 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 82546c388b..80a0540f4b 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 6dcbeb4cf2..467cbe7023 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 757c2c2557..102da59e98 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 c110663e5a..1597c977e0 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 60641bcc93..9140078bf6 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 e2753bc57a..b12d5011b6 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 5fc0e60116..91dbaa3197 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 2b68c6f95a..f70d6745d2 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 )