summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--starmath/inc/dialog.hxx85
-rw-r--r--starmath/inc/node.hxx13
-rw-r--r--starmath/inc/parse.hxx2
-rw-r--r--starmath/inc/smmod.hxx5
-rw-r--r--starmath/inc/starmath.hrc2
-rw-r--r--starmath/inc/symbol.hxx176
-rw-r--r--starmath/source/cfgitem.cxx18
-rw-r--r--starmath/source/cfgitem.hxx4
-rw-r--r--starmath/source/commands.src7
-rw-r--r--starmath/source/dialog.cxx329
-rw-r--r--starmath/source/document.cxx24
-rw-r--r--starmath/source/edit.cxx19
-rw-r--r--starmath/source/makefile.mk28
-rw-r--r--starmath/source/node.cxx11
-rwxr-xr-x[-rw-r--r--]starmath/source/parse.cxx85
-rw-r--r--starmath/source/rect.cxx2
-rw-r--r--starmath/source/smdll.cxx2
-rw-r--r--starmath/source/smmod.cxx12
-rwxr-xr-x[-rw-r--r--]starmath/source/smres.src2
-rw-r--r--starmath/source/symbol.cxx559
-rwxr-xr-x[-rw-r--r--]starmath/source/unomodel.cxx25
-rwxr-xr-x[-rw-r--r--]starmath/source/view.cxx22
-rw-r--r--sw/inc/PostItMgr.hxx3
-rw-r--r--sw/inc/SidebarWin.hxx2
-rw-r--r--sw/inc/SwNumberTree.hxx7
-rw-r--r--sw/inc/cmdid.h1
-rw-r--r--sw/inc/crsrsh.hxx9
-rw-r--r--sw/inc/doc.hxx3
-rwxr-xr-x[-rw-r--r--]sw/inc/dochdl.hrc4
-rw-r--r--sw/inc/editsh.hxx8
-rw-r--r--sw/inc/fesh.hxx6
-rw-r--r--sw/inc/fldbas.hxx15
-rw-r--r--sw/inc/htmltbl.hxx2
-rw-r--r--sw/inc/ndtxt.hxx6
-rw-r--r--sw/inc/pch/precompiled_sw.hxx2
-rw-r--r--sw/inc/postithelper.hxx1
-rw-r--r--sw/inc/swcrsr.hxx9
-rw-r--r--sw/inc/swtblfmt.hxx2
-rw-r--r--sw/inc/txtfld.hxx3
-rw-r--r--sw/inc/txtftn.hxx2
-rw-r--r--sw/inc/undobj.hxx10
-rwxr-xr-xsw/inc/viewopt.hxx14
-rw-r--r--[-rwxr-xr-x]sw/inc/viewsh.hxx3
-rw-r--r--sw/inc/viscrs.hxx2
-rw-r--r--sw/inc/warnpassword.hxx47
-rw-r--r--sw/qa/unoapi/knownissues.xcl3
-rw-r--r--sw/sdi/_textsh.sdi29
-rw-r--r--sw/sdi/_viewsh.sdi2
-rwxr-xr-xsw/sdi/annotsh.sdi30
-rw-r--r--sw/sdi/drwtxtsh.sdi28
-rw-r--r--sw/sdi/swriter.sdi25
-rw-r--r--sw/sdi/swslots.src1488
-rw-r--r--sw/source/core/SwNumberTree/SwNumberTree.cxx13
-rw-r--r--sw/source/core/access/accportions.cxx6
-rw-r--r--sw/source/core/access/accportions.hxx1
-rw-r--r--sw/source/core/crsr/crsrsh.cxx13
-rw-r--r--sw/source/core/crsr/crstrvl.cxx5
-rw-r--r--sw/source/core/crsr/crstrvl1.cxx24
-rw-r--r--sw/source/core/crsr/findtxt.cxx4
-rw-r--r--sw/source/core/crsr/swcrsr.cxx92
-rw-r--r--sw/source/core/crsr/viscrs.cxx10
-rwxr-xr-xsw/source/core/doc/doc.cxx10
-rw-r--r--sw/source/core/doc/doccomp.cxx22
-rw-r--r--sw/source/core/doc/docedt.cxx29
-rw-r--r--sw/source/core/doc/docfld.cxx20
-rw-r--r--sw/source/core/doc/docnew.cxx233
-rw-r--r--sw/source/core/doc/docredln.cxx19
-rw-r--r--sw/source/core/doc/extinput.cxx4
-rw-r--r--sw/source/core/doc/htmltbl.cxx34
-rw-r--r--sw/source/core/docnode/nodes.cxx18
-rw-r--r--sw/source/core/docnode/swbaslnk.cxx10
-rw-r--r--sw/source/core/edit/edattr.cxx2
-rw-r--r--sw/source/core/edit/edfld.cxx5
-rw-r--r--sw/source/core/edit/editsh.cxx29
-rw-r--r--sw/source/core/edit/edlingu.cxx58
-rw-r--r--sw/source/core/fields/cellfml.cxx3
-rw-r--r--sw/source/core/fields/fldbas.cxx17
-rw-r--r--sw/source/core/fields/postithelper.cxx16
-rw-r--r--sw/source/core/frmedt/feshview.cxx350
-rw-r--r--sw/source/core/inc/SwGrammarMarkUp.hxx2
-rw-r--r--sw/source/core/inc/frame.hxx4
-rw-r--r--sw/source/core/layout/layact.cxx18
-rw-r--r--sw/source/core/layout/tabfrm.cxx156
-rw-r--r--sw/source/core/swg/SwXMLSectionList.cxx26
-rw-r--r--sw/source/core/text/SwGrammarMarkUp.cxx15
-rw-r--r--sw/source/core/text/inftxt.cxx2
-rw-r--r--sw/source/core/text/inftxt.hxx2
-rw-r--r--sw/source/core/text/itrcrsr.cxx40
-rw-r--r--sw/source/core/text/porlay.cxx5
-rw-r--r--sw/source/core/text/txttab.cxx12
-rw-r--r--sw/source/core/tox/txmsrt.cxx5
-rw-r--r--sw/source/core/txtnode/atrfld.cxx13
-rw-r--r--sw/source/core/txtnode/atrftn.cxx38
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx85
-rw-r--r--sw/source/core/txtnode/thints.cxx3
-rw-r--r--sw/source/core/undo/SwUndoField.cxx12
-rw-r--r--sw/source/core/undo/unbkmk.cxx17
-rw-r--r--sw/source/core/undo/undel.cxx10
-rw-r--r--sw/source/core/undo/undobj.cxx7
-rw-r--r--sw/source/core/undo/unins.cxx15
-rw-r--r--sw/source/core/undo/unmove.cxx10
-rw-r--r--sw/source/core/unocore/unodraw.cxx42
-rw-r--r--sw/source/core/unocore/unoftn.cxx4
-rw-r--r--sw/source/core/unocore/unosett.cxx11
-rw-r--r--sw/source/core/unocore/unotbl.cxx87
-rw-r--r--[-rwxr-xr-x]sw/source/core/view/viewpg.cxx0
-rw-r--r--[-rwxr-xr-x]sw/source/core/view/viewsh.cxx15
-rw-r--r--sw/source/filter/ascii/ascatr.cxx3
-rw-r--r--sw/source/filter/html/htmlfldw.cxx2
-rw-r--r--sw/source/filter/html/htmlform.cxx8
-rw-r--r--sw/source/filter/html/swhtml.cxx2
-rw-r--r--sw/source/filter/rtf/rtfatr.cxx9
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx73
-rw-r--r--sw/source/filter/rtf/wrtrtf.cxx4
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.cxx40
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.hxx13
-rw-r--r--sw/source/filter/ww8/attributeoutputbase.hxx2
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx95
-rw-r--r--sw/source/filter/ww8/docxexport.cxx32
-rw-r--r--sw/source/filter/ww8/docxexportfilter.cxx2
-rw-r--r--sw/source/filter/ww8/dump/ww8scan.cxx4
-rw-r--r--sw/source/filter/ww8/dump/ww8scan.hxx3
-rw-r--r--sw/source/filter/ww8/writerhelper.cxx3
-rw-r--r--sw/source/filter/ww8/writerhelper.hxx3
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx37
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx14
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx14
-rwxr-xr-x[-rw-r--r--]sw/source/filter/ww8/wrtww8.cxx65
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx6
-rw-r--r--sw/source/filter/ww8/wrtww8gr.cxx10
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx14
-rw-r--r--sw/source/filter/ww8/ww8attributeoutput.hxx2
-rw-r--r--sw/source/filter/ww8/ww8graf.hxx4
-rw-r--r--sw/source/filter/ww8/ww8par.cxx183
-rw-r--r--sw/source/filter/ww8/ww8par.hxx36
-rw-r--r--sw/source/filter/ww8/ww8par2.hxx1
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx24
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx52
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx12
-rw-r--r--sw/source/filter/ww8/ww8scan.hxx3
-rw-r--r--sw/source/ui/app/apphdl.cxx15
-rw-r--r--sw/source/ui/app/docsh.cxx1
-rw-r--r--sw/source/ui/app/swmodule.cxx17
-rw-r--r--sw/source/ui/cctrl/makefile.mk3
-rwxr-xr-xsw/source/ui/config/optpage.cxx22
-rw-r--r--sw/source/ui/config/viewopt.cxx7
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx35
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx7
-rw-r--r--sw/source/ui/dialog/SwSpellDialogChildWindow.cxx146
-rwxr-xr-x[-rw-r--r--]sw/source/ui/dochdl/dochdl.src9
-rwxr-xr-x[-rw-r--r--]sw/source/ui/dochdl/gloshdl.cxx45
-rw-r--r--sw/source/ui/dochdl/swdtflvr.cxx52
-rw-r--r--sw/source/ui/docvw/PostItMgr.cxx28
-rw-r--r--sw/source/ui/docvw/SidebarTxtControl.cxx22
-rwxr-xr-x[-rw-r--r--]sw/source/ui/docvw/SidebarWin.cxx0
-rw-r--r--sw/source/ui/docvw/edtwin2.cxx18
-rw-r--r--sw/source/ui/fldui/fldmgr.cxx2
-rw-r--r--sw/source/ui/fldui/fldpage.cxx14
-rw-r--r--sw/source/ui/inc/SwSpellDialogChildWindow.hxx4
-rwxr-xr-xsw/source/ui/inc/langhelper.hxx22
-rw-r--r--sw/source/ui/inc/olmenu.hxx11
-rw-r--r--[-rwxr-xr-x]sw/source/ui/inc/srcview.hxx0
-rw-r--r--sw/source/ui/inc/swdtflvr.hxx2
-rw-r--r--sw/source/ui/inc/view.hxx9
-rw-r--r--sw/source/ui/lingu/olmenu.cxx740
-rw-r--r--sw/source/ui/lingu/olmenu.hrc82
-rw-r--r--sw/source/ui/lingu/olmenu.src17
-rw-r--r--sw/source/ui/ribbar/makefile.mk5
-rwxr-xr-xsw/source/ui/shells/annotsh.cxx52
-rw-r--r--sw/source/ui/shells/basesh.cxx5
-rw-r--r--sw/source/ui/shells/drwtxtex.cxx134
-rw-r--r--sw/source/ui/shells/drwtxtsh.cxx12
-rw-r--r--[-rwxr-xr-x]sw/source/ui/shells/langhelper.cxx256
-rw-r--r--sw/source/ui/shells/makefile.mk1
-rw-r--r--sw/source/ui/shells/textsh.cxx12
-rw-r--r--sw/source/ui/shells/textsh1.cxx61
-rw-r--r--sw/source/ui/shells/txtcrsr.cxx36
-rw-r--r--sw/source/ui/uiview/makefile.mk5
-rw-r--r--sw/source/ui/uiview/view.src4
-rw-r--r--sw/source/ui/uiview/viewdraw.cxx7
-rwxr-xr-x[-rw-r--r--]sw/source/ui/uiview/viewling.cxx222
-rw-r--r--sw/source/ui/uiview/viewstat.cxx2
-rw-r--r--sw/source/ui/uno/makefile.mk3
-rw-r--r--[-rwxr-xr-x]sw/source/ui/uno/unotxdoc.cxx15
-rw-r--r--sw/source/ui/uno/unotxvw.cxx2
-rw-r--r--sw/source/ui/uno/warnpassword.cxx86
-rw-r--r--sw/source/ui/utlui/makefile.mk4
-rw-r--r--sw/source/ui/web/web.src4
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx15
-rw-r--r--sw/uiconfig/sglobal/menubar/menubar.xml15
-rw-r--r--sw/uiconfig/sglobal/toolbar/extrusionobjectbar.xml10
-rw-r--r--sw/uiconfig/sglobal/toolbar/findbar.xml8
-rw-r--r--sw/uiconfig/sglobal/toolbar/fontworkobjectbar.xml6
-rw-r--r--sw/uiconfig/sweb/menubar/menubar.xml15
-rw-r--r--sw/uiconfig/sweb/toolbar/extrusionobjectbar.xml10
-rw-r--r--sw/uiconfig/sweb/toolbar/findbar.xml8
-rw-r--r--sw/uiconfig/sweb/toolbar/fontworkobjectbar.xml6
-rw-r--r--sw/uiconfig/swform/menubar/menubar.xml15
-rw-r--r--sw/uiconfig/swform/toolbar/extrusionobjectbar.xml10
-rw-r--r--sw/uiconfig/swform/toolbar/fontworkobjectbar.xml6
-rw-r--r--sw/uiconfig/swreport/menubar/menubar.xml15
-rw-r--r--sw/uiconfig/swreport/toolbar/extrusionobjectbar.xml10
-rw-r--r--sw/uiconfig/swreport/toolbar/fontworkobjectbar.xml6
-rw-r--r--sw/uiconfig/swriter/menubar/menubar.xml15
-rw-r--r--sw/uiconfig/swriter/toolbar/extrusionobjectbar.xml10
-rw-r--r--sw/uiconfig/swriter/toolbar/findbar.xml8
-rw-r--r--sw/uiconfig/swriter/toolbar/fontworkobjectbar.xml6
-rw-r--r--sw/uiconfig/swxform/menubar/menubar.xml15
-rw-r--r--sw/uiconfig/swxform/toolbar/extrusionobjectbar.xml10
-rw-r--r--sw/uiconfig/swxform/toolbar/findbar.xml8
-rw-r--r--sw/uiconfig/swxform/toolbar/fontworkobjectbar.xml6
211 files changed, 3174 insertions, 4993 deletions
diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx
index b019a5b08ee1..75aee6fd2009 100644
--- a/starmath/inc/dialog.hxx
+++ b/starmath/inc/dialog.hxx
@@ -300,7 +300,7 @@ public:
class SmShowSymbolSet : public Control
{
- SmSymSet aSymbolSet;
+ SymbolPtrVec_t aSymbolSet;
ScrollBar aVScrollBar;
Size aOutputSize;
Link aSelectHdlLink;
@@ -318,7 +318,7 @@ class SmShowSymbolSet : public Control
public:
SmShowSymbolSet(Window *pParent, const ResId& rResId);
- void SetSymbolSet(const SmSymSet& rSymbolSet);
+ void SetSymbolSet(const SymbolPtrVec_t& rSymbolSet);
void SelectSymbol(USHORT nSymbol);
USHORT GetSelectSymbol() const { return nSelectSymbol; }
@@ -360,8 +360,10 @@ class SmSymbolDialog : public ModalDialog
PushButton aEditBtn;
SmViewShell &rViewSh;
- SmSymSetManager &rSymSetMgr;
- const SmSymSet *pSymSet;
+ SmSymbolManager &rSymbolMgr;
+
+ String aSymbolSetName;
+ SymbolPtrVec_t aSymbolSet;
OutputDevice *pFontListDev;
@@ -373,7 +375,7 @@ class SmSymbolDialog : public ModalDialog
DECL_LINK(GetClickHdl, Button *);
void FillSymbolSets(BOOL bDeleteText = TRUE);
- void SetSymbolSetManager(SmSymSetManager &rMgr);
+ void SetSymbolSetManager(SmSymbolManager &rMgr);
const SmSym *GetSymbol() const;
void InitColor_Impl();
@@ -381,7 +383,7 @@ class SmSymbolDialog : public ModalDialog
public:
SmSymbolDialog(Window * pParent, OutputDevice *pFntListDevice,
- SmSymSetManager &rSymSetMgr, SmViewShell &rViewShell, BOOL bFreeRes = TRUE);
+ SmSymbolManager &rSymbolMgr, SmViewShell &rViewShell, BOOL bFreeRes = TRUE);
virtual ~SmSymbolDialog();
BOOL SelectSymbolSet(const XubString &rSymbolSetName);
@@ -439,8 +441,8 @@ class SmSymDefineDialog : public ModalDialog
Image aRigthArrow_Im;
Image aRigthArrow_Im_HC; // hi-contrast version
- SmSymSetManager aSymSetMgrCopy,
- &rSymSetMgr;
+ SmSymbolManager aSymbolMgrCopy,
+ &rSymbolMgr;
const SmSym *pOrigSymbol;
const SubsetMap *pSubsetMap;
@@ -462,7 +464,7 @@ class SmSymDefineDialog : public ModalDialog
void FillFonts(BOOL bDeleteText = TRUE);
void FillStyles(BOOL bDeleteText = TRUE);
- void SetSymbolSetManager(const SmSymSetManager &rMgr);
+ void SetSymbolSetManager(const SmSymbolManager &rMgr);
void SetFont(const XubString &rFontName, const XubString &rStyleName);
void SetOrigSymbol(const SmSym *pSymbol, const XubString &rSymbolSetName);
void UpdateButtons();
@@ -474,18 +476,18 @@ class SmSymDefineDialog : public ModalDialog
BOOL SelectFont(const XubString &rFontName, BOOL bApplyFont);
BOOL SelectStyle(const XubString &rStyleName, BOOL bApplyFont);
-
- SmSymSet *GetSymbolSet(const ComboBox &rComboBox);
- inline const SmSymSet *GetSymbolSet(const ComboBox &rComboBox) const;
- SmSym *GetSymbol(const ComboBox &rComboBox);
- inline const SmSym *GetSymbol(const ComboBox &rComboBox) const;
+ SmSym * GetSymbol(const ComboBox &rComboBox);
+ const SmSym * GetSymbol(const ComboBox &rComboBox) const
+ {
+ return ((SmSymDefineDialog *) this)->GetSymbol(rComboBox);
+ }
void InitColor_Impl();
virtual void DataChanged( const DataChangedEvent& rDCEvt );
public:
- SmSymDefineDialog(Window *pParent, OutputDevice *pFntListDevice, SmSymSetManager &rMgr, BOOL bFreeRes = TRUE);
+ SmSymDefineDialog(Window *pParent, OutputDevice *pFntListDevice, SmSymbolManager &rMgr, BOOL bFreeRes = TRUE);
~SmSymDefineDialog();
using OutputDevice::SetFont;
@@ -493,44 +495,31 @@ public:
// Dialog
virtual short Execute();
- inline BOOL SelectOldSymbolSet(const XubString &rSymbolSetName);
- inline BOOL SelectOldSymbol(const XubString &rSymbolName);
- inline BOOL SelectSymbolSet(const XubString &rSymbolSetName);
- inline BOOL SelectSymbol(const XubString &rSymbolName);
- BOOL SelectFont(const XubString &rFontName) { return SelectFont(rFontName, TRUE); }
- BOOL SelectStyle(const XubString &rStyleName) { return SelectStyle(rStyleName, TRUE); };
- void SelectChar(xub_Unicode cChar);
-};
-
-inline const SmSymSet * SmSymDefineDialog::GetSymbolSet(const ComboBox &rComboBox) const
-{
- return ((SmSymDefineDialog *) this)->GetSymbolSet(rComboBox);
-}
+ BOOL SelectOldSymbolSet(const XubString &rSymbolSetName)
+ {
+ return SelectSymbolSet(aOldSymbolSets, rSymbolSetName, FALSE);
+ }
-inline const SmSym * SmSymDefineDialog::GetSymbol(const ComboBox &rComboBox) const
-{
- return ((SmSymDefineDialog *) this)->GetSymbol(rComboBox);
-}
+ BOOL SelectOldSymbol(const XubString &rSymbolName)
+ {
+ return SelectSymbol(aOldSymbols, rSymbolName, FALSE);
+ }
-inline BOOL SmSymDefineDialog::SelectOldSymbolSet(const XubString &rSymbolSetName)
-{
- return SelectSymbolSet(aOldSymbolSets, rSymbolSetName, FALSE);
-}
+ BOOL SelectSymbolSet(const XubString &rSymbolSetName)
+ {
+ return SelectSymbolSet(aSymbolSets, rSymbolSetName, FALSE);
+ }
-inline BOOL SmSymDefineDialog::SelectOldSymbol(const XubString &rSymbolName)
-{
- return SelectSymbol(aOldSymbols, rSymbolName, FALSE);
-}
+ BOOL SelectSymbol(const XubString &rSymbolName)
+ {
+ return SelectSymbol(aSymbols, rSymbolName, FALSE);
+ }
-inline BOOL SmSymDefineDialog::SelectSymbolSet(const XubString &rSymbolSetName)
-{
- return SelectSymbolSet(aSymbolSets, rSymbolSetName, FALSE);
-}
+ BOOL SelectFont(const XubString &rFontName) { return SelectFont(rFontName, TRUE); }
+ BOOL SelectStyle(const XubString &rStyleName) { return SelectStyle(rStyleName, TRUE); };
+ void SelectChar(xub_Unicode cChar);
+};
-inline BOOL SmSymDefineDialog::SelectSymbol(const XubString &rSymbolName)
-{
- return SelectSymbol(aSymbols, rSymbolName, FALSE);
-}
#endif
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index f9fed9c9602a..6ef89ea5ec1b 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -484,15 +484,24 @@ public:
class SmLineNode : public SmStructureNode
{
+ BOOL bUseExtraSpaces;
+
protected:
SmLineNode(SmNodeType eNodeType, const SmToken &rNodeToken)
: SmStructureNode(eNodeType, rNodeToken)
- {}
+ {
+ bUseExtraSpaces = TRUE;
+ }
public:
SmLineNode(const SmToken &rNodeToken)
: SmStructureNode(NLINE, rNodeToken)
- {}
+ {
+ bUseExtraSpaces = TRUE;
+ }
+
+ void SetUseExtraSpaces(BOOL bVal) { bUseExtraSpaces = bVal; }
+ BOOL IsUseExtraSpaces() const { return bUseExtraSpaces; };
virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell);
virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index b3ad5ef5bdc3..facf17d561e2 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -106,7 +106,7 @@ enum SmTokenType
TLEFTARROW, TRIGHTARROW, TUPARROW, TDOWNARROW, TDIVIDES,
TNDIBVIDES, TSETN, TSETZ, TSETQ, TSETR,
TSETC, TWIDEVEC, TWIDETILDE, TWIDEHAT, TWIDESLASH,
- TWIDEBACKSLASH, TLDBRACKET, TRDBRACKET,
+ TWIDEBACKSLASH, TLDBRACKET, TRDBRACKET, TNOSPACE,
TUNKNOWN, TDEBUG
};
diff --git a/starmath/inc/smmod.hxx b/starmath/inc/smmod.hxx
index bd8292e9a7b1..f74beb9de92b 100644
--- a/starmath/inc/smmod.hxx
+++ b/starmath/inc/smmod.hxx
@@ -47,7 +47,7 @@ class SvxErrorHandler;
class SfxObjectFactory;
class SmConfig;
class SmModule;
-class SmSymSetManager;
+class SmSymbolManager;
/*************************************************************************
|*
@@ -149,7 +149,7 @@ public:
svtools::ColorConfig & GetColorConfig();
SmConfig * GetConfig();
- SmSymSetManager & GetSymSetManager();
+ SmSymbolManager & GetSymbolManager();
SmLocalizedSymbolData & GetLocSymbolData() const;
@@ -176,7 +176,6 @@ public:
};
#define SM_MOD() ( *(SmModule**) GetAppData(SHL_SM) )
-#define SM_MOD1() ( *(SmModule**) GetAppData(SHL_SM) )
#endif // _SDMOD_HXX
diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc
index 2fbc7b4066d1..d73ea27a0d45 100644
--- a/starmath/inc/starmath.hrc
+++ b/starmath/inc/starmath.hrc
@@ -379,6 +379,7 @@
#define RID_LSUPX (RID_APP_START + 1916)
#define RID_CSUBX (RID_APP_START + 1917)
#define RID_CSUPX (RID_APP_START + 1918)
+#define RID_NOSPACE (RID_APP_START + 1919)
#define RID_ALEPH (RID_APP_START + 2001)
#define RID_EMPTYSET (RID_APP_START + 2002)
@@ -694,6 +695,7 @@
#define HID_SMA_DOTSDOWN (HID_SMA_START + 240)
#define HID_SMA_DOTSLOW (HID_SMA_START + 241)
#define HID_SMA_DOTSVERT (HID_SMA_START + 242)
+#define HID_SMA_NOSPACE (HID_SMA_START + 243)
#define HID_SMA_SETN (HID_SMA2_START + 1)
#define HID_SMA_SETZ (HID_SMA2_START + 2)
diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx
index 8c8df60c2c6e..503859485095 100644
--- a/starmath/inc/symbol.hxx
+++ b/starmath/inc/symbol.hxx
@@ -28,198 +28,146 @@
#define SYMBOL_HXX
#include <vos/refernce.hxx>
-#ifndef _FONT_HXX //autogen
#include <vcl/font.hxx>
-#endif
#include <tools/list.hxx>
#include <tools/debug.hxx>
#include <tools/dynary.hxx>
#include <svl/lstner.hxx>
#include <svl/svarray.hxx>
+
+#include <map>
+#include <vector>
+#include <set>
+
#include "utility.hxx"
-#include <smmod.hxx>
+#include "smmod.hxx"
-#define SS_ATTR_ACCESS 0x80
#define SYMBOLSET_NONE 0xFFFF
#define SYMBOL_NONE 0xFFFF
-class SmSymSetManager;
////////////////////////////////////////////////////////////////////////////////
inline const String GetExportSymbolName( const String &rUiSymbolName )
{
- return SM_MOD1()->GetLocSymbolData().GetExportSymbolName( rUiSymbolName );
+ return SM_MOD()->GetLocSymbolData().GetExportSymbolName( rUiSymbolName );
}
inline const String GetUiSymbolName( const String &rExportSymbolName )
{
- return SM_MOD1()->GetLocSymbolData().GetUiSymbolName( rExportSymbolName );
+ return SM_MOD()->GetLocSymbolData().GetUiSymbolName( rExportSymbolName );
}
inline const String GetExportSymbolSetName( const String &rUiSymbolSetName )
{
- return SM_MOD1()->GetLocSymbolData().GetExportSymbolSetName( rUiSymbolSetName );
+ return SM_MOD()->GetLocSymbolData().GetExportSymbolSetName( rUiSymbolSetName );
}
inline const String GetUiSymbolSetName( const String &rExportSymbolSetName )
{
- return SM_MOD1()->GetLocSymbolData().GetUiSymbolSetName( rExportSymbolSetName );
+ return SM_MOD()->GetLocSymbolData().GetUiSymbolSetName( rExportSymbolSetName );
}
////////////////////////////////////////////////////////////////////////////////
class SmSym
{
- friend class SmSymSetManager;
-
- SmFace Face;
- String Name;
- String aExportName;
- String aSetName;
- SmSym *pHashNext;
- SmSymSetManager *pSymSetManager;
- sal_Unicode Character;
- BYTE Attribut;
- BOOL bPredefined;
- BOOL bDocSymbol;
+ SmFace m_aFace;
+ String m_aName;
+ String m_aExportName;
+ String m_aSetName;
+ sal_Unicode m_cChar;
+ BOOL m_bPredefined;
+ BOOL m_bDocSymbol;
public:
SmSym();
- SmSym(const SmSym& rSymbol);
SmSym(const String& rName, const Font& rFont, sal_Unicode cChar,
const String& rSet, BOOL bIsPredefined = FALSE);
+ SmSym(const SmSym& rSymbol);
SmSym& operator = (const SmSym& rSymbol);
- const Font& GetFace() const { return Face; }
- sal_Unicode GetCharacter() const { return Character; }
- const String& GetName() const { return Name; }
+ const Font& GetFace() const { return m_aFace; }
+ sal_Unicode GetCharacter() const { return m_cChar; }
+ const String& GetName() const { return m_aName; }
- void SetFace( const Font& rFont ) { Face = rFont; }
- void SetCharacter( sal_Unicode cChar ) { Character = cChar; }
- void SetName( const String &rTxt ) { Name = rTxt; }
+ void SetFace( const Font& rFont ) { m_aFace = rFont; }
+ void SetCharacter( sal_Unicode cChar ) { m_cChar = cChar; }
- BOOL IsPredefined() const { return bPredefined; }
- const String & GetSetName() const { return aSetName; }
- void SetSetName( const String &rName ) { aSetName = rName; }
- const String & GetExportName() const { return aExportName; }
- void SetExportName( const String &rName ) { aExportName = rName; }
+//! since the symbol name is also used as key in the map it should not be possible to change the name
+//! because ten the key would not be the same as its supposed copy here
+// void SetName( const String &rTxt ) { m_aName = rTxt; }
- BOOL IsDocSymbol() const { return bDocSymbol; }
- void SetDocSymbol( BOOL bVal ) { bDocSymbol = bVal; }
-};
+ BOOL IsPredefined() const { return m_bPredefined; }
+ const String & GetSymbolSetName() const { return m_aSetName; }
+ void SetSymbolSetName( const String &rName ) { m_aSetName = rName; }
+ const String & GetExportName() const { return m_aExportName; }
+ void SetExportName( const String &rName ) { m_aExportName = rName; }
+
+ BOOL IsDocSymbol() const { return m_bDocSymbol; }
+ void SetDocSymbol( BOOL bVal ) { m_bDocSymbol = bVal; }
-DECLARE_LIST(SmListSym, SmSym *)
-SV_DECL_PTRARR( SymbolArray, SmSym *, 32, 32 )
+ // true if rSymbol has the same name, font and character
+ bool IsEqualInUI( const SmSym& rSymbol ) const;
+};
/**************************************************************************/
-class SmSymSet
+struct lt_String
{
- friend class SmSymSetManager;
-
- SmListSym SymbolList;
- String Name;
- SmSymSetManager *pSymSetManager;
-
-public:
- SmSymSet();
- SmSymSet(const SmSymSet& rSymbolSet);
- SmSymSet(const String& rName);
- ~SmSymSet();
-
- SmSymSet& operator = (const SmSymSet& rSymbolSet);
-
- const String& GetName() const { return Name; }
- USHORT GetCount() const { return (USHORT) SymbolList.Count(); }
-
- const SmSym& GetSymbol(USHORT SymbolNo) const
+ bool operator()( const String &r1, const String &r2 ) const
{
- DBG_ASSERT(SymbolList.GetObject(SymbolNo), "Symbol nicht vorhanden");
- return *SymbolList.GetObject(SymbolNo);
+ // r1 < r2 ?
+ return r1.CompareTo( r2 ) == COMPARE_LESS;
}
-
- USHORT AddSymbol(SmSym* pSymbol);
- void DeleteSymbol(USHORT SymbolNo);
- SmSym * RemoveSymbol(USHORT SymbolNo);
- USHORT GetSymbolPos(const String& rName);
};
-DECLARE_DYNARRAY(SmArraySymSet, SmSymSet *)
-
-/**************************************************************************/
-
-class SmSymbolDialog;
-
-
-struct SmSymSetManager_Impl
-{
- SmArraySymSet SymbolSets;
- SmSymSetManager & rSymSetMgr;
- SmSym** HashEntries;
- USHORT NoSymbolSets;
- USHORT NoHashEntries;
- BOOL Modified;
-
- SmSymSetManager_Impl( SmSymSetManager &rMgr, USHORT HashTableSize );
- ~SmSymSetManager_Impl();
- SmSymSetManager_Impl & operator = ( const SmSymSetManager_Impl &rImpl );
-};
+// type of the actual container to hold the symbols
+typedef std::map< String, SmSym, lt_String > SymbolMap_t;
+// vector of pointers to the actual symbols in the above container
+typedef std::vector< const SmSym * > SymbolPtrVec_t;
-class SmSymSetManager : public SfxListener
+class SmSymbolManager : public SfxListener
{
- friend struct SmSymSetManager_Impl;
-
- SmSymSetManager_Impl *pImpl;
+ SymbolMap_t m_aSymbols;
+ bool m_bModified;
virtual void SFX_NOTIFY(SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType);
- UINT32 GetHashIndex(const String& rSymbolName);
- void EnterHashTable(SmSym& rSymbol);
- void EnterHashTable(SmSymSet& rSymbolSet);
- void FillHashTable();
void Init();
void Exit();
public:
- SmSymSetManager(USHORT HashTableSize = 137);
- SmSymSetManager(const SmSymSetManager& rSymbolSetManager);
- ~SmSymSetManager();
+ SmSymbolManager();
+ SmSymbolManager(const SmSymbolManager& rSymbolSetManager);
+ ~SmSymbolManager();
- SmSymSetManager& operator = (const SmSymSetManager& rSymbolSetManager);
+ SmSymbolManager & operator = (const SmSymbolManager& rSymbolSetManager);
- void GetSymbols( std::vector< SmSym > &rSymbols ) const;
+ // symbol sets are for UI purpose only, thus we assemble them here
+ std::set< String > GetSymbolSetNames() const;
+ const SymbolPtrVec_t GetSymbolSet( const String& rSymbolSetName );
-
- USHORT AddSymbolSet(SmSymSet* pSymbolSet);
- void ChangeSymbolSet(SmSymSet* pSymbolSet);
- void DeleteSymbolSet(USHORT SymbolSetNo);
- USHORT GetSymbolSetPos(const String& rSymbolSetName) const;
- USHORT GetSymbolSetCount() const { return pImpl->NoSymbolSets; }
- SmSymSet *GetSymbolSet(USHORT SymbolSetNo) const
- {
- return pImpl->SymbolSets.Get(SymbolSetNo);
- }
+ USHORT GetSymbolCount() const { return static_cast< USHORT >(m_aSymbols.size()); }
+ const SymbolPtrVec_t GetSymbols() const;
+ bool AddOrReplaceSymbol( const SmSym & rSymbol, bool bForceChange = false );
+ void RemoveSymbol( const String & rSymbolName );
SmSym * GetSymbolByName(const String& rSymbolName);
const SmSym * GetSymbolByName(const String& rSymbolName) const
{
- return ((SmSymSetManager *) this)->GetSymbolByName(rSymbolName);
+ return ((SmSymbolManager *) this)->GetSymbolByName(rSymbolName);
}
- void AddReplaceSymbol( const SmSym & rSymbol );
- USHORT GetSymbolCount() const;
- const SmSym * GetSymbolByPos( USHORT nPos ) const;
-
- BOOL IsModified() const { return pImpl->Modified; }
- void SetModified(BOOL Modify) { pImpl->Modified = Modify; }
+ bool IsModified() const { return m_bModified; }
+ void SetModified(bool bModify) { m_bModified = bModify; }
void Load();
void Save();
diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index da507871ed61..bf62157a30d3 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -429,7 +429,7 @@ SmMathConfig::SmMathConfig() :
pFormat = 0;
pOther = 0;
pFontFormatList = 0;
- pSymSetMgr = 0;
+ pSymbolMgr = 0;
bIsOtherModified = bIsFormatModified = FALSE;
}
@@ -441,7 +441,7 @@ SmMathConfig::~SmMathConfig()
delete pFormat;
delete pOther;
delete pFontFormatList;
- delete pSymSetMgr;
+ delete pSymbolMgr;
}
@@ -554,14 +554,14 @@ void SmMathConfig::ReadSymbol( SmSym &rSymbol,
}
-SmSymSetManager & SmMathConfig::GetSymSetManager()
+SmSymbolManager & SmMathConfig::GetSymbolManager()
{
- if (!pSymSetMgr)
+ if (!pSymbolMgr)
{
- pSymSetMgr = new SmSymSetManager;
- pSymSetMgr->Load();
+ pSymbolMgr = new SmSymbolManager;
+ pSymbolMgr->Load();
}
- return *pSymSetMgr;
+ return *pSymbolMgr;
}
@@ -570,6 +570,7 @@ void SmMathConfig::Commit()
Save();
}
+
void SmMathConfig::Save()
{
SaveOther();
@@ -577,6 +578,7 @@ void SmMathConfig::Save()
SaveFontFormatList();
}
+
void SmMathConfig::GetSymbols( std::vector< SmSym > &rSymbols ) const
{
Sequence< OUString > aNodes( ((SmMathConfig*) this)->GetNodeNames( A2OU( SYMBOL_LIST ) ) );
@@ -627,7 +629,7 @@ void SmMathConfig::SetSymbols( const std::vector< SmSym > &rNewSymbols )
// Set
pVal->Name = aNodeNameDelim;
pVal->Name += *pName++;
- OUString aTmp( rSymbol.GetSetName() );
+ OUString aTmp( rSymbol.GetSymbolSetName() );
if (rSymbol.IsPredefined())
aTmp = GetExportSymbolSetName( aTmp );
pVal->Value <<= aTmp;
diff --git a/starmath/source/cfgitem.hxx b/starmath/source/cfgitem.hxx
index 514573f6e7ac..9e4aa9f39f2f 100644
--- a/starmath/source/cfgitem.hxx
+++ b/starmath/source/cfgitem.hxx
@@ -122,7 +122,7 @@ class SmMathConfig : public utl::ConfigItem
SmFormat * pFormat;
SmCfgOther * pOther;
SmFontFormatList * pFontFormatList;
- SmSymSetManager * pSymSetMgr;
+ SmSymbolManager * pSymbolMgr;
BOOL bIsOtherModified;
BOOL bIsFormatModified;
@@ -182,7 +182,7 @@ public:
//using utl::ConfigItem::ReplaceSetProperties;
//using utl::ConfigItem::GetReadOnlyStates;
- SmSymSetManager & GetSymSetManager();
+ SmSymbolManager & GetSymbolManager();
void GetSymbols( std::vector< SmSym > &rSymbols ) const;
void SetSymbols( const std::vector< SmSym > &rNewSymbols );
diff --git a/starmath/source/commands.src b/starmath/source/commands.src
index 75c00cb819a6..9d618bbd0cf3 100644
--- a/starmath/source/commands.src
+++ b/starmath/source/commands.src
@@ -223,6 +223,7 @@ String RID_LEFTARROW { Text = "leftarrow " ; };
String RID_RIGHTARROW { Text = "rightarrow " ; };
String RID_UPARROW { Text = "uparrow " ; };
String RID_DOWNARROW { Text = "downarrow " ; };
+String RID_NOSPACE { Text = "nospace {<?>} " ; };
//////////////////////////////////////////
@@ -1327,6 +1328,12 @@ Menu RID_COMMANDMENU
};
MenuItem
{
+ Identifier = RID_NOSPACE;
+ HelpId = HID_SMA_NOSPACE;
+ Text [ en-US ] = "nospace {...}";
+ };
+ MenuItem
+ {
Identifier = RID_BINOMXY;
HelpId = HID_SMA_BINOMXY;
Text = "binom x y";
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 257fdb959484..037f2fc1dff8 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -426,7 +426,7 @@ IMPL_LINK( SmFontSizeDialog, DefaultButtonClickHdl, Button *, EMPTYARG /*pButton
if (pQueryBox->Execute() == RET_YES)
{
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
SmFormat aFmt( pp->GetConfig()->GetStandardFormat() );
WriteTo( aFmt );
pp->GetConfig()->SetStandardFormat( aFmt );
@@ -533,7 +533,7 @@ IMPL_LINK_INLINE_START( SmFontTypeDialog, DefaultButtonClickHdl, Button *, EMPTY
QueryBox *pQueryBox = new QueryBox(this, SmResId(RID_DEFAULTSAVEQUERY));
if (pQueryBox->Execute() == RET_YES)
{
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
SmFormat aFmt( pp->GetConfig()->GetStandardFormat() );
WriteTo( aFmt );
pp->GetConfig()->SetStandardFormat( aFmt, TRUE );
@@ -579,7 +579,7 @@ SmFontTypeDialog::SmFontTypeDialog(Window * pParent, OutputDevice *pFntListDevic
void SmFontTypeDialog::ReadFrom(const SmFormat &rFormat)
{
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
aVariableFont = pp->GetConfig()->GetFontPickList(FNT_VARIABLE);
aFunctionFont = pp->GetConfig()->GetFontPickList(FNT_FUNCTION);
@@ -601,7 +601,7 @@ void SmFontTypeDialog::ReadFrom(const SmFormat &rFormat)
void SmFontTypeDialog::WriteTo(SmFormat &rFormat) const
{
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
pp->GetConfig()->GetFontPickList(FNT_VARIABLE) = aVariableFont;
pp->GetConfig()->GetFontPickList(FNT_FUNCTION) = aFunctionFont;
@@ -740,7 +740,7 @@ IMPL_LINK( SmDistanceDialog, DefaultButtonClickHdl, Button *, EMPTYARG /*pButton
if (pQueryBox->Execute() == RET_YES)
{
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
SmFormat aFmt( pp->GetConfig()->GetStandardFormat() );
WriteTo( aFmt );
pp->GetConfig()->SetStandardFormat( aFmt );
@@ -1063,7 +1063,7 @@ IMPL_LINK( SmAlignDialog, DefaultButtonClickHdl, Button *, EMPTYARG /*pButton*/
if (pQueryBox->Execute() == RET_YES)
{
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
SmFormat aFmt( pp->GetConfig()->GetStandardFormat() );
WriteTo( aFmt );
pp->GetConfig()->SetStandardFormat( aFmt );
@@ -1140,12 +1140,12 @@ void SmShowSymbolSet::Paint(const Rectangle&)
SetMapMode(MapMode(MAP_PIXEL));
USHORT v = sal::static_int_cast< USHORT >((aVScrollBar.GetThumbPos() * nColumns));
- USHORT nSymbols = aSymbolSet.GetCount();
+ size_t nSymbols = aSymbolSet.size();
Color aTxtColor( GetTextColor() );
for (USHORT i = v; i < nSymbols ; i++)
{
- SmSym aSymbol (aSymbolSet.GetSymbol(i));
+ SmSym aSymbol (*aSymbolSet[i]);
Font aFont (aSymbol.GetFace());
aFont.SetAlign(ALIGN_TOP);
@@ -1206,7 +1206,7 @@ void SmShowSymbolSet::KeyInput(const KeyEvent& rKEvt)
case KEY_LEFT: n -= 1; break;
case KEY_RIGHT: n += 1; break;
case KEY_HOME: n = 0; break;
- case KEY_END: n = aSymbolSet.GetCount() - 1; break;
+ case KEY_END: n = static_cast< USHORT >(aSymbolSet.size() - 1); break;
case KEY_PAGEUP: n -= nColumns * nRows; break;
case KEY_PAGEDOWN: n += nColumns * nRows; break;
@@ -1218,7 +1218,7 @@ void SmShowSymbolSet::KeyInput(const KeyEvent& rKEvt)
else
n = 0;
- if (n >= aSymbolSet.GetCount())
+ if (n >= aSymbolSet.size())
n = nSelectSymbol;
// adjust scrollbar
@@ -1274,13 +1274,13 @@ SmShowSymbolSet::SmShowSymbolSet(Window *pParent, const ResId& rResId) :
}
-void SmShowSymbolSet::SetSymbolSet(const SmSymSet& rSymbolSet)
+void SmShowSymbolSet::SetSymbolSet(const SymbolPtrVec_t& rSymbolSet)
{
aSymbolSet = rSymbolSet;
- if (aSymbolSet.GetCount() > (nColumns * nRows))
+ if (static_cast< USHORT >(aSymbolSet.size()) > (nColumns * nRows))
{
- aVScrollBar.SetRange(Range(0, ((aSymbolSet.GetCount() + (nColumns - 1)) / nColumns) - nRows));
+ aVScrollBar.SetRange(Range(0, ((aSymbolSet.size() + (nColumns - 1)) / nColumns) - nRows));
aVScrollBar.Enable(TRUE);
}
else
@@ -1302,10 +1302,10 @@ void SmShowSymbolSet::SelectSymbol(USHORT nSymbol)
((nSelectSymbol - v) / nColumns) * nLen),
Size(nLen, nLen)));
- if (nSymbol < aSymbolSet.GetCount())
+ if (nSymbol < aSymbolSet.size())
nSelectSymbol = nSymbol;
- if (aSymbolSet.GetCount() == 0)
+ if (aSymbolSet.size() == 0)
nSelectSymbol = SYMBOL_NONE;
if (nSelectSymbol != SYMBOL_NONE)
@@ -1380,9 +1380,10 @@ void SmSymbolDialog::FillSymbolSets(BOOL bDeleteText)
if (bDeleteText)
aSymbolSets.SetNoSelection();
- USHORT nNumSymSets = rSymSetMgr.GetSymbolSetCount();
- for (USHORT i = 0; i < nNumSymSets; i++)
- aSymbolSets.InsertEntry(rSymSetMgr.GetSymbolSet(i)->GetName());
+ std::set< String > aSybolSetNames( rSymbolMgr.GetSymbolSetNames() );
+ std::set< String >::const_iterator aIt( aSybolSetNames.begin() );
+ for ( ; aIt != aSybolSetNames.end(); ++aIt)
+ aSymbolSets.InsertEntry( *aIt );
}
@@ -1416,7 +1417,7 @@ IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, EMPTYARG pButton )
DBG_ASSERT(pButton == &aEditBtn, "Sm : falsches Argument");
#endif
- SmSymDefineDialog *pDialog = new SmSymDefineDialog(this, pFontListDev, rSymSetMgr);
+ SmSymDefineDialog *pDialog = new SmSymDefineDialog(this, pFontListDev, rSymbolMgr);
// aktuelles Symbol und SymbolSet am neuen Dialog setzen
const XubString aSymSetName (aSymbolSets.GetSelectEntry()),
@@ -1432,9 +1433,9 @@ IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, EMPTYARG pButton )
USHORT nSymPos = GetSelectedSymbol();
// Dialog an evtl geaenderte Daten des SymbolSet Manager anpassen
- if (pDialog->Execute() == RET_OK && rSymSetMgr.IsModified())
+ if (pDialog->Execute() == RET_OK && rSymbolMgr.IsModified())
{
- rSymSetMgr.Save();
+ rSymbolMgr.Save();
FillSymbolSets();
}
@@ -1442,7 +1443,16 @@ IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, EMPTYARG pButton )
// (soweit eines vorhanden ist)
if (!SelectSymbolSet(aOldSymbolSet) && aSymbolSets.GetEntryCount() > 0)
SelectSymbolSet(aSymbolSets.GetEntry(0));
+ else
+ {
+ // just update display of current symbol set
+ DBG_ASSERT( aSymSetName == aSymSetName, "unexpected change in symbol set name" );
+ aSymbolSet = rSymbolMgr.GetSymbolSet( aSymbolSetName );
+ aSymbolSetDisplay.SetSymbolSet( aSymbolSet );
+ }
+ if (nSymPos >= aSymbolSet.size())
+ nSymPos = static_cast< USHORT >(aSymbolSet.size()) - 1;
SelectSymbol( nSymPos );
delete pDialog;
@@ -1499,7 +1509,7 @@ IMPL_LINK_INLINE_END( SmSymbolDialog, CloseClickHdl, Button *, pButton )
SmSymbolDialog::SmSymbolDialog(Window *pParent, OutputDevice *pFntListDevice,
- SmSymSetManager &rMgr, SmViewShell &rViewShell, BOOL bFreeRes) :
+ SmSymbolManager &rMgr, SmViewShell &rViewShell, BOOL bFreeRes) :
ModalDialog (pParent, SmResId(RID_SYMBOLDIALOG)),
aSymbolSetText (this, SmResId(1)),
aSymbolSets (this, SmResId(1)),
@@ -1510,13 +1520,14 @@ SmSymbolDialog::SmSymbolDialog(Window *pParent, OutputDevice *pFntListDevice,
aCloseBtn (this, SmResId(3)),
aEditBtn (this, SmResId(1)),
rViewSh (rViewShell),
- rSymSetMgr (rMgr),
+ rSymbolMgr (rMgr),
pFontListDev (pFntListDevice)
{
if (bFreeRes)
FreeResource();
- pSymSet = NULL;
+ aSymbolSetName = String();
+ aSymbolSet.clear();
FillSymbolSets();
if (aSymbolSets.GetEntryCount() > 0)
SelectSymbolSet(aSymbolSets.GetEntry(0));
@@ -1580,18 +1591,17 @@ BOOL SmSymbolDialog::SelectSymbolSet(const XubString &rSymbolSetName)
BOOL bRet = FALSE;
USHORT nPos = aSymbolSets.GetEntryPos(rSymbolSetName);
- pSymSet = NULL;
+ aSymbolSetName = String();
+ aSymbolSet.clear();
if (nPos != LISTBOX_ENTRY_NOTFOUND)
{
aSymbolSets.SelectEntryPos(nPos);
- USHORT nSymbolSetNo = rSymSetMgr.GetSymbolSetPos(aSymbolSets.GetSelectEntry());
- pSymSet = rSymSetMgr.GetSymbolSet(nSymbolSetNo);
-#if OSL_DEBUG_LEVEL > 1
- DBG_ASSERT(pSymSet, "Sm : NULL pointer");
-#endif
- aSymbolSetDisplay.SetSymbolSet(*pSymSet);
- if (pSymSet->GetCount() > 0)
+ aSymbolSetName = rSymbolSetName;
+ aSymbolSet = rSymbolMgr.GetSymbolSet( aSymbolSetName );
+
+ aSymbolSetDisplay.SetSymbolSet( aSymbolSet );
+ if (aSymbolSet.size() > 0)
SelectSymbol(0);
bRet = TRUE;
@@ -1606,8 +1616,8 @@ BOOL SmSymbolDialog::SelectSymbolSet(const XubString &rSymbolSetName)
void SmSymbolDialog::SelectSymbol(USHORT nSymbolNo)
{
const SmSym *pSym = NULL;
- if (pSymSet && nSymbolNo < pSymSet->GetCount())
- pSym = &pSymSet->GetSymbol(nSymbolNo);
+ if (aSymbolSetName.Len() > 0 && nSymbolNo < static_cast< USHORT >(aSymbolSet.size()))
+ pSym = aSymbolSet[ nSymbolNo ];
aSymbolSetDisplay.SelectSymbol(nSymbolNo);
aSymbolDisplay.SetSymbol(pSym);
@@ -1618,7 +1628,8 @@ void SmSymbolDialog::SelectSymbol(USHORT nSymbolNo)
const SmSym * SmSymbolDialog::GetSymbol() const
{
USHORT nSymbolNo = aSymbolSetDisplay.GetSelectSymbol();
- return pSymSet == NULL ? NULL : &pSymSet->GetSymbol(nSymbolNo);
+ bool bValid = aSymbolSetName.Len() > 0 && nSymbolNo < static_cast< USHORT >(aSymbolSet.size());
+ return bValid ? aSymbolSet[ nSymbolNo ] : NULL;
}
@@ -1678,15 +1689,10 @@ void SmSymDefineDialog::FillSymbols(ComboBox &rComboBox, BOOL bDeleteText)
if (bDeleteText)
rComboBox.SetText(XubString());
- ComboBox &rSymbolSets = &rComboBox == &aOldSymbols ?
- aOldSymbolSets : aSymbolSets;
- const SmSymSet *pSymSet = GetSymbolSet(rSymbolSets);
- if (pSymSet)
- { USHORT nNumSymbols = pSymSet->GetCount();
- for (USHORT i = 0; i < nNumSymbols; i++)
- rComboBox.InsertEntry(pSymSet->GetSymbol(i).GetName());
- }
-
+ ComboBox &rBox = &rComboBox == &aOldSymbols ? aOldSymbolSets : aSymbolSets;
+ SymbolPtrVec_t aSymSet( aSymbolMgrCopy.GetSymbolSet( rBox.GetText() ) );
+ for (size_t i = 0; i < aSymSet.size(); ++i)
+ rComboBox.InsertEntry( aSymSet[i]->GetName() );
}
@@ -1701,9 +1707,10 @@ void SmSymDefineDialog::FillSymbolSets(ComboBox &rComboBox, BOOL bDeleteText)
if (bDeleteText)
rComboBox.SetText(XubString());
- USHORT nNumSymSets = aSymSetMgrCopy.GetSymbolSetCount();
- for (USHORT i = 0; i < nNumSymSets; i++)
- rComboBox.InsertEntry(aSymSetMgrCopy.GetSymbolSet(i)->GetName());
+ const std::set< String > aSymbolSetNames( aSymbolMgrCopy.GetSymbolSetNames() );
+ std::set< String >::const_iterator aIt( aSymbolSetNames.begin() );
+ for ( ; aIt != aSymbolSetNames.end(); ++aIt)
+ rComboBox.InsertEntry( *aIt );
}
@@ -1748,26 +1755,13 @@ void SmSymDefineDialog::FillStyles(BOOL bDeleteText)
}
-SmSymSet * SmSymDefineDialog::GetSymbolSet(const ComboBox &rComboBox)
-{
-#if OSL_DEBUG_LEVEL > 1
- DBG_ASSERT(&rComboBox == &aOldSymbolSets || &rComboBox == &aSymbolSets,
- "Sm : falsche ComboBox");
-#endif
- USHORT nSymbolSetNo = aSymSetMgrCopy.GetSymbolSetPos(rComboBox.GetText());
-
- return nSymbolSetNo == SYMBOLSET_NONE ?
- NULL : aSymSetMgrCopy.GetSymbolSet(nSymbolSetNo);
-}
-
-
SmSym * SmSymDefineDialog::GetSymbol(const ComboBox &rComboBox)
{
#if OSL_DEBUG_LEVEL > 1
DBG_ASSERT(&rComboBox == &aOldSymbols || &rComboBox == &aSymbols,
"Sm : falsche ComboBox");
#endif
- return aSymSetMgrCopy.GetSymbolByName(rComboBox.GetText());
+ return aSymbolMgrCopy.GetSymbolByName(rComboBox.GetText());
}
@@ -1897,32 +1891,23 @@ IMPL_LINK( SmSymDefineDialog, AddClickHdl, Button *, EMPTYARG pButton )
DBG_ASSERT(aAddBtn.IsEnabled(), "Sm : Voraussetzungen erfuellt ??");
#endif
- SmSymSet *pSymSet = GetSymbolSet(aSymbolSets);
-
- // SymbolSet einfuegen falls es noch nicht existiert
- if (!pSymSet)
- {
- pSymSet = new SmSymSet(aSymbolSets.GetText());
- aSymSetMgrCopy.AddSymbolSet(pSymSet);
- FillSymbolSets(aOldSymbolSets, FALSE);
- FillSymbolSets(aSymbolSets, FALSE);
- }
-#if OSL_DEBUG_LEVEL > 1
- DBG_ASSERT(pSymSet, "Sm : NULL pointer");
-#endif
-
- // Symbol ins SymbolSet einfuegen
+ // add symbol
// TO_DO_UCS4 (#i74049): get rid of cast without loosing UCS4 functionality
- SmSym *pSym = new SmSym(aSymbols.GetText(), aCharsetDisplay.GetFont(),
- sal::static_int_cast< sal_Unicode >(aCharsetDisplay.GetSelectCharacter()),
- aSymbolSets.GetText());
- pSymSet->AddSymbol(pSym);
-
- // update der Hash Tabelle erzwingen (damit aAddBtn disabled wird).
- // (wird spaeter nach Ueberarbeitung von symbol.cxx ueberfluessig werden).
- aSymSetMgrCopy.ChangeSymbolSet((SmSymSet *)1);
-
- // Symbolliste aktualiseren
+ const SmSym aNewSymbol( aSymbols.GetText(), aCharsetDisplay.GetFont(),
+ sal::static_int_cast< sal_Unicode >( aCharsetDisplay.GetSelectCharacter() ),
+ aSymbolSets.GetText() );
+ //DBG_ASSERT( aSymbolMgrCopy.GetSymbolByName(aTmpSymbolName) == NULL, "symbol already exists" );
+ aSymbolMgrCopy.AddOrReplaceSymbol( aNewSymbol );
+
+ // update display of new symbol
+ aSymbolDisplay.SetChar( aNewSymbol.GetCharacter() );
+ aSymbolDisplay.SetFont( aNewSymbol.GetFace() );
+ aSymbolName.SetText( aNewSymbol.GetName() );
+ aSymbolSetName.SetText( aNewSymbol.GetSymbolSetName() );
+
+ // update list box entries
+ FillSymbolSets(aOldSymbolSets, FALSE);
+ FillSymbolSets(aSymbolSets, FALSE);
FillSymbols(aOldSymbols ,FALSE);
FillSymbols(aSymbols ,FALSE);
@@ -1940,61 +1925,36 @@ IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, Button *, EMPTYARG pButton )
DBG_ASSERT(aChangeBtn.IsEnabled(), "Sm : Voraussetzungen erfuellt ??");
#endif
- // finden des SymbolSets zum alten Symbol
- SmSymSet *pOldSymSet = GetSymbolSet(aOldSymbolSets);
-#if OSL_DEBUG_LEVEL > 1
- DBG_ASSERT(pOldSymSet, "Sm : NULL pointer");
-#endif
-
- // suchen des neuen SymbolSets
- SmSymSet *pNewSymSet = GetSymbolSet(aSymbolSets);
- // SymbolSet einfuegen falls es noch nicht existiert
- if (!pNewSymSet)
- {
- pNewSymSet = new SmSymSet(aSymbolSets.GetText());
- aSymSetMgrCopy.AddSymbolSet(pNewSymSet);
- FillSymbolSets(aOldSymbolSets, FALSE);
- FillSymbolSets(aSymbolSets, FALSE);
- }
-
- // das (alte) Symbol besorgen
- USHORT nSymbol = pOldSymSet->GetSymbolPos(aOldSymbols.GetText());
- SmSym *pSym = (SmSym *) &pOldSymSet->GetSymbol(nSymbol);
-#if OSL_DEBUG_LEVEL > 1
- DBG_ASSERT( SYMBOL_NONE != nSymbol, "symbol not found" );
- DBG_ASSERT(pSym, "Sm : NULL pointer");
-#endif
-
- // apply changes
- pSym->SetName( aSymbols.GetText() );
- //! get font from symbol-display since charset-display does not keep
+ // get new Sybol to use
+ //! get font from symbol-disp lay since charset-display does not keep
//! the bold attribut.
- pSym->SetFace( aSymbolDisplay.GetFont() );
// TO_DO_UCS4 (#i74049): get rid of cast without loosing UCS4 functionality
- pSym->SetCharacter( sal::static_int_cast< sal_Unicode >(aCharsetDisplay.GetSelectCharacter()) );
-
- // das SymbolSet wechseln wenn noetig
- if (pOldSymSet != pNewSymSet)
- {
- pNewSymSet->AddSymbol( new SmSym( *pSym ) );
- pOldSymSet->DeleteSymbol(nSymbol);
-
- //
- // update controls
- //
- // actualize symbol-lists in the dialog
- String aTmpOldSymbolName( pOrigSymbol->GetName() );
- aOldSymbols.SetText( String() );
- aOldSymbols.RemoveEntry( aTmpOldSymbolName );
- if (aSymbolSets.GetText() == aOldSymbolSets.GetText())
- aSymbols.RemoveEntry( aTmpOldSymbolName );
- // clear display for original symbol
+ const SmSym aNewSymbol( aSymbols.GetText(), aCharsetDisplay.GetFont(),
+ sal::static_int_cast< sal_Unicode >( aCharsetDisplay.GetSelectCharacter() ),
+ aSymbolSets.GetText() );
+
+ // remove old symbol if the name was changed then add new one
+// const bool bSetNameChanged = aOldSymbolSets.GetText() != aSymbolSets.GetText();
+ const bool bNameChanged = aOldSymbols.GetText() != aSymbols.GetText();
+ if (bNameChanged)
+ aSymbolMgrCopy.RemoveSymbol( aOldSymbols.GetText() );
+ aSymbolMgrCopy.AddOrReplaceSymbol( aNewSymbol, true );
+
+ // clear display for original symbol if necessary
+ if (bNameChanged)
SetOrigSymbol(NULL, XubString());
- }
- //!! den SymbolSet Manger dazu zwingen seinen HashTable zu aktualisieren,
- //!! um mit moeglich neuen bzw fehlenden alten Symbol Namen konform zu sein.
- aSymSetMgrCopy.ChangeSymbolSet((SmSymSet *)1);
+ // update display of new symbol
+ aSymbolDisplay.SetChar( aNewSymbol.GetCharacter() );
+ aSymbolDisplay.SetFont( aNewSymbol.GetFace() );
+ aSymbolName.SetText( aNewSymbol.GetName() );
+ aSymbolSetName.SetText( aNewSymbol.GetSymbolSetName() );
+
+ // update list box entries
+ FillSymbolSets(aOldSymbolSets, FALSE);
+ FillSymbolSets(aSymbolSets, FALSE);
+ FillSymbols(aOldSymbols ,FALSE);
+ FillSymbols(aSymbols ,FALSE);
UpdateButtons();
@@ -2012,33 +1972,16 @@ IMPL_LINK( SmSymDefineDialog, DeleteClickHdl, Button *, EMPTYARG pButton )
if (pOrigSymbol)
{
- // loeschen des Symbols:
- //
- // zugehoeriges SymbolSet finden
- SmSymSet *pSymSet = GetSymbolSet(aOldSymbolSets);
- // finden des Index
- XubString aTmpOldSymbolName (pOrigSymbol->GetName());
- USHORT nSymbolNo = pSymSet->GetSymbolPos(aTmpOldSymbolName);
- // Bezuege auf das Symbols loeschen
+ aSymbolMgrCopy.RemoveSymbol( pOrigSymbol->GetName() );
+
+ // clear display for original symbol
SetOrigSymbol(NULL, XubString());
- // und weg mit dem Symbol
- pSymSet->DeleteSymbol(nSymbolNo);
-#if OSL_DEBUG_LEVEL > 1
- DBG_ASSERT(pSymSet, "Sm : NULL pointer");
- DBG_ASSERT(nSymbolNo != SYMBOL_NONE, "Sm : kein Symbol");
-#endif
- //!! den SymbolSet Manger dazu zwingen seinen HashTable zu aktualisieren,
- //!! was er naemlich nicht tut, wenn in einem seiner SymbolSets geaendert/
- //!! geloescht wird, was wiederum zu einem Absturz fuehren kann (wenn er
- //!! ueber ein nicht mehr existentes aber nicht entferntes Symbol iteriert).
- aSymSetMgrCopy.ChangeSymbolSet((SmSymSet *)1);
-
- // aktualisieren der Symboleintraege des Dialogs
- aOldSymbols.SetText(XubString());
- aOldSymbols.RemoveEntry(aTmpOldSymbolName);
- if (aSymbolSets.GetText() == aOldSymbolSets.GetText())
- aSymbols.RemoveEntry(aTmpOldSymbolName);
+ // update list box entries
+ FillSymbolSets(aOldSymbolSets, FALSE);
+ FillSymbolSets(aSymbolSets, FALSE);
+ FillSymbols(aOldSymbols ,FALSE);
+ FillSymbols(aSymbols ,FALSE);
}
UpdateButtons();
@@ -2070,7 +2013,7 @@ void SmSymDefineDialog::UpdateButtons()
&& aCharsetDisplay.GetSelectCharacter() == pOrigSymbol->GetCharacter();
// hinzufuegen nur wenn es noch kein Symbol desgleichen Namens gibt
- bAdd = aSymSetMgrCopy.GetSymbolByName(aTmpSymbolName) == NULL;
+ bAdd = aSymbolMgrCopy.GetSymbolByName(aTmpSymbolName) == NULL;
// loeschen nur wenn alle Einstellungen gleich sind
bDelete = pOrigSymbol != NULL;
@@ -2078,9 +2021,12 @@ void SmSymDefineDialog::UpdateButtons()
// aendern wenn bei gleichem Namen mindestens eine Einstellung anders ist
// oder wenn es noch kein Symbol des neuen Namens gibt (wuerde implizites
// loeschen des bereits vorhandenen Symbols erfordern)
- BOOL bEqualName = pOrigSymbol && aTmpSymbolName == pOrigSymbol->GetName();
- bChange = pOrigSymbol && ( (bEqualName && !bEqual) || (!bEqualName && bAdd) );
- }
+// BOOL bEqualName = pOrigSymbol && aTmpSymbolName == pOrigSymbol->GetName();
+// bChange = pOrigSymbol && ( (bEqualName && !bEqual) || (!bEqualName && bAdd) );
+
+ // aendern nur falls altes Symbol vorhanden und am neuen etwas anders ist
+ bChange = pOrigSymbol && !bEqual;
+}
aAddBtn .Enable(bAdd);
aChangeBtn.Enable(bChange);
@@ -2089,7 +2035,7 @@ void SmSymDefineDialog::UpdateButtons()
SmSymDefineDialog::SmSymDefineDialog(Window * pParent,
- OutputDevice *pFntListDevice, SmSymSetManager &rMgr, BOOL bFreeRes) :
+ OutputDevice *pFntListDevice, SmSymbolManager &rMgr, BOOL bFreeRes) :
ModalDialog (pParent, SmResId(RID_SYMDEFINEDIALOG)),
aOldSymbolText (this, SmResId(1)),
aOldSymbols (this, SmResId(1)),
@@ -2120,7 +2066,7 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent,
aRightArrow (this, SmResId(1)),
aRigthArrow_Im (SmResId(1)),
aRigthArrow_Im_HC (SmResId(2)), // hi-contrast version
- rSymSetMgr (rMgr),
+ rSymbolMgr (rMgr),
pSubsetMap (NULL),
pFontList (NULL)
{
@@ -2131,9 +2077,10 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent,
pOrigSymbol = 0;
- // make autocompletion for symbols case-sensitive
- aOldSymbols.EnableAutocomplete(TRUE, TRUE);
- aSymbols .EnableAutocomplete(TRUE, TRUE);
+ // auto completion is troublesome since that symbols character also gets automatically selected in the
+ // display and if the user previously selected a character to define/redefine that one this is bad
+ aOldSymbols.EnableAutocomplete( FALSE, TRUE );
+ aSymbols .EnableAutocomplete( FALSE, TRUE );
FillFonts();
if (aFonts.GetEntryCount() > 0)
@@ -2141,7 +2088,7 @@ SmSymDefineDialog::SmSymDefineDialog(Window * pParent,
InitColor_Impl();
- SetSymbolSetManager(rSymSetMgr);
+ SetSymbolSetManager(rSymbolMgr);
aOldSymbols .SetSelectHdl(LINK(this, SmSymDefineDialog, OldSymbolChangeHdl));
aOldSymbolSets .SetSelectHdl(LINK(this, SmSymDefineDialog, OldSymbolSetChangeHdl));
@@ -2215,41 +2162,23 @@ short SmSymDefineDialog::Execute()
short nResult = ModalDialog::Execute();
// Aenderungen uebernehmen falls Dialog mit OK beendet wurde
- if (aSymSetMgrCopy.IsModified() && nResult == RET_OK)
- {
- // leere SymbolSets aus dem Ergebnis entfernen.
- // Dabei von hinten durch das array iterieren, da beim loeschen die
- // Elemente aufruecken.
- USHORT nSymbolSets = aSymSetMgrCopy.GetSymbolSetCount();
- for (USHORT i = 0; i < nSymbolSets; i++)
- {
- USHORT nIdx = nSymbolSets - 1 - i;
- if (aSymSetMgrCopy.GetSymbolSet(nIdx)->GetCount() == 0)
- aSymSetMgrCopy.DeleteSymbolSet(nIdx);
- }
-
-
-
- rSymSetMgr = aSymSetMgrCopy;
-#ifdef DEBUG
-// USHORT nS = rSymSetMgr.GetSymbolSetCount();
-#endif
- }
+ if (aSymbolMgrCopy.IsModified() && nResult == RET_OK)
+ rSymbolMgr = aSymbolMgrCopy;
return nResult;
}
-void SmSymDefineDialog::SetSymbolSetManager(const SmSymSetManager &rMgr)
+void SmSymDefineDialog::SetSymbolSetManager(const SmSymbolManager &rMgr)
{
- aSymSetMgrCopy = rMgr;
+ aSymbolMgrCopy = rMgr;
#ifdef DEBUG
-// USHORT nS = aSymSetMgrCopy.GetSymbolSetCount();
+// USHORT nS = aSymbolMgrCopy.GetSymbolSetCount();
#endif
// Das modified Flag der Kopie auf FALSE setzen, damit man spaeter damit
// testen kann ob sich was geaendert hat.
- aSymSetMgrCopy.SetModified(FALSE);
+ aSymbolMgrCopy.SetModified(FALSE);
FillSymbolSets(aOldSymbolSets);
if (aOldSymbolSets.GetEntryCount() > 0)
@@ -2404,13 +2333,13 @@ BOOL SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox,
{
// bei Wechsel des alten Symbols nur vorhandene anzeigen sonst keins
const SmSym *pOldSymbol = NULL;
- XubString aTMpOldSymbolSetName;
+ XubString aTmpOldSymbolSetName;
if (nPos != COMBOBOX_ENTRY_NOTFOUND)
{
- pOldSymbol = aSymSetMgrCopy.GetSymbolByName(aNormName);
- aTMpOldSymbolSetName = aOldSymbolSets.GetText();
+ pOldSymbol = aSymbolMgrCopy.GetSymbolByName(aNormName);
+ aTmpOldSymbolSetName = aOldSymbolSets.GetText();
}
- SetOrigSymbol(pOldSymbol, aTMpOldSymbolSetName);
+ SetOrigSymbol(pOldSymbol, aTmpOldSymbolSetName);
}
else
aSymbolName.SetText(rComboBox.GetText());
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index ff2d5bed71a2..49739af72972 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -143,8 +143,8 @@ void SmDocShell::LoadSymbols()
{
RTL_LOGFILE_CONTEXT( aLog, "starmath: SmDocShell::LoadSymbols" );
- SmModule *pp = SM_MOD1();
- pp->GetSymSetManager().Load();
+ SmModule *pp = SM_MOD();
+ pp->GetSymbolManager().Load();
}
@@ -274,7 +274,7 @@ void SmDocShell::ArrangeFormula()
pOutDev = &pView->GetGraphicWindow();
else
{
- pOutDev = &SM_MOD1()->GetDefaultVirtualDev();
+ pOutDev = &SM_MOD()->GetDefaultVirtualDev();
pOutDev->SetMapMode( MapMode(MAP_100TH_MM) );
}
}
@@ -608,7 +608,7 @@ Printer* SmDocShell::GetPrt()
SID_NO_RIGHT_SPACES, SID_NO_RIGHT_SPACES,
0);
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
pp->GetConfig()->ConfigToItemSet(*pOptions);
pPrinter = new SfxPrinter(pOptions);
pPrinter->SetMapMode( MapMode(MAP_100TH_MM) );
@@ -690,7 +690,7 @@ SmDocShell::SmDocShell( const sal_uInt64 i_nSfxCreationFlags ) :
SetPool(&SFX_APP()->GetPool());
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
aFormat = pp->GetConfig()->GetStandardFormat();
StartListening(aFormat);
@@ -705,7 +705,7 @@ SmDocShell::~SmDocShell()
{
RTL_LOGFILE_CONTEXT( aLog, "starmath: SmDocShell::~SmDocShell" );
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
EndListening(aFormat);
EndListening(*pp->GetConfig());
@@ -1001,7 +1001,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
case SID_AUTO_REDRAW :
{
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
BOOL bRedraw = pp->GetConfig()->IsAutoRedraw();
pp->GetConfig()->SetAutoRedraw(!bRedraw);
}
@@ -1020,7 +1020,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
// get device used to retrieve the FontList
OutputDevice *pDev = GetPrinter();
if (!pDev || pDev->GetDevFontCount() == 0)
- pDev = &SM_MOD1()->GetDefaultVirtualDev();
+ pDev = &SM_MOD()->GetDefaultVirtualDev();
DBG_ASSERT (pDev, "device for font list missing" );
SmFontTypeDialog *pFontTypeDialog = new SmFontTypeDialog( NULL, pDev );
@@ -1104,7 +1104,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
pAlignDialog->WriteTo(aNewFormat);
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
SmFormat aFmt( pp->GetConfig()->GetStandardFormat() );
pAlignDialog->WriteTo( aFmt );
pp->GetConfig()->SetStandardFormat( aFmt );
@@ -1201,7 +1201,7 @@ void SmDocShell::GetState(SfxItemSet &rSet)
case SID_AUTO_REDRAW :
{
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
BOOL bRedraw = pp->GetConfig()->IsAutoRedraw();
rSet.Put(SfxBoolItem(SID_AUTO_REDRAW, bRedraw));
@@ -1290,8 +1290,8 @@ void SmDocShell::SaveSymbols()
{
RTL_LOGFILE_CONTEXT( aLog, "starmath: SmDocShell::SaveSymbols" );
- SmModule *pp = SM_MOD1();
- pp->GetSymSetManager().Save();
+ SmModule *pp = SM_MOD();
+ pp->GetSymbolManager().Save();
}
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index 94e30ce82501..f7093f9c3815 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -113,14 +113,13 @@ SmEditWindow::SmEditWindow( SmCmdBoxWindow &rMyCmdBoxWin ) :
// Even RTL languages don't use RTL for math
rCmdBox.GetEditWindow()->EnableRTL( FALSE );
- ApplyColorConfigValues( SM_MOD1()->GetColorConfig() );
+ ApplyColorConfigValues( SM_MOD()->GetColorConfig() );
// compare DataChanged
SetBackground( GetSettings().GetStyleSettings().GetWindowColor() );
aModifyTimer.SetTimeoutHdl(LINK(this, SmEditWindow, ModifyTimerHdl));
- aModifyTimer.SetTimeout(2000);
- aModifyTimer.Start();
+ aModifyTimer.SetTimeout(500);
aCursorMoveTimer.SetTimeoutHdl(LINK(this, SmEditWindow, CursorMoveTimerHdl));
aCursorMoveTimer.SetTimeout(500);
@@ -216,7 +215,7 @@ void SmEditWindow::DataChanged( const DataChangedEvent& )
{
const StyleSettings aSettings( GetSettings().GetStyleSettings() );
- ApplyColorConfigValues( SM_MOD1()->GetColorConfig() );
+ ApplyColorConfigValues( SM_MOD()->GetColorConfig() );
SetBackground( aSettings.GetWindowColor() );
// edit fields in other Applications use this font instead of
@@ -250,10 +249,9 @@ void SmEditWindow::DataChanged( const DataChangedEvent& )
IMPL_LINK( SmEditWindow, ModifyTimerHdl, Timer *, EMPTYARG /*pTimer*/ )
{
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
if (pp->GetConfig()->IsAutoRedraw())
Flush();
- aModifyTimer.Start();
return 0;
}
@@ -882,7 +880,10 @@ void SmEditWindow::Cut()
{
DBG_ASSERT( pEditView, "EditView missing" );
if (pEditView)
+ {
pEditView->Cut();
+ GetDoc()->SetModified( TRUE );
+ }
}
void SmEditWindow::Copy()
@@ -896,14 +897,20 @@ void SmEditWindow::Paste()
{
DBG_ASSERT( pEditView, "EditView missing" );
if (pEditView)
+ {
pEditView->Paste();
+ GetDoc()->SetModified( TRUE );
+ }
}
void SmEditWindow::Delete()
{
DBG_ASSERT( pEditView, "EditView missing" );
if (pEditView)
+ {
pEditView->DeleteSelected();
+ GetDoc()->SetModified( TRUE );
+ }
}
void SmEditWindow::InsertText(const String& Text)
diff --git a/starmath/source/makefile.mk b/starmath/source/makefile.mk
index a69a90010700..596060397e18 100644
--- a/starmath/source/makefile.mk
+++ b/starmath/source/makefile.mk
@@ -48,32 +48,32 @@ SRC2FILES = smres.src \
commands.src
SLO1FILES = \
- $(SLO)$/register.obj \
- $(SLO)$/typemap.obj \
+ $(SLO)$/accessibility.obj \
+ $(SLO)$/edit.obj \
+ $(SLO)$/eqnolefilehdr.obj \
+ $(SLO)$/mathmlexport.obj \
+ $(SLO)$/mathmlimport.obj \
$(SLO)$/symbol.obj \
- $(SLO)$/toolbox.obj \
+ $(SLO)$/types.obj \
+ $(SLO)$/unodoc.obj \
$(SLO)$/action.obj \
- $(SLO)$/accessibility.obj \
$(SLO)$/cfgitem.obj \
$(SLO)$/config.obj \
$(SLO)$/dialog.obj \
$(SLO)$/document.obj \
- $(SLO)$/mathtype.obj \
- $(SLO)$/mathmlimport.obj \
- $(SLO)$/mathmlexport.obj \
$(SLO)$/format.obj \
+ $(SLO)$/mathtype.obj \
$(SLO)$/node.obj \
$(SLO)$/parse.obj \
- $(SLO)$/utility.obj \
+ $(SLO)$/register.obj \
$(SLO)$/smdll.obj \
+ $(SLO)$/toolbox.obj \
+ $(SLO)$/typemap.obj \
$(SLO)$/smmod.obj \
- $(SLO)$/types.obj \
- $(SLO)$/view.obj \
- $(SLO)$/edit.obj \
+ $(SLO)$/utility.obj \
$(SLO)$/rect.obj \
$(SLO)$/unomodel.obj \
- $(SLO)$/unodoc.obj \
- $(SLO)$/eqnolefilehdr.obj
+ $(SLO)$/view.obj
SLO2FILES = \
$(SLO)$/register.obj \
@@ -88,12 +88,14 @@ EXCEPTIONSFILES = \
$(SLO)$/register.obj \
$(SLO)$/accessibility.obj \
$(SLO)$/cfgitem.obj \
+ $(SLO)$/dialog.obj \
$(SLO)$/document.obj \
$(SLO)$/node.obj \
$(SLO)$/parse.obj \
$(SLO)$/mathmlimport.obj \
$(SLO)$/mathmlexport.obj \
$(SLO)$/mathtype.obj \
+ $(SLO)$/smdll.obj \
$(SLO)$/view.obj \
$(SLO)$/unomodel.obj \
$(SLO)$/smdetect.obj \
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 722df5a1d502..4601b2f84fec 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -115,7 +115,7 @@ Color SmTmpDevice::Impl_GetColor( const Color& rColor )
if (OUTDEV_WINDOW == rOutDev.GetOutDevType())
aBgCol = ((Window &) rOutDev).GetDisplayBackground().GetColor();
- nNewCol = SM_MOD1()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor;
+ nNewCol = SM_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor;
Color aTmpColor( nNewCol );
if (aBgCol.IsDark() && aTmpColor.IsDark())
@@ -831,8 +831,9 @@ void SmLineNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
return;
// make distance depend on font size
- long nDist = +(rFormat.GetDistance(DIS_HORIZONTAL)
- * GetFont().GetSize().Height()) / 100L;
+ long nDist = (rFormat.GetDistance(DIS_HORIZONTAL) * GetFont().GetSize().Height()) / 100L;
+ if (!IsUseExtraSpaces())
+ nDist = 0;
Point aPos;
for (i = 0; i < nSize; i++)
@@ -2803,9 +2804,9 @@ void SmSpecialNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell
SmNode::Prepare(rFormat, rDocShell);
const SmSym *pSym;
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
- if (NULL != (pSym = pp->GetSymSetManager().GetSymbolByName(GetToken().aText)))
+ if (NULL != (pSym = pp->GetSymbolManager().GetSymbolByName(GetToken().aText)))
{
SetText( pSym->GetCharacter() );
GetFont() = pSym->GetFace();
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 1955b0553b62..15971d0c38af 100644..100755
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -242,12 +242,13 @@ static const SmTokenTableEntry aTokenTable[] =
{ "ni", TNI, MS_NI, TGRELATION, 0},
{ "nitalic", TNITALIC, '\0', TGFONTATTR, 5},
{ "none", TNONE, '\0', TGLBRACES | TGRBRACES, 0},
+ { "nospace", TNOSPACE, '\0', TGSTANDALONE, 5},
{ "notin", TNOTIN, MS_NOTIN, TGRELATION, 0},
+ { "nroot", TNROOT, MS_SQRT, TGUNOPER, 5},
{ "nsubset", TNSUBSET, MS_NSUBSET, TGRELATION, 0 },
{ "nsupset", TNSUPSET, MS_NSUPSET, TGRELATION, 0 },
{ "nsubseteq", TNSUBSETEQ, MS_NSUBSETEQ, TGRELATION, 0 },
{ "nsupseteq", TNSUPSETEQ, MS_NSUPSETEQ, TGRELATION, 0 },
- { "nroot", TNROOT, MS_SQRT, TGUNOPER, 5},
{ "odivide", TODIVIDE, MS_ODIVIDE, TGPRODUCT, 0},
{ "odot", TODOT, MS_ODOT, TGPRODUCT, 0},
{ "ominus", TOMINUS, MS_OMINUS, TGSUM, 0},
@@ -380,7 +381,7 @@ BOOL SmParser::IsDelimiter( const String &rTxt, xub_StrLen nPos )
BOOL bIsDelim = *pDelim != 0;
- INT16 nTypJp = SM_MOD1()->GetSysLocale().GetCharClass().getType( rTxt, nPos );
+ INT16 nTypJp = SM_MOD()->GetSysLocale().GetCharClass().getType( rTxt, nPos );
bIsDelim |= nTypJp == com::sun::star::i18n::UnicodeType::SPACE_SEPARATOR ||
nTypJp == com::sun::star::i18n::UnicodeType::CONTROL;
@@ -438,7 +439,7 @@ void SmParser::NextToken()
xub_StrLen nRealStart;
BOOL bCont;
BOOL bNumStart = FALSE;
- CharClass aCC(SM_MOD1()->GetSysLocale().GetCharClass().getLocale());
+ CharClass aCC(SM_MOD()->GetSysLocale().GetCharClass().getLocale());
do
{
// skip white spaces
@@ -731,7 +732,7 @@ void SmParser::NextToken()
xub_StrLen nTmpStart = sal::static_int_cast< xub_StrLen >(rnEndPos +
aTmpRes.LeadingWhiteSpace);
- // default setting fo the case that no identifier
+ // default setting for the case that no identifier
// i.e. a valid symbol-name is following the '%'
// character
CurToken.eType = TTEXT;
@@ -1132,6 +1133,16 @@ void SmParser::Line()
void SmParser::Expression()
{
+ BOOL bUseExtraSpaces = TRUE;
+ SmNode *pNode = NodeStack.Pop();
+ if (pNode)
+ {
+ if (pNode->GetToken().eType == TNOSPACE)
+ bUseExtraSpaces = FALSE;
+ else
+ NodeStack.Push(pNode); // push the node from above again (now to be used as argument to this current 'nospace' node)
+ }
+
USHORT n = 0;
SmNodeArray RelationArray;
@@ -1147,8 +1158,9 @@ void SmParser::Expression()
RelationArray[n - 1] = NodeStack.Pop();
}
- SmStructureNode *pSNode = new SmExpressionNode(CurToken);
+ SmExpressionNode *pSNode = new SmExpressionNode(CurToken);
pSNode->SetSubNodes(RelationArray);
+ pSNode->SetUseExtraSpaces(bUseExtraSpaces);
NodeStack.Push(pSNode);
}
@@ -1270,7 +1282,7 @@ void SmParser::SubSup(ULONG nActiveGroup)
return;
SmSubSupNode *pNode = new SmSubSupNode(CurToken);
- //! Of course 'CurToken' ist just the first sub-/supscript token.
+ //! Of course 'CurToken' is just the first sub-/supscript token.
//! It should be of no further interest. The positions of the
//! sub-/supscripts will be identified by the corresponding subnodes
//! index in the 'aSubNodes' array (enum value from 'SmSubSup').
@@ -1362,7 +1374,7 @@ void SmParser::Blank()
// Blanks am Zeilenende ignorieren wenn die entsprechende Option gesetzt ist
if ( CurToken.eType == TNEWLINE ||
- (CurToken.eType == TEND && SM_MOD1()->GetConfig()->IsIgnoreSpacesRight()) )
+ (CurToken.eType == TEND && SM_MOD()->GetConfig()->IsIgnoreSpacesRight()) )
{
pBlankNode->Clear();
}
@@ -1374,30 +1386,51 @@ void SmParser::Blank()
void SmParser::Term()
{
switch (CurToken.eType)
- { case TESCAPE :
+ {
+ case TESCAPE :
Escape();
break;
+ case TNOSPACE :
case TLGROUP :
- NextToken();
-
- // allow for empty group
- if (CurToken.eType == TRGROUP)
- { SmStructureNode *pSNode = new SmExpressionNode(CurToken);
- pSNode->SetSubNodes(NULL, NULL);
- NodeStack.Push(pSNode);
-
+ {
+ bool bNoSpace = CurToken.eType == TNOSPACE;
+ if (bNoSpace) // push 'no space' node and continue to parse expression
+ {
+ NodeStack.Push(new SmExpressionNode(CurToken));
NextToken();
}
- else // go as usual
- { Align();
- if (CurToken.eType != TRGROUP)
- Error(PE_RGROUP_EXPECTED);
- else
- { NextToken();
+ if (CurToken.eType != TLGROUP)
+ {
+ NodeStack.Pop(); // get rid of the 'no space' node pushed above
+ Term();
+ }
+ else
+ {
+ NextToken();
+
+ // allow for empty group
+ if (CurToken.eType == TRGROUP)
+ {
+ if (bNoSpace) // get rid of the 'no space' node pushed above
+ NodeStack.Pop();
+ SmStructureNode *pSNode = new SmExpressionNode(CurToken);
+ pSNode->SetSubNodes(NULL, NULL);
+ NodeStack.Push(pSNode);
+
+ NextToken();
+ }
+ else // go as usual
+ {
+ Align();
+ if (CurToken.eType != TRGROUP)
+ Error(PE_RGROUP_EXPECTED);
+ else
+ NextToken();
}
}
- break;
+ }
+ break;
case TLEFT :
Brace();
@@ -2286,13 +2319,13 @@ void SmParser::Special()
// UI uses localized names XML file format does not.)
if (IsImportSymbolNames())
{
- const SmLocalizedSymbolData &rLSD = SM_MOD1()->GetLocSymbolData();
+ const SmLocalizedSymbolData &rLSD = SM_MOD()->GetLocSymbolData();
aNewName = rLSD.GetUiSymbolName( rName );
bReplace = TRUE;
}
else if (IsExportSymbolNames())
{
- const SmLocalizedSymbolData &rLSD = SM_MOD1()->GetLocSymbolData();
+ const SmLocalizedSymbolData &rLSD = SM_MOD()->GetLocSymbolData();
aNewName = rLSD.GetExportSymbolName( rName );
bReplace = TRUE;
}
@@ -2300,7 +2333,7 @@ void SmParser::Special()
else // 5.0 <-> 6.0 formula text (symbol name) conversion
{
LanguageType nLanguage = GetLanguage();
- SmLocalizedSymbolData &rData = SM_MOD1()->GetLocSymbolData();
+ SmLocalizedSymbolData &rData = SM_MOD()->GetLocSymbolData();
const ResStringArray *pFrom = 0;
const ResStringArray *pTo = 0;
if (CONVERT_50_TO_60 == GetConversion())
diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx
index 02df2ddf060e..248983a393a8 100644
--- a/starmath/source/rect.cxx
+++ b/starmath/source/rect.cxx
@@ -715,7 +715,7 @@ BOOL SmGetGlyphBoundRect(const OutputDevice &rDev,
{
// since we format for the printer (where GetTextBoundRect will fail)
// we need a virtual device here.
- pGlyphDev = &SM_MOD1()->GetDefaultVirtualDev();
+ pGlyphDev = &SM_MOD()->GetDefaultVirtualDev();
}
const FontMetric aDevFM (rDev.GetFontMetric());
diff --git a/starmath/source/smdll.cxx b/starmath/source/smdll.cxx
index f72ab2be84cb..a66ec8efc608 100644
--- a/starmath/source/smdll.cxx
+++ b/starmath/source/smdll.cxx
@@ -76,7 +76,7 @@ void SmDLL::Init()
SmModule** ppShlPtr = (SmModule**) GetAppData(SHL_SM);
*ppShlPtr = new SmModule( &rFactory );
- SfxModule *p = SM_MOD1();
+ SfxModule *p = SM_MOD();
SmModule *pp = (SmModule *) p;
rFactory.SetDocumentServiceName( String::CreateFromAscii("com.sun.star.formula.FormulaProperties") );
diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx
index 451bb8664bc5..da6259076adc 100644
--- a/starmath/source/smmod.cxx
+++ b/starmath/source/smmod.cxx
@@ -98,7 +98,7 @@ const String SmLocalizedSymbolData::GetUiSymbolName( const String &rExportName )
{
String aRes;
- const SmLocalizedSymbolData &rData = SM_MOD1()->GetLocSymbolData();
+ const SmLocalizedSymbolData &rData = SM_MOD()->GetLocSymbolData();
const ResStringArray &rUiNames = rData.GetUiSymbolNamesArray();
const ResStringArray &rExportNames = rData.GetExportSymbolNamesArray();
USHORT nCount = sal::static_int_cast< xub_StrLen >(rExportNames.Count());
@@ -119,7 +119,7 @@ const String SmLocalizedSymbolData::GetExportSymbolName( const String &rUiName )
{
String aRes;
- const SmLocalizedSymbolData &rData = SM_MOD1()->GetLocSymbolData();
+ const SmLocalizedSymbolData &rData = SM_MOD()->GetLocSymbolData();
const ResStringArray &rUiNames = rData.GetUiSymbolNamesArray();
const ResStringArray &rExportNames = rData.GetExportSymbolNamesArray();
USHORT nCount = sal::static_int_cast< xub_StrLen >(rUiNames.Count());
@@ -140,7 +140,7 @@ const String SmLocalizedSymbolData::GetUiSymbolSetName( const String &rExportNam
{
String aRes;
- const SmLocalizedSymbolData &rData = SM_MOD1()->GetLocSymbolData();
+ const SmLocalizedSymbolData &rData = SM_MOD()->GetLocSymbolData();
const ResStringArray &rUiNames = rData.GetUiSymbolSetNamesArray();
const ResStringArray &rExportNames = rData.GetExportSymbolSetNamesArray();
USHORT nCount = sal::static_int_cast< xub_StrLen >(rExportNames.Count());
@@ -161,7 +161,7 @@ const String SmLocalizedSymbolData::GetExportSymbolSetName( const String &rUiNam
{
String aRes;
- const SmLocalizedSymbolData &rData = SM_MOD1()->GetLocSymbolData();
+ const SmLocalizedSymbolData &rData = SM_MOD()->GetLocSymbolData();
const ResStringArray &rUiNames = rData.GetUiSymbolSetNamesArray();
const ResStringArray &rExportNames = rData.GetExportSymbolSetNamesArray();
USHORT nCount = sal::static_int_cast< xub_StrLen >(rUiNames.Count());
@@ -311,9 +311,9 @@ SmConfig * SmModule::GetConfig()
return pConfig;
}
-SmSymSetManager & SmModule::GetSymSetManager()
+SmSymbolManager & SmModule::GetSymbolManager()
{
- return GetConfig()->GetSymSetManager();
+ return GetConfig()->GetSymbolManager();
}
SmLocalizedSymbolData & SmModule::GetLocSymbolData() const
diff --git a/starmath/source/smres.src b/starmath/source/smres.src
index ec6d8114759b..7d3525bd2a29 100644..100755
--- a/starmath/source/smres.src
+++ b/starmath/source/smres.src
@@ -1556,7 +1556,7 @@ FloatingWindow RID_TOOLBOXWINDOW
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 0 , 0 ) ;
- Text [ en-US ] = "Formula Elements" ;
+ Text [ en-US ] = "Elements" ;
ToolBox 1
{
diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx
index 7d2799b71647..e248f9726629 100644
--- a/starmath/source/symbol.cxx
+++ b/starmath/source/symbol.cxx
@@ -34,12 +34,13 @@
#include <ucbhelper/content.hxx>
#include <vcl/msgbox.hxx>
-#ifndef _SV_RESARY_HXX
-#include <tools/resary.hxx>
-#endif
#include <sfx2/dispatch.hxx>
#include <sfx2/docfile.hxx>
+#include <map>
+#include <vector>
+#include <iterator>
+
#include "symbol.hxx"
#include "view.hxx"
#include "utility.hxx"
@@ -55,72 +56,38 @@ using namespace ::com::sun::star::ucb;
using namespace ::com::sun::star::uno;
using namespace ::rtl;
-// Das hier muss auch mal alles "uberarbeitet werden. Insbesondere die nicht
-// funktionierende und bei l"oschen/"andern von Symbolen nicht gepflegte
-// Hash Tabelle!!! Diese aktualisert sich erst im Wertzuweisungsoperator
-// beim Verlassen des 'SmSymDefineDialog's!
-
-/**************************************************************************/
-/*
-**
-** MACRO DEFINTION
-**
-**/
-
-#define SF_SM20IDENT 0x03031963L
-#define SF_IDENT 0x30334D53L
-
-
-SV_IMPL_PTRARR( SymbolArray, SmSym * );
-
-/**************************************************************************/
-/*
-**
-** DATA DEFINITION
-**
-**/
-
-long SF_Ident = SF_IDENT;
/**************************************************************************/
-/*
-**
-** CLASS IMPLEMENTATION
-**
-**/
SmSym::SmSym() :
- Name(C2S("unknown")),
- aSetName(C2S("unknown")),
- pHashNext(0),
- pSymSetManager(0),
- Character('\0'),
- bPredefined(FALSE),
- bDocSymbol(FALSE)
+ m_aName(C2S("unknown")),
+ m_aSetName(C2S("unknown")),
+ m_cChar('\0'),
+ m_bPredefined(FALSE),
+ m_bDocSymbol(FALSE)
{
- aExportName = Name;
- Face.SetTransparent(TRUE);
- Face.SetAlign(ALIGN_BASELINE);
+ m_aExportName = m_aName;
+ m_aFace.SetTransparent(TRUE);
+ m_aFace.SetAlign(ALIGN_BASELINE);
}
SmSym::SmSym(const SmSym& rSymbol)
{
- pSymSetManager = 0;
*this = rSymbol;
}
-SmSym::SmSym(const String& rName, const Font& rFont, sal_Unicode aChar,
+SmSym::SmSym(const String& rName, const Font& rFont, sal_Unicode cChar,
const String& rSet, BOOL bIsPredefined)
{
- Name = aExportName = rName;
+ m_aName = m_aExportName = rName;
- Face = rFont;
- Face.SetTransparent(TRUE);
- Face.SetAlign(ALIGN_BASELINE);
+ m_aFace = rFont;
+ m_aFace.SetTransparent(TRUE);
+ m_aFace.SetAlign(ALIGN_BASELINE);
- Character = aChar;
+ m_cChar = cChar;
//! according to HDU this should not be used anymore now
//! since this was necessary in the early days but should
//! not be done now since this is handled now at a more
@@ -132,481 +99,231 @@ SmSym::SmSym(const String& rName, const Font& rFont, sal_Unicode aChar,
//
// if (RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet())
// Character |= 0xF000;
- aSetName = rSet;
- bPredefined = bIsPredefined;
- bDocSymbol = FALSE;
-
- pHashNext = 0;
- pSymSetManager = 0;
+ m_aSetName = rSet;
+ m_bPredefined = bIsPredefined;
+ m_bDocSymbol = FALSE;
}
SmSym& SmSym::operator = (const SmSym& rSymbol)
{
- Name = rSymbol.Name;
- Face = rSymbol.Face;
- Character = rSymbol.Character;
- aSetName = rSymbol.aSetName;
- bPredefined = rSymbol.bPredefined;
- bDocSymbol = rSymbol.bDocSymbol;
- aExportName = rSymbol.aExportName;
-
- pHashNext = 0;
-
- if (pSymSetManager)
- pSymSetManager->SetModified(TRUE);
-
- return *this;
-}
-
-/**************************************************************************/
-
-SmSymSet::SmSymSet() :
- Name(C2S("unknown")),
- pSymSetManager(0)
-{
- SymbolList.Clear();
-}
-
-SmSymSet::SmSymSet(const SmSymSet& rSymbolSet)
-{
- pSymSetManager = 0;
- *this = rSymbolSet;
-}
-
-SmSymSet::SmSymSet(const String& rName)
-{
- Name = rName;
- SymbolList.Clear();
-
- pSymSetManager = 0;
-}
-
-SmSymSet::~SmSymSet()
-{
- for (USHORT i = 0; i < GetCount(); i++)
- delete SymbolList.GetObject(i);
-}
-
-SmSymSet& SmSymSet::operator = (const SmSymSet& rSymbolSet)
-{
- USHORT i;
- for (i = 0; i < GetCount(); i++)
- delete SymbolList.GetObject(i);
-
- Name = rSymbolSet.Name;
- SymbolList.Clear();
- for (i = 0; i < rSymbolSet.GetCount(); i++)
- AddSymbol(new SmSym(rSymbolSet.GetSymbol(i)));
+ m_aName = rSymbol.m_aName;
+ m_aExportName = rSymbol.m_aExportName;
+ m_cChar = rSymbol.m_cChar;
+ m_aFace = rSymbol.m_aFace;
+ m_aSetName = rSymbol.m_aSetName;
+ m_bPredefined = rSymbol.m_bPredefined;
+ m_bDocSymbol = rSymbol.m_bDocSymbol;
+ SmSymbolManager * pSymSetManager = &SM_MOD()->GetSymbolManager();
if (pSymSetManager)
- pSymSetManager->SetModified(TRUE);
+ pSymSetManager->SetModified(true);
return *this;
}
-USHORT SmSymSet::AddSymbol(SmSym* pSymbol)
-{
- DBG_ASSERT(pSymbol, "Kein Symbol");
-
- if (pSymbol)
- pSymbol->SetSetName( GetName() );
- SymbolList.Insert(pSymbol, LIST_APPEND);
- DBG_ASSERT(SymbolList.GetPos(pSymbol) == SymbolList.Count() - 1,
- "Sm : ... ergibt falschen return Wert");
-
- if (pSymSetManager)
- pSymSetManager->SetModified(TRUE);
-
- return (USHORT) SymbolList.Count() - 1;
-}
-
-void SmSymSet::DeleteSymbol(USHORT SymbolNo)
-{
- delete RemoveSymbol(SymbolNo);
-}
-
-SmSym * SmSymSet::RemoveSymbol(USHORT SymbolNo)
-{
- DBG_ASSERT(SymbolList.GetObject(SymbolNo), "Symbol nicht vorhanden");
-
- SmSym *pSym = SymbolList.GetObject(SymbolNo);
- SymbolList.Remove(SymbolNo);
-
- if (pSymSetManager)
- pSymSetManager->SetModified(TRUE);
-
- return pSym;
-}
-
-USHORT SmSymSet::GetSymbolPos(const String& rName)
-{
- for (USHORT i = 0; i < GetCount(); i++)
- if (SymbolList.GetObject(i)->GetName() == rName)
- return (i);
- return SYMBOL_NONE;
-}
-
-/**************************************************************************/
-
-SmSymSetManager_Impl::SmSymSetManager_Impl(
- SmSymSetManager &rMgr, USHORT HashTableSize ) :
-
- rSymSetMgr (rMgr)
-{
- NoSymbolSets = 0;
- NoHashEntries = HashTableSize;
- HashEntries = new SmSym *[NoHashEntries];
- memset( HashEntries, 0, sizeof(SmSym *) * NoHashEntries );
- Modified = FALSE;
-}
-
-
-SmSymSetManager_Impl::~SmSymSetManager_Impl()
+bool SmSym::IsEqualInUI( const SmSym& rSymbol ) const
{
- for (USHORT i = 0; i < NoSymbolSets; ++i)
- delete SymbolSets.Get(i);
- SymbolSets.Clear();
-
- NoSymbolSets = 0;
- if (HashEntries)
- {
- delete[] HashEntries;
- HashEntries = 0;
- }
- NoHashEntries = 0;
- Modified = FALSE;
-}
-
-
-SmSymSetManager_Impl & SmSymSetManager_Impl::operator = ( const SmSymSetManager_Impl &rImpl )
-{
- //! rMySymSetMgr remains unchanged
-
- NoHashEntries = rImpl.NoHashEntries;
- if (HashEntries)
- delete [] HashEntries;
- HashEntries = new SmSym *[NoHashEntries];
- memset( HashEntries, 0, sizeof(SmSym *) * NoHashEntries );
-
- NoSymbolSets = 0;
- SymbolSets.Clear();
- for (USHORT i = 0; i < rImpl.NoSymbolSets; ++i)
- {
- rSymSetMgr.AddSymbolSet( new SmSymSet( *rImpl.rSymSetMgr.GetSymbolSet(i) ) );
- }
- DBG_ASSERT( NoSymbolSets == rImpl.NoSymbolSets,
- "incorrect number of symbolsets" );
-
- Modified = TRUE;
- return *this;
+ return m_aName == rSymbol.m_aName &&
+ m_aFace == rSymbol.m_aFace &&
+ m_cChar == rSymbol.m_cChar;
}
/**************************************************************************/
-void SmSymSetManager::SFX_NOTIFY(SfxBroadcaster& /*rBC*/, const TypeId& rBCType,
+void SmSymbolManager::SFX_NOTIFY(SfxBroadcaster& /*rBC*/, const TypeId& rBCType,
const SfxHint& /*rHint*/, const TypeId& rHintType)
{
}
-UINT32 SmSymSetManager::GetHashIndex(const String& rSymbolName)
-{
- UINT32 x = 1;
- for (xub_StrLen i = 0; i < rSymbolName.Len(); i++)
- x += x * rSymbolName.GetChar(i) + i;
-
- return x % pImpl->NoHashEntries;
-}
-
-
-void SmSymSetManager::EnterHashTable(SmSym& rSymbol)
-{
- int j = GetHashIndex( rSymbol.GetName() );
- if (pImpl->HashEntries[j] == 0)
- pImpl->HashEntries[j] = &rSymbol;
- else
- {
- SmSym *p = pImpl->HashEntries[j];
- while (p->pHashNext)
- p = p->pHashNext;
- p->pHashNext = &rSymbol;
- }
- rSymbol.pHashNext = 0;
-}
-
-
-void SmSymSetManager::EnterHashTable(SmSymSet& rSymbolSet)
-{
- for (USHORT i = 0; i < rSymbolSet.GetCount(); i++)
- EnterHashTable( *rSymbolSet.SymbolList.GetObject(i) );
-}
-
-void SmSymSetManager::FillHashTable()
-{
- if (pImpl->HashEntries)
- {
- memset( pImpl->HashEntries, 0, pImpl->NoHashEntries * sizeof(SmSym *) );
-
- for (UINT32 i = 0; i < pImpl->NoSymbolSets; i++)
- EnterHashTable( *GetSymbolSet( (USHORT) i ) );
- }
-}
-
-void SmSymSetManager::Init()
+void SmSymbolManager::Init()
{
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
StartListening(*pp->GetConfig());
}
-void SmSymSetManager::Exit()
+void SmSymbolManager::Exit()
{
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
EndListening(*pp->GetConfig());
}
-SmSymSetManager::SmSymSetManager(USHORT HashTableSize)
+SmSymbolManager::SmSymbolManager()
{
- pImpl = new SmSymSetManager_Impl( *this, HashTableSize );
+ m_bModified = false;
}
-SmSymSetManager::SmSymSetManager(const SmSymSetManager& rSymbolSetManager) :
+SmSymbolManager::SmSymbolManager(const SmSymbolManager& rSymbolSetManager) :
SfxListener()
{
- pImpl = new SmSymSetManager_Impl( *this, rSymbolSetManager.pImpl->NoHashEntries );
- *pImpl = *rSymbolSetManager.pImpl;
+ m_aSymbols = rSymbolSetManager.m_aSymbols;
+ m_bModified = true;
}
-SmSymSetManager::~SmSymSetManager()
+SmSymbolManager::~SmSymbolManager()
{
- delete pImpl;
- pImpl = 0;
}
-SmSymSetManager& SmSymSetManager::operator = (const SmSymSetManager& rSymbolSetManager)
+
+SmSymbolManager& SmSymbolManager::operator = (const SmSymbolManager& rSymbolSetManager)
{
- *pImpl = *rSymbolSetManager.pImpl;
+ m_aSymbols = rSymbolSetManager.m_aSymbols;
+ m_bModified = true;
return *this;
}
-USHORT SmSymSetManager::AddSymbolSet(SmSymSet* pSymbolSet)
-{
- if (pImpl->NoSymbolSets >= pImpl->SymbolSets.GetSize())
- pImpl->SymbolSets.SetSize(pImpl->NoSymbolSets + 1);
-
- pImpl->SymbolSets.Put(pImpl->NoSymbolSets++, pSymbolSet);
- pSymbolSet->pSymSetManager = this;
-
- for (USHORT i = 0; i < pSymbolSet->GetCount(); i++)
- pSymbolSet->SymbolList.GetObject(i)->pSymSetManager = this;
-
- FillHashTable();
- pImpl->Modified = TRUE;
-
- return (USHORT) (pImpl->NoSymbolSets - 1);
-}
-
-void SmSymSetManager::ChangeSymbolSet(SmSymSet* pSymbolSet)
+SmSym *SmSymbolManager::GetSymbolByName(const String& rSymbolName)
{
- if (pSymbolSet)
- {
- FillHashTable();
- pImpl->Modified = TRUE;
- }
+ SmSym *pRes = NULL;
+ SymbolMap_t::iterator aIt( m_aSymbols.find( rSymbolName ) );
+ if (aIt != m_aSymbols.end())
+ pRes = &aIt->second;
+ return pRes;
}
-void SmSymSetManager::DeleteSymbolSet(USHORT SymbolSetNo)
-{
- delete pImpl->SymbolSets.Get(SymbolSetNo);
- pImpl->NoSymbolSets--;
-
- for (UINT32 i = SymbolSetNo; i < pImpl->NoSymbolSets; i++)
- pImpl->SymbolSets.Put(i, pImpl->SymbolSets.Get(i + 1));
-
- FillHashTable();
- pImpl->Modified = TRUE;
+const SymbolPtrVec_t SmSymbolManager::GetSymbols() const
+{
+ SymbolPtrVec_t aRes;
+ SymbolMap_t::const_iterator aIt( m_aSymbols.begin() );
+ for ( ; aIt != m_aSymbols.end(); ++aIt)
+ aRes.push_back( &aIt->second );
+// DBG_ASSERT( sSymbols.size() == m_aSymbols.size(), "number of symbols mismatch " );
+ return aRes;
}
-USHORT SmSymSetManager::GetSymbolSetPos(const String& rSymbolSetName) const
+bool SmSymbolManager::AddOrReplaceSymbol( const SmSym &rSymbol, bool bForceChange )
{
- for (USHORT i = 0; i < pImpl->NoSymbolSets; i++)
- if (pImpl->SymbolSets.Get(i)->GetName() == rSymbolSetName)
- return (i);
-
- return SYMBOLSET_NONE;
-}
+ bool bAdded = false;
-SmSym *SmSymSetManager::GetSymbolByName(const String& rSymbolName)
-{
- SmSym *pSym = pImpl->HashEntries[GetHashIndex(rSymbolName)];
- while (pSym)
+ const String aSymbolName( rSymbol.GetName() );
+ if (aSymbolName.Len() > 0 && rSymbol.GetSymbolSetName().Len() > 0)
{
- if (pSym->Name == rSymbolName)
- break;
- pSym = pSym->pHashNext;
- }
-
- return pSym;
-}
+ const SmSym *pFound = GetSymbolByName( aSymbolName );
+ const bool bSymbolConflict = pFound && !pFound->IsEqualInUI( rSymbol );
-
-void SmSymSetManager::AddReplaceSymbol( const SmSym &rSymbol )
-{
- SmSym *pSym = GetSymbolByName( rSymbol.GetName() );
- if (pSym)
- {
- *pSym = rSymbol;
- }
- else
- {
- USHORT nPos = GetSymbolSetPos( rSymbol.GetSetName() );
- if (SYMBOLSET_NONE == nPos)
+ // avoid having the same symbol name twice but with different symbols in use
+ if (!pFound || bForceChange)
{
- AddSymbolSet( new SmSymSet( rSymbol.GetSetName() ) );
- nPos = GetSymbolSetPos( rSymbol.GetSetName() );
+ m_aSymbols[ aSymbolName ] = rSymbol;
+ bAdded = true;
+ }
+ else if (pFound && !bForceChange && bSymbolConflict)
+ {
+ // TODO: but what ...
+ DBG_ASSERT( 0, "symbol conflict, different symbol with same name found!" );
}
- DBG_ASSERT( nPos != SYMBOLSET_NONE, "SymbolSet not found");
- SmSym *pTmpSym = new SmSym( rSymbol );
- GetSymbolSet( nPos )->AddSymbol( pTmpSym );
- EnterHashTable( *pTmpSym );
}
- SetModified( TRUE );
-}
+ DBG_ASSERT( bAdded, "failed to add symbol" );
+ if (bAdded)
+ m_bModified = true;
-USHORT SmSymSetManager::GetSymbolCount() const
-{
- USHORT nRes = 0;
- USHORT nSets = GetSymbolSetCount();
- for (USHORT i = 0; i < nSets; ++i)
- nRes = nRes + GetSymbolSet(i)->GetCount();
- return nRes;
+ return bAdded;
}
-const SmSym * SmSymSetManager::GetSymbolByPos( USHORT nPos ) const
+void SmSymbolManager::RemoveSymbol( const String & rSymbolName )
{
- const SmSym *pRes = 0;
-
- INT16 nIdx = 0;
- USHORT nSets = GetSymbolSetCount();
- USHORT i = 0;
- while (i < nSets && !pRes)
+ if (rSymbolName.Len() > 0)
{
- USHORT nEntries = GetSymbolSet(i)->GetCount();
- if (nPos < nIdx + nEntries)
- pRes = &GetSymbolSet(i)->GetSymbol( nPos - nIdx );
- else
- nIdx = nIdx + nEntries;
- ++i;
+ size_t nOldSize = m_aSymbols.size();
+ m_aSymbols.erase( rSymbolName );
+ m_bModified = nOldSize != m_aSymbols.size();
}
+}
- return pRes;
+
+std::set< String > SmSymbolManager::GetSymbolSetNames() const
+{
+ std::set< String > aRes;
+ SymbolMap_t::const_iterator aIt( m_aSymbols.begin() );
+ for ( ; aIt != m_aSymbols.end(); ++aIt )
+ aRes.insert( aIt->second.GetSymbolSetName() );
+ return aRes;
}
-void SmSymSetManager::GetSymbols( std::vector< SmSym > &rSymbols ) const
+const SymbolPtrVec_t SmSymbolManager::GetSymbolSet( const String& rSymbolSetName )
{
- INT32 nCount = GetSymbolCount();
- rSymbols.resize( nCount );
- USHORT nPos = 0;
- std::vector< SmSym >::iterator aIt( rSymbols.begin() );
- std::vector< SmSym >::iterator aEnd( rSymbols.end() );
- while (aIt != aEnd)
+ SymbolPtrVec_t aRes;
+ if (rSymbolSetName.Len() > 0)
{
- const SmSym *pSym = GetSymbolByPos( nPos++ );
- DBG_ASSERT( pSym, "symbol missing" );
- if (pSym)
- *aIt++ = *pSym;
+ SymbolMap_t::const_iterator aIt( m_aSymbols.begin() );
+ for ( ; aIt != m_aSymbols.end(); ++aIt )
+ {
+ if (aIt->second.GetSymbolSetName() == rSymbolSetName)
+ aRes.push_back( &aIt->second );
+ }
}
- DBG_ASSERT( nPos == nCount, "index out of range?" );
+ return aRes;
}
-void SmSymSetManager::Load()
+void SmSymbolManager::Load()
{
std::vector< SmSym > aSymbols;
- SmMathConfig &rCfg = *SM_MOD1()->GetConfig();
+ SmMathConfig &rCfg = *SM_MOD()->GetConfig();
rCfg.GetSymbols( aSymbols );
- INT32 nSymbolCount = aSymbols.size();
+ size_t nSymbolCount = aSymbols.size();
- USHORT i;
- for (i = 0; i < nSymbolCount; ++i)
+ m_aSymbols.clear();
+ for (size_t i = 0; i < nSymbolCount; ++i)
{
const SmSym &rSym = aSymbols[i];
- DBG_ASSERT( rSym.Name.Len() > 0, "symbol without name!" );
- if (rSym.Name.Len() > 0)
- {
- SmSymSet *pSymSet = 0;
- const String &rSetName = rSym.GetSetName();
- USHORT nSetPos = GetSymbolSetPos( rSetName );
- if (SYMBOLSET_NONE != nSetPos)
- pSymSet = GetSymbolSet( nSetPos );
- else
- {
- pSymSet = new SmSymSet( rSetName );
- AddSymbolSet( pSymSet );
- }
-
- pSymSet->AddSymbol( new SmSym( rSym ) );
- }
+ DBG_ASSERT( rSym.GetName().Len() > 0, "symbol without name!" );
+ if (rSym.GetName().Len() > 0)
+ AddOrReplaceSymbol( rSym );
}
- // build HashTables
- INT32 nSymbolSetCount = GetSymbolSetCount();
- for (i = 0; i < nSymbolSetCount; ++i)
- ChangeSymbolSet( GetSymbolSet( i ) );
+ m_bModified = true;
if (0 == nSymbolCount)
{
DBG_ERROR( "no symbol set found" );
- pImpl->Modified = FALSE;
+ m_bModified = false;
}
}
-void SmSymSetManager::Save()
+void SmSymbolManager::Save()
{
- SmMathConfig &rCfg = *SM_MOD1()->GetConfig();
-
- // get number of Symbols
- USHORT nSymbolCount = 0;
- USHORT nSetCount = GetSymbolSetCount();
- USHORT i;
- for (i = 0; i < nSetCount; ++i)
- nSymbolCount = nSymbolCount + GetSymbolSet( i )->GetCount();
-
- if (nSymbolCount)
+ if (m_bModified)
{
- USHORT nSaveSymbolCnt = 0;
- const SmSym **pSymbols = new const SmSym* [ nSymbolCount ];
- const SmSym **pSym = pSymbols;
- for (i = 0; i < nSetCount; ++i)
+ SmMathConfig &rCfg = *SM_MOD()->GetConfig();
+
+#if 0
+ USHORT nSymbolCount = GetSymbolCount();
+ USHORT nSaveSymbolCnt = 0;
+ const SmSym **pSymbols = new const SmSym* [ nSymbolCount ];
+ const SmSym **pSym = pSymbols;
+ for (USHORT j = 0; j < nSymbolCount; ++j)
{
- const SmSymSet *pSymSet = GetSymbolSet( i );
- USHORT n = pSymSet->GetCount();
- for (USHORT j = 0; j < n; ++j)
+ const SmSym &rSym = *pSymSet->GetSymbol( j );
+ if (!rSym.IsDocSymbol())
{
- const SmSym &rSym = pSymSet->GetSymbol( j );
- if (!rSym.IsDocSymbol())
- {
- *pSym++ = &rSym;
- ++nSaveSymbolCnt;
- }
+ *pSym++ = &rSym;
+ ++nSaveSymbolCnt;
}
}
DBG_ASSERT(pSym - pSymbols == nSaveSymbolCnt, "wrong number of symbols" );
-
+#endif
+ SymbolPtrVec_t aTmp( GetSymbols() );
std::vector< SmSym > aSymbols;
- GetSymbols( aSymbols );
+ for (size_t i = 0; i < aTmp.size(); ++i)
+ aSymbols.push_back( *aTmp[i] );
rCfg.SetSymbols( aSymbols );
+#if 0
delete [] pSymbols;
+#endif
+
+ m_bModified = false;
}
}
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index f4acc1af6b89..013831f6e44e 100644..100755
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -85,7 +85,7 @@ SmPrintUIOptions::SmPrintUIOptions()
if( aLocalizedStrings.Count() < 18 ) // bad resource ?
return;
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
SmConfig *pConfig = pp->GetConfig();
DBG_ASSERT( pConfig, "SmConfig not found" );
if (!pConfig)
@@ -684,7 +684,7 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any*
0
};
SfxItemSet *pItemSet = new SfxItemSet( pDocSh->GetPool(), nRange );
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
pp->GetConfig()->ConfigToItemSet(*pItemSet);
SfxPrinter *pPrinter = SfxPrinter::Create ( aStream, pItemSet );
@@ -701,8 +701,8 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any*
if ( *pValues >>= aSequence )
{
sal_uInt32 nSize = aSequence.getLength();
- SmModule *pp = SM_MOD1();
- SmSymSetManager &rManager = pp->GetSymSetManager();
+ SmModule *pp = SM_MOD();
+ SmSymbolManager &rManager = pp->GetSymbolManager();
SymbolDescriptor *pDescriptor = aSequence.getArray();
for (sal_uInt32 i = 0; i < nSize ; i++, pDescriptor++)
{
@@ -717,7 +717,7 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any*
pDescriptor->sSymbolSet );
aSymbol.SetExportName ( pDescriptor->sExportName );
aSymbol.SetDocSymbol( TRUE );
- rManager.AddReplaceSymbol ( aSymbol );
+ rManager.AddOrReplaceSymbol ( aSymbol );
}
}
else
@@ -886,14 +886,15 @@ void SmModel::_getPropertyValues( const PropertyMapEntry **ppEntries, Any *pValu
case HANDLE_SYMBOLS:
{
// this is get
- SmModule *pp = SM_MOD1();
- const SmSymSetManager &rManager = pp->GetSymSetManager();
+ SmModule *pp = SM_MOD();
+ const SmSymbolManager &rManager = pp->GetSymbolManager();
vector < const SmSym * > aVector;
- USHORT nCount = 0;
- for (USHORT i = 0, nEnd = rManager.GetSymbolCount(); i < nEnd; i++)
+ const SymbolPtrVec_t aSymbols( rManager.GetSymbols() );
+ size_t nCount = 0;
+ for (size_t i = 0; i < aSymbols.size(); ++i)
{
- const SmSym * pSymbol = rManager.GetSymbolByPos( i );
+ const SmSym * pSymbol = aSymbols[ i ];
if (pSymbol && !pSymbol->IsPredefined () )
{
aVector.push_back ( pSymbol );
@@ -903,12 +904,12 @@ void SmModel::_getPropertyValues( const PropertyMapEntry **ppEntries, Any *pValu
Sequence < SymbolDescriptor > aSequence ( nCount );
SymbolDescriptor * pDescriptor = aSequence.getArray();
- vector <const SmSym * >::const_iterator aIter = aVector.begin(), aEnd = aVector.end();
+ vector < const SmSym * >::const_iterator aIter = aVector.begin(), aEnd = aVector.end();
for(; aIter != aEnd; pDescriptor++, aIter++)
{
pDescriptor->sName = (*aIter)->GetName();
pDescriptor->sExportName = (*aIter)->GetExportName();
- pDescriptor->sSymbolSet = (*aIter)->GetSetName();
+ pDescriptor->sSymbolSet = (*aIter)->GetSymbolSetName();
pDescriptor->nCharacter = static_cast < sal_Int32 > ((*aIter)->GetCharacter());
Font rFont = (*aIter)->GetFace();
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index e935958102a7..886d409931b2 100644..100755
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -107,7 +107,7 @@ SmGraphicWindow::SmGraphicWindow(SmViewShell* pShell):
const Fraction aFraction (1,1);
SetMapMode( MapMode(MAP_100TH_MM, Point(), aFraction, aFraction));
- ApplyColorConfigValues( SM_MOD1()->GetColorConfig() );
+ ApplyColorConfigValues( SM_MOD()->GetColorConfig() );
SetTotalSize();
@@ -145,7 +145,7 @@ void SmGraphicWindow::ApplyColorConfigValues( const svtools::ColorConfig &rColor
void SmGraphicWindow::DataChanged( const DataChangedEvent& rEvt )
{
- ApplyColorConfigValues( SM_MOD1()->GetColorConfig() );
+ ApplyColorConfigValues( SM_MOD()->GetColorConfig() );
ScrollableWindow::DataChanged( rEvt );
}
@@ -270,7 +270,7 @@ void SmGraphicWindow::SetCursor(const Rectangle &rRect)
// The old cursor will be removed, and the new one will be shown if
// that is activated in the ConfigItem
{
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
if (IsCursorVisible())
ShowCursor(FALSE); // clean up remainings of old cursor
@@ -324,7 +324,7 @@ void SmGraphicWindow::Paint(const Rectangle&)
nCol++;
const SmNode *pFound = SetCursorPos(nRow, nCol);
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
if (pFound && pp->GetConfig()->IsShowFormulaCursor())
ShowCursor(TRUE);
}
@@ -1163,7 +1163,7 @@ void SmViewShell::Impl_Print(
USHORT SmViewShell::Print(SfxProgress & /*rProgress*/, BOOL /*bIsAPI*/, PrintDialog * /*pPrintDialog*/)
{
RTL_LOGFILE_CONTEXT( aLog, "starmath: SmViewShell::Print" );
- DBG_ASSERT( 0, "SmViewShell::Print: no longer usewd with new UI print dialog. Should be removed!!" );
+ DBG_ASSERT( 0, "SmViewShell::Print: no longer used with new UI print dialog. Should be removed!!" );
return 0;
}
@@ -1191,7 +1191,7 @@ USHORT SmViewShell::SetPrinter(SfxPrinter *pNewPrinter, USHORT nDiffFlags, bool
if ((nDiffFlags & SFX_PRINTER_OPTIONS) == SFX_PRINTER_OPTIONS)
{
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
pp->GetConfig()->ItemSetToConfig(pNewPrinter->GetOptions());
}
return 0;
@@ -1379,7 +1379,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
{
case SID_FORMULACURSOR:
{
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
const SfxItemSet *pArgs = rReq.GetArgs();
const SfxPoolItem *pItem;
@@ -1681,11 +1681,11 @@ void SmViewShell::Execute(SfxRequest& rReq)
SmDocShell *pDoc = GetDoc();
OutputDevice *pDev = pDoc->GetPrinter();
if (!pDev || pDev->GetDevFontCount() == 0)
- pDev = &SM_MOD1()->GetDefaultVirtualDev();
+ pDev = &SM_MOD()->GetDefaultVirtualDev();
DBG_ASSERT (pDev, "device for font list missing" );
- SmModule *pp = SM_MOD1();
- SmSymbolDialog( NULL, pDev, pp->GetSymSetManager(), *this ).Execute();
+ SmModule *pp = SM_MOD();
+ SmSymbolDialog( NULL, pDev, pp->GetSymbolManager(), *this ).Execute();
}
break;
}
@@ -1760,7 +1760,7 @@ void SmViewShell::GetState(SfxItemSet &rSet)
case SID_FORMULACURSOR:
{
- SmModule *pp = SM_MOD1();
+ SmModule *pp = SM_MOD();
rSet.Put(SfxBoolItem(nWh, pp->GetConfig()->IsShowFormulaCursor()));
}
break;
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx
index e99c636ccedb..485a9a5733f7 100644
--- a/sw/inc/PostItMgr.hxx
+++ b/sw/inc/PostItMgr.hxx
@@ -234,7 +234,9 @@ class SwPostItMgr: public SfxListener
void Delete(String aAuthor);
void Delete();
+#if 0
void Hide( SwPostItField* pPostItField );
+#endif
void Hide( const String& rAuthor );
void Hide();
void Show();
@@ -274,7 +276,6 @@ class SwPostItMgr: public SfxListener
Color GetColorLight(sal_uInt16 aAuthorIndex);
Color GetColorAnchor(sal_uInt16 aAuthorIndex);
- bool ShowPreview(const SwField* pFld,SwFmtFld*& pFmtFld) const;
void RegisterAnswer(OutlinerParaObject* pAnswer) { mpAnswer = pAnswer;}
OutlinerParaObject* IsAnswer() {return mpAnswer;}
diff --git a/sw/inc/SidebarWin.hxx b/sw/inc/SidebarWin.hxx
index e8e918763b7b..b74931d8d9ef 100644
--- a/sw/inc/SidebarWin.hxx
+++ b/sw/inc/SidebarWin.hxx
@@ -146,6 +146,8 @@ class SwSidebarWin : public Window
void SetFollow( bool bIsFollow) { mbIsFollow = bIsFollow; };
virtual bool CalcFollow() = 0;
+#if 0
+#endif
sal_Int32 GetMetaHeight();
sal_Int32 GetMinimumSizeWithMeta();
diff --git a/sw/inc/SwNumberTree.hxx b/sw/inc/SwNumberTree.hxx
index a361cb61690b..58c5f38a5696 100644
--- a/sw/inc/SwNumberTree.hxx
+++ b/sw/inc/SwNumberTree.hxx
@@ -165,13 +165,6 @@ public:
}
/**
- Returns the first child of this node.
-
- @return the child
- */
- SwNumberTreeNode* GetFirstChild() const;
-
- /**
Returns number of this node.
@param bValidate validate the number?
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 3adc03dc13a5..a206392aad3b 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -717,7 +717,6 @@ Achtung: Ab sofort sind in diesem File keine C++-Kommentare (//) mehr
--------------------------------------------------------------------*/
#define FN_LINE_NUMBERING_DLG (FN_EXTRA + 2 ) /* Zeilennumerierung */
-#define FN_THESAURUS_DLG (FN_EXTRA + 3 ) /* Thesaurus */
#define FN_HYPHENATE_OPT_DLG (FN_EXTRA + 5 ) /* Silbentrennung */
#define FN_ADD_UNKNOWN (FN_EXTRA + 6 ) /* Woerter lernen */
#define FN_DICTIONARY_DLG (FN_EXTRA + 8 ) /* Woerterbuecher */
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index bcf511aa2a5b..22cb3613502e 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -27,6 +27,8 @@
#ifndef _CRSRSH_HXX
#define _CRSRSH_HXX
+#include <com/sun/star/i18n/WordType.hpp>
+
#include <tools/string.hxx>
#include <tools/link.hxx>
#include <tools/rtti.hxx>
@@ -746,11 +748,12 @@ public:
BOOL GoStartSentence();
BOOL GoEndSentence();
BOOL SelectWord( const Point* pPt = 0 );
+ BOOL ExpandToSentenceBorders();
// Position vom akt. Cursor erfragen
- BOOL IsStartWord()const;
- BOOL IsEndWord() const;
- BOOL IsInWord() const;
+ BOOL IsStartWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES )const;
+ BOOL IsEndWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const;
+ BOOL IsInWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const;
BOOL IsStartSentence() const;
BOOL IsEndSentence() const;
BOOL IsSttPara() const;
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index d433ff603b2f..10befb703b96 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -716,6 +716,7 @@ private:
bool DeleteAndJoinImpl(SwPaM&, const bool);
bool DeleteAndJoinWithRedlineImpl(SwPaM&, const bool unused = false);
bool DeleteRangeImpl(SwPaM&, const bool unused = false);
+ bool DeleteRangeImplImpl(SwPaM &);
bool ReplaceRangeImpl(SwPaM&, String const&, const bool);
public:
@@ -2130,7 +2131,7 @@ public:
::sfx2::IXmlIdRegistry& GetXmlIdRegistry();
::sw::MetaFieldManager & GetMetaFieldManager();
- SwDoc* CreateCopy() const;
+ SfxObjectShell* CreateCopy(bool bCallInitNew) const;
};
diff --git a/sw/inc/dochdl.hrc b/sw/inc/dochdl.hrc
index ae39f480e6a3..47b0b8014240 100644..100755
--- a/sw/inc/dochdl.hrc
+++ b/sw/inc/dochdl.hrc
@@ -43,10 +43,8 @@
#define STR_PRIVATEOLE (RC_DOCHDL_BEGIN + 10)
#define STR_DDEFORMAT (RC_DOCHDL_BEGIN + 11)
-#define BMP_SW_TEAM_MUGSHOT (RC_DOCHDL_BEGIN + 12)
-#define STR_SW_TEAM_NAMES (RC_DOCHDL_BEGIN + 13)
-#define DOCHDL_ACT_END STR_SW_TEAM_NAMES
+#define DOCHDL_ACT_END STR_DDEFORMAT
#if DOCHDL_ACT_END > RC_DOCHDL_END
#error Resource-Id Ueberlauf in #file, #line
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 8d2c1a81de49..9dc09103606e 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -201,6 +201,7 @@ public:
// change text to Upper/Lower/Hiragana/Katagana/...
void TransliterateText( sal_uInt32 nType );
+ void TransliterateText( const String& rModuleName );
// count words in current selection
void CountWords( SwDocStat& rStat ) const;
@@ -744,9 +745,14 @@ public:
bool SpellSentence(::svx::SpellPortions& rToFill, bool bIsGrammarCheck );
// make SpellIter start with the current sentence when called next time
void PutSpellingToSentenceStart();
+ // moves the continuation position to the end of the currently checked sentence
+ void MoveContinuationPosToEndOfCheckedSentence();
//applies a changed sentence
- void ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions, bool bIsGrammarCheck);
+ void ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions, bool bRecheck);
+
+ // check SwSpellIter data to see if the last sentence got grammar checked
+ bool HasLastSentenceGotGrammarChecked() const;
// Is text conversion active somewhere else?
BOOL HasConvIter() const;
// Is hyphenation active somewhere else?
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index b224d0c5ae24..216f902e4b6c 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -63,6 +63,11 @@ class SwFrmFmt;
struct SwSortOptions;
class SdrMarkList;
+namespace svx
+{
+ class ISdrObjectFilter;
+}
+
// return values for GetFrmType() und GetSelFrmType().
//! values can be combined via logival or
@@ -464,6 +469,7 @@ public:
BOOL GetObjAttr( SfxItemSet &rSet ) const;
BOOL SetObjAttr( const SfxItemSet &rSet );
+ const SdrObject* GetBestObject( BOOL bNext, USHORT eType = GOTOOBJ_DRAW_ANY, BOOL bFlat = TRUE, const ::svx::ISdrObjectFilter* pFilter = NULL );
BOOL GotoObj( BOOL bNext, USHORT /*GOTOOBJ_...*/ eType = GOTOOBJ_DRAW_ANY);
//Setzen vom DragMode (z.B. Rotate), tut nix bei Rahmenselektion.
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index a39dcefaabd3..a2e08366ba24 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -305,12 +305,17 @@ inline void SwFieldType::UpdateFlds() const
class SW_DLLPUBLIC SwField
{
+private:
+ mutable String m_Cache; /// #i85766# cached expansion (for clipboard)
USHORT nLang; // Immer ueber SetLanguage aendern!
BOOL bIsAutomaticLanguage;
sal_uInt32 nFormat;
SwFieldType* pType;
+ virtual String Expand() const = 0;
+ virtual SwField* Copy() const = 0;
+
protected:
void SetFormat(sal_uInt32 nSet) {nFormat = nSet;}
@@ -325,12 +330,16 @@ public:
// neuen Typ setzen (wird fuer das Kopieren zwischen Dokumenten benutzt)
virtual SwFieldType* ChgTyp( SwFieldType* );
- // Expandierung fuer die Anzeige
- virtual String Expand() const = 0;
+ /** expand the field.
+ @param bInClipboard field is in clipboard document?
+ @return the generated text (suitable for display)
+ */
+ String ExpandField(bool const bInClipboard) const;
// liefert den Namen oder den Inhalt
virtual String GetCntnt(BOOL bName = FALSE) const;
- virtual SwField* Copy() const = 0;
+
+ SwField * CopyField() const;
// ResId
USHORT Which() const
diff --git a/sw/inc/htmltbl.hxx b/sw/inc/htmltbl.hxx
index 941e6bc43eb2..ef16a2a89b86 100644
--- a/sw/inc/htmltbl.hxx
+++ b/sw/inc/htmltbl.hxx
@@ -267,6 +267,7 @@ class SwHTMLTableLayout
DECL_STATIC_LINK( SwHTMLTableLayout, DelayedResize_Impl, void* );
+ static USHORT GetBrowseWidthByVisArea( const SwDoc& rDoc );
public:
SwHTMLTableLayout( const SwTable *pSwTbl,
@@ -348,7 +349,6 @@ public:
// oder eine ViewShell vorhanden ist. Sonst wird 0 zurueckgegeben.
// (Wird vom HTML-Filter benoetigt, da der nicht an das Layout kommt.)
static USHORT GetBrowseWidth( const SwDoc& rDoc );
- static USHORT GetBrowseWidthByVisArea( const SwDoc& rDoc );
// Ermitteln der verfuegbaren Breite uber den Tabellen-Frame
USHORT GetBrowseWidthByTabFrm( const SwTabFrm& rTabFrm ) const;
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index cf3a4a779487..53168d5a9cb4 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _NDTXT_HXX
-#define _NDTXT_HXX
+#ifndef SW_NDTXT_HXX
+#define SW_NDTXT_HXX
#include <cppuhelper/weakref.hxx>
@@ -133,6 +133,8 @@ class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable
// pointer to the list, to whose the text node is added to
SwList* mpList;
// <--
+ /// #i111677# cached expansion (for clipboard)
+ ::std::auto_ptr< ::rtl::OUString > m_pNumStringCache;
::com::sun::star::uno::WeakReference<
::com::sun::star::text::XTextContent> m_wXParagraph;
diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx
index 592725f78d63..620fe0b00b63 100644
--- a/sw/inc/pch/precompiled_sw.hxx
+++ b/sw/inc/pch/precompiled_sw.hxx
@@ -728,7 +728,7 @@
#include "editeng/eeitem.hxx"
#include "filter/msfilter/escherex.hxx"
#include "svx/extrusionbar.hxx"
-#include "svx/extrusioncontrols.hxx"
+#include "svx/extrusioncolorcontrol.hxx"
#include "svx/fillctrl.hxx"
#include "svx/flagsdef.hxx"
#include "editeng/flstitem.hxx"
diff --git a/sw/inc/postithelper.hxx b/sw/inc/postithelper.hxx
index 560cdd143a56..31df018985c6 100644
--- a/sw/inc/postithelper.hxx
+++ b/sw/inc/postithelper.hxx
@@ -78,7 +78,6 @@ namespace SwPostItHelper
};
SwLayoutStatus getLayoutInfos( std::vector< SwLayoutInfo >&, SwPosition& );
- SwLayoutStatus getLayoutInfos( std::vector< SwLayoutInfo >&, SwTxtFld* );
long getLayoutHeight( const SwRootFrm* pRoot );
void setSidebarChanged( SwRootFrm* pRoot, bool bBrowseMode );
unsigned long getPageInfo( SwRect& rPageFrm, const SwRootFrm* , const Point& );
diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx
index 6e26a6a3bfcb..49a95e9b7c41 100644
--- a/sw/inc/swcrsr.hxx
+++ b/sw/inc/swcrsr.hxx
@@ -26,7 +26,9 @@
************************************************************************/
#ifndef _SWCRSR_HXX
#define _SWCRSR_HXX
+
#include <com/sun/star/i18n/WordType.hpp>
+
#include <pam.hxx>
#include <tblsel.hxx>
#include <cshtyp.hxx>
@@ -129,10 +131,10 @@ public:
const SfxItemSet* rReplSet = 0 );
// UI versions
- BOOL IsStartWord() const;
- BOOL IsEndWord() const;
+ BOOL IsStartWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const;
+ BOOL IsEndWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const;
+ BOOL IsInWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const;
BOOL IsStartEndSentence( bool bEnd ) const;
- BOOL IsInWord() const;
BOOL GoStartWord();
BOOL GoEndWord();
BOOL GoNextWord();
@@ -162,6 +164,7 @@ public:
BOOL GoEndSentence(){return GoSentence(END_SENT);}
BOOL GoPrevSentence(){return GoSentence(PREV_SENT);}
BOOL GoStartSentence(){return GoSentence(START_SENT);}
+ BOOL ExpandToSentenceBorders();
virtual BOOL LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode,
BOOL bAllowVisual, BOOL bSkipHidden, BOOL bInsertCrsr );
diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index 33d38e42ba55..96479197cde6 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -31,7 +31,7 @@
class SwDoc;
-class SwTableFmt : public SwFrmFmt
+class SW_DLLPUBLIC SwTableFmt : public SwFrmFmt
{
friend class SwDoc;
diff --git a/sw/inc/txtfld.hxx b/sw/inc/txtfld.hxx
index 1daff7d2e914..d0be4a008cab 100644
--- a/sw/inc/txtfld.hxx
+++ b/sw/inc/txtfld.hxx
@@ -41,7 +41,8 @@ class SwTxtFld : public SwTxtAttr
SwTxtNode * m_pTxtNode;
public:
- SwTxtFld( SwFmtFld& rAttr, xub_StrLen nStart );
+ SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStart,
+ bool const bInClipboard);
virtual ~SwTxtFld();
void CopyFld( SwTxtFld *pDest ) const;
diff --git a/sw/inc/txtftn.hxx b/sw/inc/txtftn.hxx
index 0b55053d03dd..07043a9263bc 100644
--- a/sw/inc/txtftn.hxx
+++ b/sw/inc/txtftn.hxx
@@ -49,7 +49,7 @@ public:
inline SwNodeIndex *GetStartNode() const { return m_pStartNode; }
void SetStartNode( const SwNodeIndex *pNode, BOOL bDelNodes = TRUE );
void SetNumber( const USHORT nNumber, const String* = 0 );
- void CopyFtn( SwTxtFtn *pDest ) const;
+ void CopyFtn(SwTxtFtn & rDest, SwTxtNode & rDestNode) const;
// get and set TxtNode pointer
inline const SwTxtNode& GetTxtNode() const;
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index 1c78914efbe7..cf92a707e40f 100644
--- a/sw/inc/undobj.hxx
+++ b/sw/inc/undobj.hxx
@@ -392,7 +392,6 @@ public:
*/
virtual SwRewriter GetRewriter() const;
- BOOL CanGrouping( const SwPosition&, sal_Unicode cIns );
DECL_FIXEDMEMPOOL_NEWDEL(SwUndoInsert)
};
@@ -549,7 +548,6 @@ public:
ULONG GetEndNode() const { return nEndNode; }
ULONG GetDestSttNode() const { return nDestSttNode; }
xub_StrLen GetDestSttCntnt() const { return nDestSttCntnt; }
- void AddTblMrgFlyHstry( SwHistory& rHstr );
void SetMoveRedlines( bool b ) { bMoveRedlines = b; }
@@ -1107,14 +1105,6 @@ public:
};
-class SwUndoDelBookmark : public SwUndoBookmark
-{
-public:
- SwUndoDelBookmark( const ::sw::mark::IMark& );
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
-};
-
class SwUndoInsBookmark : public SwUndoBookmark
{
public:
diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx
index f0036e7abf35..8d37888ea789 100755
--- a/sw/inc/viewopt.hxx
+++ b/sw/inc/viewopt.hxx
@@ -41,7 +41,7 @@ class ViewShell;
class SwDocShell;
namespace svtools{ class ColorConfig;}
-#define VIEWOPT_1_IDLE 0x00000001L
+//#define VIEWOPT_1_IDLE 0x00000001L no longer used, see new member 'bIdle'
#define VIEWOPT_1_TAB 0x00000002L
#define VIEWOPT_1_BLANK 0x00000004L
#define VIEWOPT_1_HARDBLANK 0x00000008L
@@ -164,6 +164,7 @@ protected:
BOOL bBookview : 1; // view mode for page preview
BOOL mbViewLayoutBookMode : 1; // book view mode for edit view
sal_Bool bShowPlaceHolderFields : 1; //only used in printing!
+ mutable bool bIdle;
// Maszstab
USHORT nZoom; // Angaben in Prozent
@@ -202,9 +203,14 @@ public:
----------------------------------------------------------------------------*/
inline BOOL IsIdle() const
- { return nCoreOptions & VIEWOPT_1_IDLE ? TRUE : FALSE; }
- inline void SetIdle( BOOL b )
- { (b != 0) ? (nCoreOptions |= VIEWOPT_1_IDLE ) : ( nCoreOptions &= ~VIEWOPT_1_IDLE); }
+ { return bIdle; }
+
+ // logically this is a const function since it does not modify the viewoptions
+ // but only effects idle formatting. Of course that member is already implement
+ // in the wrong place here... Also currently there are many const modifying casts in the code
+ // just to call this function on otherwise const objects. Thus declaring it as const now.
+ inline void SetIdle( BOOL b ) const
+ { bIdle = b; }
inline BOOL IsTab(BOOL bHard = FALSE) const
{ return !bReadonly && (nCoreOptions & VIEWOPT_1_TAB) &&
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 78909e69e7ce..6c7011d78bb4 100755..100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -395,9 +395,6 @@ public:
// compatible behaviour of tabs
void SetTabCompat( bool bNew );
- //#i24363# tab stops relative to indent
- void SetTabsRelativeToIndent( bool bNew );
-
// font metric attribute "External Leading" should be considered
void SetAddExtLeading( bool bNew );
diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx
index ee5ef83eb8a2..827671a7f94e 100644
--- a/sw/inc/viscrs.hxx
+++ b/sw/inc/viscrs.hxx
@@ -92,8 +92,6 @@ class SwSelPaintRects : public SwRects
// die Shell
const SwCrsrShell* pCShell;
- void Paint( const SwRect& rRect );
-
virtual void Paint( const Rectangle& rRect );
virtual void FillRects() = 0;
diff --git a/sw/inc/warnpassword.hxx b/sw/inc/warnpassword.hxx
deleted file mode 100644
index 05ee61d7587c..000000000000
--- a/sw/inc/warnpassword.hxx
+++ /dev/null
@@ -1,47 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef SW_WARNPASSWORD_HXX
-#define SW_WARNPASSWORD_HXX
-
-
-
-class SfxMedium;
-/** Static API helper functions. */
-class SwWarnPassword
-{
-public:
- /** Opens a query warning dialog.
- @descr Pop up Query on export with a choice of yes/no if a
- an encrypted password is imported.
- @return true if yes and false if no. default to true.
- */
- static bool WarningOnPassword( SfxMedium& rMedium );
-};
-
-
-#endif
diff --git a/sw/qa/unoapi/knownissues.xcl b/sw/qa/unoapi/knownissues.xcl
index 4f8e3953dfcf..08e441211cf7 100644
--- a/sw/qa/unoapi/knownissues.xcl
+++ b/sw/qa/unoapi/knownissues.xcl
@@ -21,6 +21,9 @@ sw.XMLStylesImporter::com::sun::star::xml::sax::XDocumentHandler
### i23422 ###
sw.SwXTextViewCursor::com::sun::star::beans::XMultiPropertyStates
+### i112111 ###
+sw.SwXViewSettings::com::sun::star::beans::XPropertySet
+
### i23623 ###
sw.SwXStyleFamily::com::sun::star::container::XNameReplace
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index 589ecf9e5939..e264aec28c28 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -472,6 +472,11 @@ interface BaseText
//
// Goto - Methoden
//
+ SID_FM_TOGGLECONTROLFOCUS
+ [
+ ExecMethod = ExecMoveMisc ;
+ StateMethod = NoState ;
+ ]
FN_CNTNT_TO_NEXT_FRAME // status(final|play)
[
ExecMethod = ExecMoveMisc ;
@@ -1480,6 +1485,24 @@ interface BaseText
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
+ SID_TRANSLITERATE_SENTENCE_CASE
+ [
+ ExecMethod = ExecTransliteration;
+ StateMethod = NoState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
+ SID_TRANSLITERATE_TITLE_CASE
+ [
+ ExecMethod = ExecTransliteration;
+ StateMethod = NoState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
+ SID_TRANSLITERATE_TOGGLE_CASE
+ [
+ ExecMethod = ExecTransliteration;
+ StateMethod = NoState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
SID_TRANSLITERATE_UPPER
[
ExecMethod = ExecTransliteration;
@@ -1580,6 +1603,12 @@ interface BaseText
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; // e.g. disable for read-only documents
]
+ SID_THES
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; // e.g. disable for read-only documents
+ ]
} //ende interface text
diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi
index b45e4a305328..ee5fc431e165 100644
--- a/sw/sdi/_viewsh.sdi
+++ b/sw/sdi/_viewsh.sdi
@@ -398,7 +398,7 @@ interface BaseTextEditView
ExecMethod = Execute ;
StateMethod = GetState ;
]
- FN_THESAURUS_DLG // status(final|play)
+ SID_THESAURUS // status(final|play)
[
ExecMethod = ExecLingu ;
StateMethod = GetState ;
diff --git a/sw/sdi/annotsh.sdi b/sw/sdi/annotsh.sdi
index 441beec686c6..349e17b9d985 100755
--- a/sw/sdi/annotsh.sdi
+++ b/sw/sdi/annotsh.sdi
@@ -31,7 +31,7 @@ interface Annotation : _Annotation
]
{
- FN_THESAURUS_DLG // api:
+ SID_THESAURUS // api:
[
ExecMethod = ExecLingu ;
StateMethod = GetLinguState ;
@@ -178,6 +178,27 @@ interface Annotation : _Annotation
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
+ SID_TRANSLITERATE_SENTENCE_CASE
+ [
+ ExecMethod = ExecTransliteration;
+ StateMethod = NoState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
+
+ SID_TRANSLITERATE_TITLE_CASE
+ [
+ ExecMethod = ExecTransliteration;
+ StateMethod = NoState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
+
+ SID_TRANSLITERATE_TOGGLE_CASE
+ [
+ ExecMethod = ExecTransliteration;
+ StateMethod = NoState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
+
SID_TRANSLITERATE_UPPER
[
ExecMethod = ExecTransliteration;
@@ -344,6 +365,13 @@ interface Annotation : _Annotation
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
+ SID_THES
+ [
+ ExecMethod = ExecLingu ;
+ StateMethod = GetLinguState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; // e.g. disable for read-only documents
+ ]
+
}
shell SwAnnotationShell
diff --git a/sw/sdi/drwtxtsh.sdi b/sw/sdi/drwtxtsh.sdi
index 6887346ee012..d98d368a9460 100644
--- a/sw/sdi/drwtxtsh.sdi
+++ b/sw/sdi/drwtxtsh.sdi
@@ -424,7 +424,7 @@ interface TextDrawText
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
- FN_THESAURUS_DLG // api:
+ SID_THESAURUS // api:
[
ExecMethod = ExecDrawLingu ;
StateMethod = GetState ;
@@ -478,6 +478,24 @@ interface TextDrawText
[
StateMethod = StateInsert ;
]
+ SID_TRANSLITERATE_SENTENCE_CASE
+ [
+ ExecMethod = ExecTransliteration;
+ StateMethod = NoState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
+ SID_TRANSLITERATE_TITLE_CASE
+ [
+ ExecMethod = ExecTransliteration;
+ StateMethod = NoState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
+ SID_TRANSLITERATE_TOGGLE_CASE
+ [
+ ExecMethod = ExecTransliteration;
+ StateMethod = NoState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
SID_TRANSLITERATE_UPPER
[
ExecMethod = ExecTransliteration;
@@ -514,6 +532,7 @@ interface TextDrawText
StateMethod = GetState ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
+
SID_LANGUAGE_STATUS
[
ExecMethod = Execute;
@@ -521,6 +540,13 @@ interface TextDrawText
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; // e.g. disable for read-only documents
]
+ SID_THES
+ [
+ ExecMethod = Execute;
+ StateMethod = GetState;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; // e.g. disable for read-only documents
+ ]
+
FN_FORMAT_FOOTNOTE_DLG // status()
[
ExecMethod = Execute ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index aede24688e1e..c27ac20b0013 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -8319,31 +8319,6 @@ SfxVoidItem TextWrap FN_DRAW_WRAP_DLG
]
//--------------------------------------------------------------------------
-SfxVoidItem ThesaurusDialog FN_THESAURUS_DLG
-()
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = TRUE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Asynchron;
-
- /* config: */
- AccelConfig = TRUE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_OPTIONS;
-]
-
-//--------------------------------------------------------------------------
SfxVoidItem ToggleAnchorType FN_TOOL_ANKER
()
[
diff --git a/sw/sdi/swslots.src b/sw/sdi/swslots.src
deleted file mode 100644
index 030fdee2a157..000000000000
--- a/sw/sdi/swslots.src
+++ /dev/null
@@ -1,1488 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "cmdid.h"
-#include "svx/svxids.hrc"
-#include "globals.hrc"
-SfxSlotInfo FN_ABSTRACT_NEWDOC
-{
- Slotname [ en-US ] = "Document From Abstract";
-};
-SfxSlotInfo FN_ABSTRACT_STARIMPRESS
-{
- Slotname [ en-US ] = "Presentation from Abstract";
-};
-SfxSlotInfo FN_ADD_UNKNOWN
-{
- Slotname [ en-US ] = "Add Unknown Words";
-};
-SfxSlotInfo FN_AUTO_CORRECT
-{
- Slotname [ en-US ] = "AutoCorrect";
-};
-SfxSlotInfo FN_AUTOFORMAT_APPLY
-{
- Slotname [ en-US ] = "Apply AutoFormat Options";
-};
-SfxSlotInfo FN_AUTOFORMAT_AUTO
-{
- Slotname [ en-US ] = "AutoFormat While Typing";
-};
-SfxSlotInfo FN_AUTOFORMAT_REDLINE_APPLY
-{
- Slotname [ en-US ] = "Apply AutoFormat Options and confirm Changes";
-};
-SfxSlotInfo FN_BACKSPACE
-{
- Slotname [ en-US ] = "Backspace";
-};
-SfxSlotInfo FN_CALC_TABLE
-{
- Slotname [ en-US ] = "Calculate Table";
-};
-SfxSlotInfo FN_CALCULATE
-{
- Slotname [ en-US ] = "Calculate Selection";
-};
-SfxSlotInfo FN_CHANGE_DBFIELD
-{
- Slotname [ en-US ] = "Change Database";
-};
-SfxSlotInfo FN_CHANGE_PAGENUM
-{
- Slotname [ en-US ] = "Page Number";
-};
-SfxSlotInfo FN_CHAR_LEFT
-{
- Slotname [ en-US ] = "To Character Left";
-};
-SfxSlotInfo FN_CHAR_LEFT_SEL
-{
- Slotname [ en-US ] = "Select Character Left";
-};
-SfxSlotInfo FN_CHAR_RIGHT
-{
- Slotname [ en-US ] = "Go Right";
-};
-SfxSlotInfo FN_CHAR_RIGHT_SEL
-{
- Slotname [ en-US ] = "Select Character Right";
-};
-SfxSlotInfo FN_CNTNT_TO_NEXT_FRAME
-{
- Slotname [ en-US ] = "To Next Frame";
-};
-SfxSlotInfo FN_CONVERT_TEXT_TABLE
-{
- Slotname [ en-US ] = "Convert Table/Text";
-};
-SfxSlotInfo FN_DEC_INDENT_OFFSET
-{
- Slotname [ en-US ] = "Decrement Indent Value";
-};
-SfxSlotInfo FN_DELETE_BACK_LINE
-{
- Slotname [ en-US ] = "Delete to Start of Line";
-};
-SfxSlotInfo FN_DELETE_BACK_PARA
-{
- Slotname [ en-US ] = "Delete to Start of Paragraph";
-};
-SfxSlotInfo FN_DELETE_BACK_SENT
-{
- Slotname [ en-US ] = "Delete to Start of Sentence";
-};
-SfxSlotInfo FN_DELETE_BACK_WORD
-{
- Slotname [ en-US ] = "Delete to Start of Word";
-};
-SfxSlotInfo FN_DELETE_LINE
-{
- Slotname [ en-US ] = "Delete to End of Line";
-};
-SfxSlotInfo FN_DELETE_PARA
-{
- Slotname [ en-US ] = "Delete to End of Paragraph";
-};
-SfxSlotInfo FN_DELETE_SENT
-{
- Slotname [ en-US ] = "Delete to End of Sentence";
-};
-SfxSlotInfo FN_DELETE_WHOLE_LINE
-{
- Slotname [ en-US ] = "Delete Row";
-};
-SfxSlotInfo FN_DELETE_WORD
-{
- Slotname [ en-US ] = "Delete to End of Word";
-};
-SfxSlotInfo FN_DRAW_WRAP_DLG
-{
- Slotname [ en-US ] = "Text Wrap";
-};
-SfxSlotInfo FN_DRAWTEXT_ATTR_DLG
-{
- Slotname [ en-US ] = "Text Attributes";
-};
-SfxSlotInfo FN_EDIT_FIELD
-{
- Slotname [ en-US ] = "Fields";
-};
-SfxSlotInfo FN_EDIT_FOOTNOTE
-{
- Slotname [ en-US ] = "Footnote";
-};
-SfxSlotInfo FN_EDIT_FORMULA
-{
- Slotname [ en-US ] = "Formula Bar";
-};
-SfxSlotInfo FN_EDIT_IDX_ENTRY_DLG
-{
- Slotname [ en-US ] = "Index Entry";
-};
-SfxSlotInfo FN_EDIT_LINK_DLG
-{
- Slotname [ en-US ] = "Links";
-};
-SfxSlotInfo FN_EDIT_REGION
-{
- Slotname [ en-US ] = "Sections";
-};
-SfxSlotInfo FN_END_DOC_DIRECT
-{
- Slotname [ en-US ] = "Directly to Document End";
-};
-SfxSlotInfo FN_END_OF_COLUMN
-{
- Slotname [ en-US ] = "To Column End";
-};
-SfxSlotInfo FN_END_OF_DOCUMENT
-{
- Slotname [ en-US ] = "To Document End";
-};
-SfxSlotInfo FN_END_OF_DOCUMENT_SEL
-{
- Slotname [ en-US ] = "Select to Document End";
-};
-SfxSlotInfo FN_END_OF_LINE
-{
- Slotname [ en-US ] = "To End of Line";
-};
-SfxSlotInfo FN_END_OF_LINE_SEL
-{
- Slotname [ en-US ] = "Select to End of Line";
-};
-SfxSlotInfo FN_END_OF_NEXT_COLUMN
-{
- Slotname [ en-US ] = "To End of Next Column";
-};
-SfxSlotInfo FN_END_OF_NEXT_PAGE
-{
- Slotname [ en-US ] = "To End of Next Page";
-};
-SfxSlotInfo FN_END_OF_NEXT_PAGE_SEL
-{
- Slotname [ en-US ] = "Select to End of Next Page";
-};
-SfxSlotInfo FN_END_OF_PAGE
-{
- Slotname [ en-US ] = "To Page End";
-};
-SfxSlotInfo FN_END_OF_PAGE_SEL
-{
- Slotname [ en-US ] = "Select to Page End";
-};
-SfxSlotInfo FN_END_OF_PARA
-{
- Slotname [ en-US ] = "To Paragraph End";
-};
-SfxSlotInfo FN_END_OF_PARA_SEL
-{
- Slotname [ en-US ] = "Select to Paragraph End";
-};
-SfxSlotInfo FN_END_OF_PREV_COLUMN
-{
- Slotname [ en-US ] = "To Previous Column";
-};
-SfxSlotInfo FN_END_OF_PREV_PAGE
-{
- Slotname [ en-US ] = "To End of Previous Page";
-};
-SfxSlotInfo FN_END_OF_PREV_PAGE_SEL
-{
- Slotname [ en-US ] = "Select to End of Previous Page";
-};
-SfxSlotInfo FN_END_TABLE
-{
- Slotname [ en-US ] = "To Table End";
-};
-SfxSlotInfo FN_ENVELOP
-{
- Slotname [ en-US ] = "Insert Envelope";
-};
-SfxSlotInfo FN_ESCAPE
-{
- Slotname [ en-US ] = "Cancel";
-};
-SfxSlotInfo FN_EXECUTE_MACROFIELD
-{
- Slotname [ en-US ] = "Run Macro Field";
-};
-SfxSlotInfo FN_EXPAND_GLOSSARY
-{
- Slotname [ en-US ] = "Run AutoText Entry";
-};
-SfxSlotInfo FN_FLIP_HORZ_GRAFIC
-{
- Slotname [ en-US ] = "Flip Vertically";
-};
-SfxSlotInfo FN_FLIP_VERT_GRAFIC
-{
- Slotname [ en-US ] = "Flip Horizontally";
-};
-SfxSlotInfo FN_FOOTNOTE_TO_ANCHOR
-{
- Slotname [ en-US ] = "To Footnote Anchor";
-};
-SfxSlotInfo FN_FORMAT_BACKGROUND_DLG
-{
- Slotname [ en-US ] = "Background";
-};
-SfxSlotInfo FN_FORMAT_BORDER_DLG
-{
- Slotname [ en-US ] = "Borders";
-};
-SfxSlotInfo FN_FORMAT_DROPCAPS
-{
- Slotname [ en-US ] = "Drop Caps";
-};
-SfxSlotInfo FN_FORMAT_FOOTNOTE_DLG
-{
- Slotname [ en-US ] = "Footnotes";
-};
-SfxSlotInfo FN_FORMAT_FRAME_DLG
-{
- Slotname [ en-US ] = "Frame Properties";
-};
-SfxSlotInfo FN_FORMAT_GRAFIC_DLG
-{
- Slotname [ en-US ] = "Edit Graphics";
-};
-SfxSlotInfo FN_FORMAT_PAGE_COLUMN_DLG
-{
- Slotname [ en-US ] = "Page Columns";
-};
-SfxSlotInfo FN_FORMAT_PAGE_DLG
-{
- Slotname [ en-US ] = "Page Settings";
-};
-SfxSlotInfo FN_FORMAT_RESET
-{
- Slotname [ en-US ] = "Reset Font Attributes";
-};
-SfxSlotInfo FN_FORMAT_TABLE_DLG
-{
- Slotname [ en-US ] = "Edit Table";
-};
-SfxSlotInfo FN_FRAME_ALIGN_HORZ_CENTER
-{
- Slotname [ en-US ] = "Center Horizontal";
-};
-SfxSlotInfo FN_FRAME_ALIGN_HORZ_LEFT
-{
- Slotname [ en-US ] = "Align Left";
-};
-SfxSlotInfo FN_FRAME_ALIGN_HORZ_RIGHT
-{
- Slotname [ en-US ] = "Align Right";
-};
-SfxSlotInfo FN_FRAME_ALIGN_VERT_BOTTOM
-{
- Slotname [ en-US ] = "Align Bottom";
-};
-SfxSlotInfo FN_FRAME_ALIGN_VERT_CENTER
-{
- Slotname [ en-US ] = "Align Vertical Center";
-};
-SfxSlotInfo FN_FRAME_ALIGN_VERT_CHAR_BOTTOM
-{
- Slotname [ en-US ] = "Align to Bottom of Character";
-};
-SfxSlotInfo FN_FRAME_ALIGN_VERT_CHAR_CENTER
-{
- Slotname [ en-US ] = "Align to Vertical Center of Character";
-};
-SfxSlotInfo FN_FRAME_ALIGN_VERT_CHAR_TOP
-{
- Slotname [ en-US ] = "Align to Top of Character";
-};
-SfxSlotInfo FN_FRAME_ALIGN_VERT_ROW_BOTTOM
-{
- Slotname [ en-US ] = "Align to Bottom of Line";
-};
-SfxSlotInfo FN_FRAME_ALIGN_VERT_ROW_CENTER
-{
- Slotname [ en-US ] = "Align to Vertical Center of Line";
-};
-SfxSlotInfo FN_FRAME_ALIGN_VERT_ROW_TOP
-{
- Slotname [ en-US ] = "Align to Top of Line";
-};
-SfxSlotInfo FN_FRAME_ALIGN_VERT_TOP
-{
- Slotname [ en-US ] = "Align Top";
-};
-SfxSlotInfo FN_FRAME_CHAIN
-{
- Slotname [ en-US ] = "Link Frames";
-};
-SfxSlotInfo FN_FRAME_DOWN
-{
- Slotname [ en-US ] = "Send Backward";
-};
-SfxSlotInfo FN_FRAME_MIRROR_ON_EVEN_PAGES
-{
- Slotname [ en-US ] = "Mirror Object on Even Pages";
-};
-SfxSlotInfo FN_FRAME_NOWRAP
-{
- Slotname [ en-US ] = "Wrap Off";
-};
-SfxSlotInfo FN_FRAME_TO_ANCHOR
-{
- Slotname [ en-US ] = "Set Cursor To Anchor";
-};
-SfxSlotInfo FN_FRAME_UNCHAIN
-{
- Slotname [ en-US ] = "Unlink Frames";
-};
-SfxSlotInfo FN_FRAME_UP
-{
- Slotname [ en-US ] = "Bring Forward";
-};
-SfxSlotInfo FN_FRAME_WRAP
-{
- Slotname [ en-US ] = "Wrap On";
-};
-SfxSlotInfo FN_FRAME_WRAP_CONTOUR
-{
- Slotname [ en-US ] = "Wrap Contour On";
-};
-SfxSlotInfo FN_FRAME_WRAP_IDEAL
-{
- Slotname [ en-US ] = "Wrap Optimal";
-};
-SfxSlotInfo FN_FRAME_WRAP_LEFT
-{
- Slotname [ en-US ] = "Wrap Left";
-};
-SfxSlotInfo FN_FRAME_WRAP_RIGHT
-{
- Slotname [ en-US ] = "Wrap Right";
-};
-SfxSlotInfo FN_FRAME_WRAPTHRU
-{
- Slotname [ en-US ] = "Wrap Through";
-};
-SfxSlotInfo FN_FRAME_WRAPTHRU_TRANSP
-{
- Slotname [ en-US ] = "Wrap Transparent";
-};
-SfxSlotInfo FN_GLOSSARY_DLG
-{
- Slotname [ en-US ] = "Edit AutoText";
-};
-SfxSlotInfo FN_GOTO_NEXT_INPUTFLD
-{
- Slotname [ en-US ] = "To Next Input Field";
-};
-SfxSlotInfo FN_GOTO_NEXT_MARK
-{
- Slotname [ en-US ] = "To Next Placeholder";
-};
-SfxSlotInfo FN_GOTO_NEXT_OBJ
-{
- Slotname [ en-US ] = "To Next Object";
-};
-SfxSlotInfo FN_GOTO_NEXT_REGION
-{
- Slotname [ en-US ] = "To Next Section";
-};
-SfxSlotInfo FN_GOTO_PREV_INPUTFLD
-{
- Slotname [ en-US ] = "To Previous Input Field";
-};
-SfxSlotInfo FN_GOTO_PREV_MARK
-{
- Slotname [ en-US ] = "To Previous Placeholder";
-};
-SfxSlotInfo FN_GOTO_PREV_OBJ
-{
- Slotname [ en-US ] = "To Previous Object";
-};
-SfxSlotInfo FN_GOTO_PREV_REGION
-{
- Slotname [ en-US ] = "To Previous Section";
-};
-SfxSlotInfo FN_GOTO_REFERENCE
-{
- Slotname [ en-US ] = "To Reference";
-};
-SfxSlotInfo FN_GRAPHIC_MIRROR_ON_EVEN_PAGES
-{
- Slotname [ en-US ] = "Flip Graphics on Even Pages";
-};
-SfxSlotInfo FN_GROW_FONT_SIZE
-{
- Slotname [ en-US ] = "Increase Font";
-};
-SfxSlotInfo FN_HSCROLLBAR
-{
- Slotname [ en-US ] = "Scroll Horizontal";
-};
-SfxSlotInfo FN_HYPHENATE_OPT_DLG
-{
- Slotname [ en-US ] = "Hyphenation";
-};
-SfxSlotInfo FN_IDX_MARK_TO_IDX
-{
- Slotname [ en-US ] = "Index Mark to Index";
-};
-SfxSlotInfo FN_INC_INDENT_OFFSET
-{
- Slotname [ en-US ] = "Increment Indent Value";
-};
-SfxSlotInfo FN_INSERT_BOOKMARK
-{
- Slotname [ en-US ] = "Insert Bookmark";
-};
-SfxSlotInfo FN_INSERT_BREAK
-{
- Slotname [ en-US ] = "Insert Paragraph";
-};
-SfxSlotInfo FN_INSERT_BREAK_DLG
-{
- Slotname [ en-US ] = "Insert Manual Break";
-};
-SfxSlotInfo FN_INSERT_CAPTION
-{
- Slotname [ en-US ] = "Insert Caption";
-};
-SfxSlotInfo FN_INSERT_COLUMN_BREAK
-{
- Slotname [ en-US ] = "Insert Column Break";
-};
-SfxSlotInfo FN_INSERT_CTRL
-{
- Slotname [ en-US ] = "Insert";
-};
-SfxSlotInfo FN_INSERT_ENDNOTE
-{
- Slotname [ en-US ] = "Insert Endnote Directly";
-};
-SfxSlotInfo FN_INSERT_FIELD
-{
- Slotname [ en-US ] = "Fields Dialog";
-};
-SfxSlotInfo FN_INSERT_FIELD_CTRL
-{
- Slotname [ en-US ] = "Insert Fields";
-};
-SfxSlotInfo FN_INSERT_FLD_AUTHOR
-{
- Slotname [ en-US ] = "Insert Author Field";
-};
-SfxSlotInfo FN_INSERT_FLD_DATE
-{
- Slotname [ en-US ] = "Insert Date";
-};
-SfxSlotInfo FN_INSERT_FLD_PGCOUNT
-{
- Slotname [ en-US ] = "Insert Page Count";
-};
-SfxSlotInfo FN_INSERT_FLD_PGNUMBER
-{
- Slotname [ en-US ] = "Insert Page Number";
-};
-SfxSlotInfo FN_INSERT_FLD_TIME
-{
- Slotname [ en-US ] = "Insert Time";
-};
-SfxSlotInfo FN_INSERT_FLD_TITLE
-{
- Slotname [ en-US ] = "Insert Document Title";
-};
-SfxSlotInfo FN_INSERT_FLD_TOPIC
-{
- Slotname [ en-US ] = "Insert Subject";
-};
-SfxSlotInfo FN_INSERT_FOOTNOTE
-{
- Slotname [ en-US ] = "Insert Footnote Directly";
-};
-SfxSlotInfo FN_INSERT_FOOTNOTE_DLG
-{
- Slotname [ en-US ] = "Insert Footnote";
-};
-SfxSlotInfo FN_INSERT_FRAME
-{
- Slotname [ en-US ] = "Insert Frame";
-};
-SfxSlotInfo FN_INSERT_FRAME_INTERACT_NOCOL
-{
- Slotname [ en-US ] = "Insert single-column frame manually";
-};
-SfxSlotInfo FN_INSERT_FRAME_INTERACT
-{
- Slotname [ en-US ] = "Insert Frame Manually";
-};
-SfxSlotInfo FN_INSERT_HARD_SPACE
-{
- Slotname [ en-US ] = "Insert Non-breaking Space";
-};
-SfxSlotInfo FN_INSERT_HARDHYPHEN
-{
- Slotname [ en-US ] = "Insert Non-breaking Hyphen";
-};
-SfxSlotInfo FN_INSERT_HRULER
-{
- Slotname [ en-US ] = "Insert Horizontal Ruler";
-};
-SfxSlotInfo FN_INSERT_HYPERLINK
-{
- Slotname [ en-US ] = "Insert Hyperlink";
-};
-SfxSlotInfo FN_INSERT_IDX_ENTRY_DLG
-{
- Slotname [ en-US ] = "Insert Index Marker";
-};
-SfxSlotInfo FN_INSERT_LINEBREAK
-{
- Slotname [ en-US ] = "Insert Manual Row Break";
-};
-SfxSlotInfo FN_INSERT_OBJ_CTRL
-{
- Slotname [ en-US ] = "Insert Object";
-};
-SfxSlotInfo FN_INSERT_OBJECT_DLG
-{
- Slotname [ en-US ] = "Insert Other Objects";
-};
-SfxSlotInfo FN_INSERT_PAGEBREAK
-{
- Slotname [ en-US ] = "Insert Manual Page Break";
-};
-SfxSlotInfo FN_INSERT_PAGEFOOTER
-{
- Slotname [ en-US ] = "Insert Footer";
-};
-SfxSlotInfo FN_INSERT_PAGEHEADER
-{
- Slotname [ en-US ] = "Insert Header";
-};
-SfxSlotInfo FN_INSERT_REF_FIELD
-{
- Slotname [ en-US ] = "Insert Field Reference";
-};
-SfxSlotInfo FN_INSERT_REGION
-{
- Slotname [ en-US ] = "Insert Section";
-};
-SfxSlotInfo FN_INSERT_SMA
-{
- Slotname [ en-US ] = "Insert %PRODUCTNAME Math object";
-};
-SfxSlotInfo FN_INSERT_SOFT_HYPHEN
-{
- Slotname [ en-US ] = "Insert Optional Hyphen";
-};
-SfxSlotInfo FN_INSERT_SYMBOL
-{
- Slotname [ en-US ] = "Insert Special Character ";
-};
-SfxSlotInfo FN_INSERT_TABLE
-{
- Slotname [ en-US ] = "Insert Table";
-};
-SfxSlotInfo FN_JAVAEDIT
-{
- Slotname [ en-US ] = "Insert Script";
-};
-SfxSlotInfo FN_LABEL
-{
- Slotname [ en-US ] = "Insert Labels";
-};
-SfxSlotInfo FN_BUSINESS_CARD
-{
- Slotname [ en-US ] = "Insert business cards";
-};
-SfxSlotInfo FN_LINE_DOWN
-{
- Slotname [ en-US ] = "To Line Below";
-};
-SfxSlotInfo FN_LINE_DOWN_SEL
-{
- Slotname [ en-US ] = "Select Down";
-};
-SfxSlotInfo FN_LINE_NUMBERING_DLG
-{
- Slotname [ en-US ] = "Set Line Numbering";
-};
-SfxSlotInfo FN_LINE_UP
-{
- Slotname [ en-US ] = "To Top Line";
-};
-SfxSlotInfo FN_LINE_UP_SEL
-{
- Slotname [ en-US ] = "Select to Top Line";
-};
-SfxSlotInfo FN_NAVIGATION_PI_GOTO_PAGE
-{
- Slotname [ en-US ] = "To Page";
-};
-SfxSlotInfo FN_NEW_GLOBAL_DOC
-{
- Slotname [ en-US ] = "Create Master Document";
-};
-SfxSlotInfo FN_NEW_HTML_DOC
-{
- Slotname [ en-US ] = "Create HTML Document";
-};
-SfxSlotInfo FN_NEXT_BOOKMARK
-{
- Slotname [ en-US ] = "To Next Bookmark";
-};
-SfxSlotInfo FN_NEXT_FOOTNOTE
-{
- Slotname [ en-US ] = "To Next Footnote";
-};
-SfxSlotInfo FN_NEXT_PARA
-{
- Slotname [ en-US ] = "To Next Paragraph";
-};
-SfxSlotInfo FN_NEXT_SENT
-{
- Slotname [ en-US ] = "To Next Sentence";
-};
-SfxSlotInfo FN_NEXT_SENT_SEL
-{
- Slotname [ en-US ] = "Select to Next Sentence";
-};
-SfxSlotInfo FN_NEXT_TABLE
-{
- Slotname [ en-US ] = "To Next Table";
-};
-SfxSlotInfo FN_NEXT_TBLFML
-{
- Slotname [ en-US ] = "Go to next table formula";
-};
-SfxSlotInfo FN_NEXT_TBLFML_ERR
-{
- Slotname [ en-US ] = "Go to next faulty table formula";
-};
-SfxSlotInfo FN_NEXT_TOXMARK
-{
- Slotname [ en-US ] = "Go to Next Index Mark";
-};
-SfxSlotInfo FN_NEXT_WORD
-{
- Slotname [ en-US ] = "To Word Right";
-};
-SfxSlotInfo FN_NEXT_WORD_SEL
-{
- Slotname [ en-US ] = "Select to Word Right";
-};
-SfxSlotInfo FN_NUM_BULLET_DOWN
-{
- Slotname [ en-US ] = "Down One Level";
-};
-SfxSlotInfo FN_NUM_BULLET_MOVEDOWN
-{
- Slotname [ en-US ] = "Move Down";
-};
-SfxSlotInfo FN_NUM_BULLET_MOVEUP
-{
- Slotname [ en-US ] = "Move Up";
-};
-SfxSlotInfo FN_NUM_BULLET_NEXT
-{
- Slotname [ en-US ] = "To Next Paragraph in Level";
-};
-SfxSlotInfo FN_NUM_BULLET_NONUM
-{
- Slotname [ en-US ] = "Insert Unnumbered Entry";
-};
-SfxSlotInfo FN_NUM_BULLET_OFF
-{
- Slotname [ en-US ] = "Numbering Off";
-};
-SfxSlotInfo FN_NUM_BULLET_OUTLINE_DOWN
-{
- Slotname [ en-US ] = "Move Down with Subpoints";
-};
-SfxSlotInfo FN_NUM_BULLET_OUTLINE_MOVEDOWN
-{
- Slotname [ en-US ] = "Move Down with Subpoints";
-};
-SfxSlotInfo FN_NUM_BULLET_OUTLINE_MOVEUP
-{
- Slotname [ en-US ] = "Move Up with Subpoints";
-};
-SfxSlotInfo FN_NUM_BULLET_OUTLINE_UP
-{
- Slotname [ en-US ] = "Move Up with Subpoints";
-};
-SfxSlotInfo FN_NUM_BULLET_PREV
-{
- Slotname [ en-US ] = "To Previous Paragraph in Level";
-};
-SfxSlotInfo FN_NUM_BULLET_UP
-{
- Slotname [ en-US ] = "Up One Level";
-};
-SfxSlotInfo FN_NUM_FORMAT_TABLE_DLG
-{
- Slotname [ en-US ] = "Edit Number Format";
-};
-SfxSlotInfo FN_NUM_OR_NONUM
-{
- Slotname [ en-US ] = "Numbering On/Off";
-};
-SfxSlotInfo FN_NUMBER_BULLETS
-{
- Slotname [ en-US ] = "Edit Numbering";
-};
-SfxSlotInfo FN_NUMBER_CURRENCY
-{
- Slotname [ en-US ] = "Number Format: Currency";
-};
-SfxSlotInfo FN_NUMBER_DATE
-{
- Slotname [ en-US ] = "Number Format : Date";
-};
-SfxSlotInfo FN_NUMBER_NEWSTART
-{
- Slotname [ en-US ] = "Restart Numbering";
-};
-SfxSlotInfo FN_NUMBER_PERCENT
-{
- Slotname [ en-US ] = "Number Format: Percent";
-};
-SfxSlotInfo FN_NUMBER_SCIENTIFIC
-{
- Slotname [ en-US ] = "Number Format: Exponential";
-};
-SfxSlotInfo FN_NUMBER_STANDARD
-{
- Slotname [ en-US ] = "Number Format: Standard";
-};
-SfxSlotInfo FN_NUMBER_TIME
-{
- Slotname [ en-US ] = "Number Format: Time";
-};
-SfxSlotInfo FN_NUMBER_TWODEC
-{
- Slotname [ en-US ] = "Number Format: Decimal";
-};
-SfxSlotInfo FN_NUMBERING_OUTLINE_DLG
-{
- Slotname [ en-US ] = "Outline Numbering";
-};
-SfxSlotInfo FN_OPTIMIZE_TABLE
-{
- Slotname [ en-US ] = "Optimize";
-};
-SfxSlotInfo FN_OUTLINE_TO_CLIPBOARD
-{
- Slotname [ en-US ] = "Outline to Clipboard";
-};
-SfxSlotInfo FN_OUTLINE_TO_IMPRESS
-{
- Slotname [ en-US ] = "Outline to Presentation";
-};
-SfxSlotInfo FN_PAGE_STYLE_SET_COLS
-{
- Slotname [ en-US ] = "Page Style: Columns";
-};
-SfxSlotInfo FN_PAGEDOWN
-{
- Slotname [ en-US ] = "Next Page";
-};
-SfxSlotInfo FN_PAGEDOWN_SEL
-{
- Slotname [ en-US ] = "Select to Next Page";
-};
-SfxSlotInfo FN_PAGEUP
-{
- Slotname [ en-US ] = "Previous Page";
-};
-SfxSlotInfo FN_PAGEUP_SEL
-{
- Slotname [ en-US ] = "Select to Previous Page";
-};
-SfxSlotInfo FN_PASTESPECIAL
-{
- Slotname [ en-US ] = "Paste Special";
-};
-SfxSlotInfo FN_PASTEUNFORMATTED
-{
- Slotname [ en-US ] = "Paste Unformatted Text";
-};
-SfxSlotInfo FN_POSTIT
-{
- Slotname [ en-US ] = "Insert Note";
-};
-SfxSlotInfo FN_PREV_BOOKMARK
-{
- Slotname [ en-US ] = "To Previous Bookmark";
-};
-SfxSlotInfo FN_PREV_FOOTNOTE
-{
- Slotname [ en-US ] = "To Previous Footnote";
-};
-SfxSlotInfo FN_PREV_PARA
-{
- Slotname [ en-US ] = "To Previous Paragraph";
-};
-SfxSlotInfo FN_PREV_SENT
-{
- Slotname [ en-US ] = "To Previous Sentence";
-};
-SfxSlotInfo FN_PREV_SENT_SEL
-{
- Slotname [ en-US ] = "Select to Previous Sentence";
-};
-SfxSlotInfo FN_PREV_TABLE
-{
- Slotname [ en-US ] = "To Previous Table";
-};
-SfxSlotInfo FN_PREV_TBLFML
-{
- Slotname [ en-US ] = "Go to previous table formula";
-};
-SfxSlotInfo FN_PREV_TBLFML_ERR
-{
- Slotname [ en-US ] = "Go to previous faulty table formula";
-};
-SfxSlotInfo FN_PREV_TOXMARK
-{
- Slotname [ en-US ] = "Go to Previous Index Mark";
-};
-SfxSlotInfo FN_PREV_WORD
-{
- Slotname [ en-US ] = "To Word Left";
-};
-SfxSlotInfo FN_PREV_WORD_SEL
-{
- Slotname [ en-US ] = "Select to Begin of Word";
-};
-SfxSlotInfo FN_PREVIEW_ZOOM
-{
- Slotname [ en-US ] = "Preview Zoom";
-};
-SfxSlotInfo FN_PRINT_LAYOUT
-{
- Slotname [ en-US ] = "Print Layout On/Off";
-};
-SfxSlotInfo FN_PRINT_PAGEPREVIEW
-{
- Slotname [ en-US ] = "Print document";
-};
-SfxSlotInfo FN_MAILMERGE_WIZARD
-{
- SlotName[ en-US ] = "Mail Merge Wizard";
-};
-SfxSlotInfo FN_QRY_MERGE
-{
- Slotname [ en-US ] = "Prepare Mail Merge";
-};
-SfxSlotInfo FN_REDLINE_ACCEPT
-{
- Slotname [ en-US ] = "Accept or Reject Changes";
-};
-SfxSlotInfo FN_REDLINE_COMMENT
-{
- Slotname [ en-US ] = "Insert Comment";
-};
-SfxSlotInfo FN_REDLINE_ON
-{
- Slotname [ en-US ] = "Switch on Review";
-};
-SfxSlotInfo FN_REDLINE_PROTECT
-{
- Slotname [ en-US ] = "Protect Record of Changes";
-};
-SfxSlotInfo FN_REDLINE_SHOW
-{
- Slotname [ en-US ] = "Highlight Changes";
-};
-SfxSlotInfo FN_REFRESH_VIEW
-{
- Slotname [ en-US ] = "Restore View";
-};
-SfxSlotInfo FN_REPAGINATE
-{
- Slotname [ en-US ] = "Repaginate";
-};
-SfxSlotInfo FN_REPEAT_SEARCH
-{
- Slotname [ en-US ] = "Repeat Search";
-};
-SfxSlotInfo FN_RULER
-{
- Slotname [ en-US ] = "Ruler On/Off";
-};
-SfxSlotInfo FN_SELECT_PARA
-{
- Slotname [ en-US ] = "Select Paragraph";
-};
-SfxSlotInfo FN_SELECT_WORD
-{
- Slotname [ en-US ] = "Select Word";
-};
-SfxSlotInfo FN_SET_ADD_MODE
-{
- Slotname [ en-US ] = "MultiSelection On";
-};
-SfxSlotInfo FN_SET_EXT_MODE
-{
- Slotname [ en-US ] = "Extended Selection On";
-};
-SfxSlotInfo FN_SET_PAGE_STYLE
-{
- Slotname [ en-US ] = "Apply Page Style";
-};
-SfxSlotInfo FN_SET_SUB_SCRIPT
-{
- Slotname [ en-US ] = "Subscript";
-};
-SfxSlotInfo FN_SET_SUPER_SCRIPT
-{
- Slotname [ en-US ] = "Superscript";
-};
-SfxSlotInfo FN_SHADOWCURSOR
-{
- Slotname [ en-US ] = "Direct Cursor On/Off";
-};
-SfxSlotInfo FN_SHIFT_BACKSPACE
-{
- Slotname [ en-US ] = "Backspace";
-};
-SfxSlotInfo FN_SHOW_MULTIPLE_PAGES
-{
- Slotname [ en-US ] = "Page Preview: Multiple Pages";
-};
-SfxSlotInfo FN_SHOW_TWO_PAGES
-{
- Slotname [ en-US ] = "Page Preview: Two Pages";
-};
-SfxSlotInfo FN_SHOW_BOOKVIEW
-{
- SlotName[ en-US ] = "Book Preview";
-};
-SfxSlotInfo FN_SHRINK_FONT_SIZE
-{
- Slotname [ en-US ] = "Reduce Font";
-};
-SfxSlotInfo FN_SORTING_DLG
-{
- Slotname [ en-US ] = "Sort";
-};
-SfxSlotInfo FN_START_DOC_DIRECT
-{
- Slotname [ en-US ] = "Directly to Document Begin";
-};
-SfxSlotInfo FN_START_OF_COLUMN
-{
- Slotname [ en-US ] = "To Column Begin";
-};
-SfxSlotInfo FN_START_OF_DOCUMENT
-{
- Slotname [ en-US ] = "To Document Begin";
-};
-SfxSlotInfo FN_START_OF_DOCUMENT_SEL
-{
- Slotname [ en-US ] = "Select to Document Begin";
-};
-SfxSlotInfo FN_START_OF_LINE
-{
- Slotname [ en-US ] = "To Line Begin";
-};
-SfxSlotInfo FN_START_OF_LINE_SEL
-{
- Slotname [ en-US ] = "Select to Begin of Line";
-};
-SfxSlotInfo FN_START_OF_NEXT_COLUMN
-{
- Slotname [ en-US ] = "To Begin of Next Column";
-};
-SfxSlotInfo FN_START_OF_NEXT_PAGE
-{
- Slotname [ en-US ] = "To Begin of Next Page";
-};
-SfxSlotInfo FN_START_OF_NEXT_PAGE_SEL
-{
- Slotname [ en-US ] = "Select to Begin of Next Page";
-};
-SfxSlotInfo FN_START_OF_PAGE
-{
- Slotname [ en-US ] = "To Page Begin";
-};
-SfxSlotInfo FN_START_OF_PAGE_SEL
-{
- Slotname [ en-US ] = "Select to Page Begin";
-};
-SfxSlotInfo FN_START_OF_PARA
-{
- Slotname [ en-US ] = "To Paragraph Begin";
-};
-SfxSlotInfo FN_START_OF_PARA_SEL
-{
- Slotname [ en-US ] = "Select to Paragraph Begin";
-};
-SfxSlotInfo FN_START_OF_PREV_COLUMN
-{
- Slotname [ en-US ] = "To Begin of Previous Column";
-};
-SfxSlotInfo FN_START_OF_PREV_PAGE
-{
- Slotname [ en-US ] = "To Begin of Previous Page";
-};
-SfxSlotInfo FN_START_OF_PREV_PAGE_SEL
-{
- Slotname [ en-US ] = "Select to Begin of Previous Page";
-};
-SfxSlotInfo FN_START_TABLE
-{
- Slotname [ en-US ] = "To Table Begin";
-};
-SfxSlotInfo FN_STAT_PAGE
-{
- Slotname [ en-US ] = "Page Number";
-};
-SfxSlotInfo FN_STAT_SELMODE
-{
- Slotname [ en-US ] = "Selection Mode";
-};
-SfxSlotInfo FN_STAT_TEMPLATE
-{
- Slotname [ en-US ] = "Page Style";
-};
-SfxSlotInfo FN_TABLE_ADJUST_CELLS
-{
- Slotname [ en-US ] = "Optimal Column Width";
-};
-SfxSlotInfo FN_TABLE_AUTOSUM
-{
- Slotname [ en-US ] = "Sum";
-};
-SfxSlotInfo FN_TABLE_BALANCE_CELLS
-{
- Slotname [ en-US ] = "Space Columns Equally";
-};
-SfxSlotInfo FN_TABLE_BALANCE_ROWS
-{
- Slotname [ en-US ] = "Space Rows Equally ";
-};
-SfxSlotInfo FN_TABLE_DELETE_COL
-{
- Slotname [ en-US ] = "Delete Column";
-};
-SfxSlotInfo FN_TABLE_DELETE_ROW
-{
- Slotname [ en-US ] = "Delete Row";
-};
-SfxSlotInfo FN_TABLE_INSERT_COL
-{
- Slotname [ en-US ] = "Insert Column";
-};
-SfxSlotInfo FN_TABLE_INSERT_ROW
-{
- Slotname [ en-US ] = "Insert Row";
-};
-SfxSlotInfo FN_TABLE_MERGE_CELLS
-{
- Slotname [ en-US ] = "Merge Cells";
-};
-SfxSlotInfo FN_TABLE_MERGE_TABLE
-{
- Slotname [ en-US ] = "Merge Table";
-};
-SfxSlotInfo FN_FORMAT_APPLY_HEAD1
-{
- Slotname [ en-US ] = "Apply Style Heading 1";
-};
-SfxSlotInfo FN_FORMAT_APPLY_HEAD2
-{
- Slotname [ en-US ] = "Apply Style Heading 2";
-};
-SfxSlotInfo FN_FORMAT_APPLY_HEAD3
-{
- Slotname [ en-US ] = "Apply Style Heading 3";
-};
-SfxSlotInfo FN_FORMAT_APPLY_DEFAULT
-{
- Slotname [ en-US ] = "Apply Style Default";
-};
-SfxSlotInfo FN_FORMAT_APPLY_TEXTBODY
-{
- Slotname [ en-US ] = "Apply Style Textbody";
-};
-SfxSlotInfo FN_TABLE_MODE_FIX
-{
- Slotname [ en-US ] = "Table: Fixed";
-};
-SfxSlotInfo FN_TABLE_MODE_FIX_PROP
-{
- Slotname [ en-US ] = "Table: Fixed, Proportional";
-};
-SfxSlotInfo FN_TABLE_MODE_VARIABLE
-{
- Slotname [ en-US ] = "Table: Variable";
-};
-SfxSlotInfo FN_TABLE_OPTIMAL_HEIGHT
-{
- Slotname [ en-US ] = "Optimal Row Height";
-};
-SfxSlotInfo FN_TABLE_SELECT_ALL
-{
- Slotname [ en-US ] = "Select Table";
-};
-SfxSlotInfo FN_TABLE_SELECT_COL
-{
- Slotname [ en-US ] = "Select Column";
-};
-SfxSlotInfo FN_TABLE_SELECT_ROW
-{
- Slotname [ en-US ] = "Select Rows";
-};
-SfxSlotInfo FN_TABLE_SET_READ_ONLY_CELLS
-{
- Slotname [ en-US ] = "Protect Cells";
-};
-SfxSlotInfo FN_TABLE_SET_ROW_HEIGHT
-{
- Slotname [ en-US ] = "Row Height";
-};
-SfxSlotInfo FN_TABLE_SPLIT_CELLS
-{
- Slotname [ en-US ] = "Split Cells";
-};
-SfxSlotInfo FN_TABLE_SPLIT_TABLE
-{
- Slotname [ en-US ] = "Split Table";
-};
-SfxSlotInfo FN_TABLE_UNSET_READ_ONLY
-{
- Slotname [ en-US ] = "Unprotect sheet";
-};
-SfxSlotInfo FN_TABLE_UNSET_READ_ONLY_CELLS
-{
- Slotname [ en-US ] = "Unprotect cells";
-};
-SfxSlotInfo FN_TABLE_VERT_BOTTOM
-{
- Slotname [ en-US ] = "Bottom";
-};
-SfxSlotInfo FN_TABLE_VERT_CENTER
-{
- Slotname [ en-US ] = "Center ( vertical )";
-};
-SfxSlotInfo FN_TABLE_VERT_NONE
-{
- Slotname [ en-US ] = "Top";
-};
-SfxSlotInfo FN_THESAURUS_DLG
-{
- Slotname [ en-US ] = "Thesaurus";
-};
-SfxSlotInfo FN_TO_FOOTER
-{
- Slotname [ en-US ] = "To Footer";
-};
-SfxSlotInfo FN_TO_HEADER
-{
- Slotname [ en-US ] = "To Header";
-};
-SfxSlotInfo FN_TOOL_ANKER
-{
- Slotname [ en-US ] = "Change Anchor";
-};
-SfxSlotInfo FN_TOOL_ANKER_AT_CHAR
-{
- Slotname [ en-US ] = "Anchor to Character";
-};
-SfxSlotInfo FN_TOOL_ANKER_CHAR
-{
- Slotname [ en-US ] = "Anchor as Character";
-};
-SfxSlotInfo FN_TOOL_ANKER_FRAME
-{
- Slotname [ en-US ] = "Anchor To Frame";
-};
-SfxSlotInfo FN_TOOL_ANKER_PAGE
-{
- Slotname [ en-US ] = "Anchor To Page";
-};
-SfxSlotInfo FN_TOOL_ANKER_PARAGRAPH
-{
- Slotname [ en-US ] = "Anchor To Paragraph";
-};
-SfxSlotInfo FN_TOOL_GROUP
-{
- Slotname [ en-US ] = "Group";
-};
-SfxSlotInfo FN_TOOL_HIERARCHIE
-{
- Slotname [ en-US ] = "Change Position";
-};
-SfxSlotInfo FN_TOOL_UNGROUP
-{
- Slotname [ en-US ] = "Ungroup";
-};
-SfxSlotInfo FN_UNDERLINE_DOUBLE
-{
- Slotname [ en-US ] = "Double Underline ";
-};
-SfxSlotInfo FN_UPDATE_ALL
-{
- Slotname [ en-US ] = "Update All";
-};
-SfxSlotInfo FN_UPDATE_ALL_LINKS
-{
- Slotname [ en-US ] = "Update All Links";
-};
-SfxSlotInfo FN_UPDATE_CUR_TOX
-{
- Slotname [ en-US ] = "Update Index";
-};
-SfxSlotInfo FN_EDIT_CURRENT_TOX
-{
- Slotname [ en-US ] = "Edit index";
-};
-SfxSlotInfo FN_UPDATE_FIELDS
-{
- Slotname [ en-US ] = "Update Fields";
-};
-SfxSlotInfo FN_UPDATE_INPUTFIELDS
-{
- Slotname [ en-US ] = "Update Input Fields";
-};
-SfxSlotInfo FN_UPDATE_TOX
-{
- Slotname [ en-US ] = "Update Indexes";
-};
-SfxSlotInfo FN_VIEW_BOUNDS
-{
- Slotname [ en-US ] = "Text Limits";
-};
-SfxSlotInfo FN_VIEW_FIELDNAME
-{
- Slotname [ en-US ] = "Field Names On/Off";
-};
-SfxSlotInfo FN_VIEW_FIELDS
-{
- Slotname [ en-US ] = "Fields";
-};
-SfxSlotInfo FN_VIEW_GRAPHIC
-{
- Slotname [ en-US ] = "Graphics On/Off";
-};
-
-SfxSlotInfo FN_VIEW_HIDDEN_PARA
-{
- Slotname [ en-US ] = "Hidden Paragraphs";
-};
-SfxSlotInfo FN_VIEW_MARKS
-{
- Slotname [ en-US ] = "Field Shadings";
-};
-SfxSlotInfo FN_VIEW_META_CHARS
-{
- Slotname [ en-US ] = "Nonprinting Characters On/Off";
-};
-SfxSlotInfo FN_VIEW_TABLEGRID
-{
- Slotname [ en-US ] = "Table Limits";
-};
-SfxSlotInfo FN_VLINEAL
-{
- Slotname [ en-US ] = "Vertical Ruler";
-};
-SfxSlotInfo FN_VSCROLLBAR
-{
- Slotname [ en-US ] = "Vertical Scroll Bar";
-};
-SfxSlotInfo FN_WRAP_ANCHOR_ONLY
-{
- Slotname [ en-US ] = "Wrap First Paragraph";
-};
-SfxSlotInfo SID_ATTR_CHAR_COLOR_BACKGROUND
-{
- Slotname [ en-US ] = "Highlighting";
-};
-SfxSlotInfo SID_ATTR_CHAR_COLOR_BACKGROUND_EXT
-{
- Slotname [ en-US ] = "Highlight Fill";
-};
-SfxSlotInfo SID_ATTR_CHAR_COLOR_EXT
-{
- Slotname [ en-US ] = "Font Color Fill";
-};
-SfxSlotInfo SID_ATTR_CHAR_COLOR2
-{
- Slotname [ en-US ] = "Font Color";
-};
-SfxSlotInfo SID_TEMPLATE_LOAD
-{
- Slotname [ en-US ] = "Load Styles";
-};
-SfxSlotInfo FN_FORMAT_COLUMN
-{
- Slotname [ en-US ] = "Columns";
-};
-SfxSlotInfo FN_INSERT_MULTI_TOX
-{
-
- Slotname [ en-US ] = "Insert Index";
-};
-SfxSlotInfo FN_INSERT_AUTH_ENTRY_DLG
-{
- Slotname [ en-US ] = "Insert Bibliography Entry";
-};
-
-SfxSlotInfo FN_EDIT_AUTH_ENTRY_DLG
-{
- Slotname [ en-US ] = "Edit Bibliography Entry";
-};
-
-SfxSlotInfo FN_REMOVE_CUR_TOX
-{
- Slotname [ en-US ] = "Delete index";
-};
-SfxSlotInfo FN_EDIT_HYPERLINK
-{
- Slotname [ en-US ] = "Edit hyperlink";
-};
-SfxSlotInfo FN_SET_MODOPT_TBLNUMFMT
-{
- Slotname [ en-US ] = "Number Recognition";
-};
-SfxSlotInfo FN_UPDATE_CHARTS
-{
- Slotname [ en-US ] = "Update Charts";
-};
-SfxSlotInfo FN_NAME_SHAPE
-{
- Slotname [ en-US ] = "Name...";
-};
-// #i68101#
-SfxSlotInfo FN_TITLE_DESCRIPTION_SHAPE
-{
- Slotname [ en-US ] = "Description...";
-};
-SfxSlotInfo FN_CLOSE_PAGEPREVIEW
-{
- Slotname [ en-US ] = "Close Preview";
-};
-
-SfxSlotInfo FN_TO_FOOTNOTE_AREA
-{
- Slotname [ en-US ] = "Edit Footnote/Endnote";
-};
-
-SfxSlotInfo FN_READONLY_SELECTION_MODE
-{
- Slotname [ en-US ] = "Select Text";
-};
-
-SfxSlotInfo FN_TABLE_ROW_SPLIT
-{
- Slotname [ en-US ] = "Break across page and columns";
-};
-SfxSlotInfo FN_WORDCOUNT_DIALOG
-{
- SlotName[ en-US ] = "Word Count";
-};
-SfxSlotInfo FN_TABLE_DELETE_TABLE
-{
- SlotName [ en-US ] = "Delete table";
-};
-SfxSlotInfo FN_TABLE_SELECT_CELL
-{
- SlotName [ en-US ] = "Select cell";
-};
-SfxSlotInfo FN_CONVERT_TEXT_TO_TABLE
-{
- SlotName [ en-US ] = "Convert Text to Table";
-};
-
-SfxSlotInfo FN_CONVERT_TABLE_TO_TEXT
-{
- SlotName [ en-US ] = "Convert Table to Text";
-};
-SfxSlotInfo FN_TABLE_SORT_DIALOG
-{
- SlotName [ en-US ] = "Sort";
-};
-SfxSlotInfo FN_TABLE_HEADLINE_REPEAT
-{
- SlotName [ en-US ] = "Heading Rows Repeat";
-};
-SfxSlotInfo FN_XFORMS_DESIGN_MODE
-{
- SlotName[ en-US ] = "Design Mode On/Off";
-};
-SfxSlotInfo FN_XFORMS_INIT
-{
- SlotName[ en-US ] = "XML Form Document";
-};
-SfxSlotInfo FN_NUM_CONTINUE
-{
- SlotName[ en-US ] = "Continue previous numbering";
-};
-
-SfxSlotInfo FN_INSERT_RLM
-{
- SlotName[ en-US ] = "Right-to-left mark";
-};
-SfxSlotInfo FN_INSERT_LRM
-{
- SlotName[ en-US ] = "Left-to-right mark";
-};
-SfxSlotInfo FN_INSERT_ZWSP
-{
- SlotName[ en-US ] = "No-width no break";
-};
-SfxSlotInfo FN_INSERT_ZWNBSP
-{
- SlotName[ en-US ] = "No-width optional break";
-};
-SfxSlotInfo FN_VIEW_NOTES
-{
- Slotname [ en-US ] = "Notes";
-};
-
diff --git a/sw/source/core/SwNumberTree/SwNumberTree.cxx b/sw/source/core/SwNumberTree/SwNumberTree.cxx
index 4d5f06ff0b8f..05c30aa97f5b 100644
--- a/sw/source/core/SwNumberTree/SwNumberTree.cxx
+++ b/sw/source/core/SwNumberTree/SwNumberTree.cxx
@@ -127,19 +127,6 @@ SwNumberTreeNode * SwNumberTreeNode::GetRoot() const
return pResult;
}
-SwNumberTreeNode * SwNumberTreeNode::GetFirstChild() const
-{
- SwNumberTreeNode * pResult = 0;
-
- tSwNumberTreeChildren::iterator aIt = mChildren.begin();
-
- if (aIt != mChildren.end() )
- pResult = *aIt;
-
- return pResult;
-}
-
-
void SwNumberTreeNode::ClearObsoletePhantoms()
{
tSwNumberTreeChildren::iterator aIt = mChildren.begin();
diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx
index 705e0026b767..c2a6d011be85 100644
--- a/sw/source/core/access/accportions.cxx
+++ b/sw/source/core/access/accportions.cxx
@@ -259,12 +259,6 @@ sal_Bool SwAccessiblePortionData::IsReadOnlyPortion( size_t nPortionNo ) const
return IsPortionAttrSet(nPortionNo, PORATTR_READONLY);
}
-sal_Bool SwAccessiblePortionData::IsGrayPortion( size_t nPortionNo ) const
-{
- return IsPortionAttrSet(nPortionNo, PORATTR_GRAY);
-}
-
-
sal_Bool SwAccessiblePortionData::IsGrayPortionType( USHORT nType ) const
{
// gray portions?
diff --git a/sw/source/core/access/accportions.hxx b/sw/source/core/access/accportions.hxx
index 64bd308fbbd6..807070a6573d 100644
--- a/sw/source/core/access/accportions.hxx
+++ b/sw/source/core/access/accportions.hxx
@@ -90,7 +90,6 @@ class SwAccessiblePortionData : public SwPortionHandler
sal_Bool IsPortionAttrSet( size_t nPortionNo, sal_uInt8 nAttr ) const;
sal_Bool IsSpecialPortion( size_t nPortionNo ) const;
sal_Bool IsReadOnlyPortion( size_t nPortionNo ) const;
- sal_Bool IsGrayPortion( size_t nPortionNo ) const;
sal_Bool IsGrayPortionType( USHORT nType ) const;
// helper method for GetEditableRange(...):
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 9af115269cd8..9cf698a3a709 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -3303,19 +3303,6 @@ String SwCrsrShell::GetCrsrDescr() const
return aResult;
}
-SwRect SwCrsrShell::GetRectOfCurrentChar()
-{
- SwCntntFrm* pFrm = pCurCrsr->GetCntntNode()->GetFrm( 0, pCurCrsr->GetPoint(), FALSE );
- SwRect aRet;
- SwCrsrMoveState aTmpState( MV_NONE );
- aTmpState.bRealHeight = TRUE;
- pFrm->GetCharRect( aRet, *pCurCrsr->GetPoint(), &aTmpState );
- //const SwTwips nRealHeight = aTmpState.aRealHeight.Y();
- if (aTmpState.aRealHeight.X() != 0)
- aRet.Top(aRet.Top() + aTmpState.aRealHeight.X());
- return aRet;
-}
-
// SMARTTAGS
void lcl_FillRecognizerData( uno::Sequence< rtl::OUString >& rSmartTagTypes,
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 249500b95f98..c11092c5fd9d 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -34,9 +34,7 @@
#include <editeng/lrspitem.hxx>
#include <editeng/adjitem.hxx>
#include <editeng/brkitem.hxx>
-#ifndef _SVX_SVDOBJ_HXX
#include <svx/svdobj.hxx>
-#endif
#include <crsrsh.hxx>
#include <doc.hxx>
#include <pagefrm.hxx>
@@ -719,7 +717,8 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext,
SwFmtFld* pFmtFld = new SwFmtFld( SwDateTimeField(
(SwDateTimeFieldType*)pDoc->GetSysFldType( RES_DATETIMEFLD ) ) );
- pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex() );
+ pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex(),
+ pDoc->IsClipBoard() );
pTxtFld->ChgTxtNode( pTNd );
}
diff --git a/sw/source/core/crsr/crstrvl1.cxx b/sw/source/core/crsr/crstrvl1.cxx
index fcdcd99241f4..53790c2ac28f 100644
--- a/sw/source/core/crsr/crstrvl1.cxx
+++ b/sw/source/core/crsr/crstrvl1.cxx
@@ -33,26 +33,30 @@
#include <viscrs.hxx>
#include <callnk.hxx>
-BOOL SwCrsrShell::IsStartWord() const
+BOOL SwCrsrShell::IsStartWord( sal_Int16 nWordType ) const
{
- return pCurCrsr->IsStartWord();
+ return pCurCrsr->IsStartWord( nWordType );
}
-BOOL SwCrsrShell::IsEndWord() const
+
+BOOL SwCrsrShell::IsEndWord( sal_Int16 nWordType ) const
{
- return pCurCrsr->IsEndWord();
+ return pCurCrsr->IsEndWord( nWordType );
}
+
+BOOL SwCrsrShell::IsInWord( sal_Int16 nWordType ) const
+{
+ return pCurCrsr->IsInWord( nWordType );
+}
+
BOOL SwCrsrShell::IsStartSentence() const
{
return pCurCrsr->IsStartEndSentence( false );
}
+
BOOL SwCrsrShell::IsEndSentence() const
{
return pCurCrsr->IsStartEndSentence( true );
}
-BOOL SwCrsrShell::IsInWord() const
-{
- return pCurCrsr->IsInWord();
-}
BOOL SwCrsrShell::GoStartWord()
@@ -94,4 +98,8 @@ BOOL SwCrsrShell::SelectWord( const Point* pPt )
return pCurCrsr->SelectWord( pPt );
}
+BOOL SwCrsrShell::ExpandToSentenceBorders()
+{
+ return pCurCrsr->ExpandToSentenceBorders();
+}
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index aeaeeeb300bc..9fd6dd0516e9 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -144,7 +144,9 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart,
// Fuer das Ende merken wir uns die Ersetzungen und entferenen
// hinterher alle am Stringende (koenten ja 'normale' 0x7f drinstehen
BOOL bEmpty = RES_TXTATR_FIELD != pHt->Which() ||
- !((SwTxtFld*)pHt)->GetFld().GetFld()->Expand().Len();
+ !(static_cast<SwTxtFld const*>(pHt)
+ ->GetFld().GetFld()->ExpandField(
+ rNd.GetDoc()->IsClipBoard()).Len());
if ( bEmpty && nStart == nAkt )
{
rArr.Insert( nAkt, rArr.Count() );
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index d8286d007395..7637df0a67b4 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -1141,19 +1141,19 @@ short SwCursor::MaxReplaceArived()
}
-BOOL SwCursor::IsStartWord() const
+BOOL SwCursor::IsStartWord( sal_Int16 nWordType ) const
{
- return IsStartWordWT( WordType::ANYWORD_IGNOREWHITESPACES );
+ return IsStartWordWT( nWordType );
}
-BOOL SwCursor::IsEndWord() const
+BOOL SwCursor::IsEndWord( sal_Int16 nWordType ) const
{
- return IsEndWordWT( WordType::ANYWORD_IGNOREWHITESPACES );
+ return IsEndWordWT( nWordType );
}
-BOOL SwCursor::IsInWord() const
+BOOL SwCursor::IsInWord( sal_Int16 nWordType ) const
{
- return IsInWordWT( WordType::ANYWORD_IGNOREWHITESPACES );
+ return IsInWordWT( nWordType );
}
BOOL SwCursor::GoStartWord()
@@ -1401,11 +1401,11 @@ BOOL SwCursor::SelectWordWT( sal_Int16 nWordType, const Point* pPt )
}
//-----------------------------------------------------------------------------
-BOOL SwCursor::GoSentence( SentenceMoveType eMoveType )
+
+static String lcl_MaskDeletedRedlines( const SwTxtNode* pTxtNd )
{
- BOOL bRet = FALSE;
- const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
- if( pTxtNd && pBreakIt->GetBreakIter().is() )
+ String aRes;
+ if (pTxtNd)
{
//mask deleted redlines
String sNodeText(pTxtNd->GetTxt());
@@ -1430,11 +1430,30 @@ BOOL SwCursor::GoSentence( SentenceMoveType eMoveType )
}
}
}
+ aRes = sNodeText;
+ }
+ return aRes;
+}
+
+BOOL SwCursor::GoSentence( SentenceMoveType eMoveType )
+{
+ BOOL bRet = FALSE;
+ const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
+ if( pTxtNd && pBreakIt->GetBreakIter().is() )
+ {
+ String sNodeText( lcl_MaskDeletedRedlines( pTxtNd ) );
+
SwCrsrSaveState aSave( *this );
xub_StrLen nPtPos = GetPoint()->nContent.GetIndex();
switch ( eMoveType )
{
- case END_SENT:
+ case START_SENT: /* when modifying: see also ExpandToSentenceBorders below! */
+ nPtPos = (xub_StrLen)pBreakIt->GetBreakIter()->beginOfSentence(
+ sNodeText,
+ nPtPos, pBreakIt->GetLocale(
+ pTxtNd->GetLang( nPtPos ) ));
+ break;
+ case END_SENT: /* when modifying: see also ExpandToSentenceBorders below! */
nPtPos = (xub_StrLen)pBreakIt->GetBreakIter()->endOfSentence(
sNodeText,
nPtPos, pBreakIt->GetLocale(
@@ -1451,12 +1470,6 @@ BOOL SwCursor::GoSentence( SentenceMoveType eMoveType )
;
break;
}
- case START_SENT:
- nPtPos = (xub_StrLen)pBreakIt->GetBreakIter()->beginOfSentence(
- sNodeText,
- nPtPos, pBreakIt->GetLocale(
- pTxtNd->GetLang( nPtPos ) ));
- break;
case PREV_SENT:
nPtPos = (xub_StrLen)pBreakIt->GetBreakIter()->beginOfSentence(
sNodeText,
@@ -1484,6 +1497,51 @@ BOOL SwCursor::GoSentence( SentenceMoveType eMoveType )
return bRet;
}
+
+BOOL SwCursor::ExpandToSentenceBorders()
+{
+ BOOL bRes = FALSE;
+ const SwTxtNode* pStartNd = Start()->nNode.GetNode().GetTxtNode();
+ const SwTxtNode* pEndNd = End()->nNode.GetNode().GetTxtNode();
+ if (pStartNd && pEndNd && pBreakIt->GetBreakIter().is())
+ {
+ if (!HasMark())
+ SetMark();
+
+ String sStartText( lcl_MaskDeletedRedlines( pStartNd ) );
+ String sEndText( pStartNd == pEndNd? sStartText : lcl_MaskDeletedRedlines( pEndNd ) );
+
+ SwCrsrSaveState aSave( *this );
+ xub_StrLen nStartPos = Start()->nContent.GetIndex();
+ xub_StrLen nEndPos = End()->nContent.GetIndex();
+
+ nStartPos = (xub_StrLen)pBreakIt->GetBreakIter()->beginOfSentence(
+ sStartText, nStartPos,
+ pBreakIt->GetLocale( pStartNd->GetLang( nStartPos ) ) );
+ nEndPos = (xub_StrLen)pBreakIt->GetBreakIter()->endOfSentence(
+ sEndText, nEndPos,
+ pBreakIt->GetLocale( pEndNd->GetLang( nEndPos ) ) );
+
+ // it is allowed to place the PaM just behind the last
+ // character in the text thus <= ...Len
+ bool bChanged = false;
+ if (nStartPos <= pStartNd->GetTxt().Len())
+ {
+ GetMark()->nContent = nStartPos;
+ bChanged = true;
+ }
+ if (nEndPos <= pEndNd->GetTxt().Len())
+ {
+ GetPoint()->nContent = nEndPos;
+ bChanged = true;
+ }
+ if (bChanged && !IsSelOvr())
+ bRes = TRUE;
+ }
+ return bRes;
+}
+
+
BOOL SwTableCursor::LeftRight( BOOL bLeft, USHORT nCnt, USHORT /*nMode*/,
BOOL /*bVisualAllowed*/, BOOL /*bSkipHidden*/, BOOL /*bInsertCrsr*/ )
{
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 16bf730b33a7..214700c5e680 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -666,16 +666,6 @@ void SwSelPaintRects::Paint( const Rectangle& /*rRect*/ )
// nothing to do with overlays
}
-/*
- * Rectangle ist in Dokument-Koordianten !!
- * pWin != 0 -> auch wirklich malen
- * == 0 -> nur testen, ob es gemalt werden kann
- */
-
-void SwSelPaintRects::Paint( const SwRect& /*rRect*/ )
-{
- // nothing to do with overlays
-}
// check current MapMode of the shell and set possibly the static members.
// Optional set the parameters pX, pY
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 7f2b92979f57..f1ae3e241b1b 100755
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -477,6 +477,16 @@ void SwDoc::setPrinter(/*[in]*/ SfxPrinter *pP,/*[in]*/ bool bDeleteOld,/*[in]*/
delete pPrt;
pPrt = pP;
+ // our printer should always use TWIP. Don't rely on this being set in ViewShell::InitPrt, there
+ // are situations where this isn't called.
+ // #i108712# / 2010-02-26 / frank.schoenheit@sun.com
+ if ( pPrt )
+ {
+ MapMode aMapMode( pPrt->GetMapMode() );
+ aMapMode.SetMapUnit( MAP_TWIP );
+ pPrt->SetMapMode( aMapMode );
+ }
+
if ( pDrawModel && !get( IDocumentSettingAccess::USE_VIRTUAL_DEVICE ) )
pDrawModel->SetRefDevice( pPrt );
}
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index a19ece4daf66..170193778421 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1480,6 +1480,17 @@ void SwCompareData::SetRedlinesToDoc( BOOL bUseDocInfo )
pTmp->GetPoint()->nNode++;
pTmp->GetPoint()->nContent.Assign( pTmp->GetCntntNode(), 0 );
}
+ // --> mst 2010-05-17 #i101009#
+ // prevent redlines that end on structural end node
+ if (& rDoc.GetNodes().GetEndOfContent() ==
+ & pTmp->GetPoint()->nNode.GetNode())
+ {
+ pTmp->GetPoint()->nNode--;
+ SwCntntNode *const pContentNode( pTmp->GetCntntNode() );
+ pTmp->GetPoint()->nContent.Assign( pContentNode,
+ (pContentNode) ? pContentNode->Len() : 0 );
+ }
+ // <--
rDoc.DeleteRedline( *pTmp, false, USHRT_MAX );
@@ -1499,6 +1510,17 @@ void SwCompareData::SetRedlinesToDoc( BOOL bUseDocInfo )
pTmp->GetPoint()->nNode++;
pTmp->GetPoint()->nContent.Assign( pTmp->GetCntntNode(), 0 );
}
+ // --> mst 2010-05-17 #i101009#
+ // prevent redlines that end on structural end node
+ if (& rDoc.GetNodes().GetEndOfContent() ==
+ & pTmp->GetPoint()->nNode.GetNode())
+ {
+ pTmp->GetPoint()->nNode--;
+ SwCntntNode *const pContentNode( pTmp->GetCntntNode() );
+ pTmp->GetPoint()->nContent.Assign( pContentNode,
+ (pContentNode) ? pContentNode->Len() : 0 );
+ }
+ // <--
} while( pInsRing != ( pTmp = (SwPaM*)pTmp->GetNext() ));
SwRedlineData aRedlnData( nsRedlineType_t::REDLINE_INSERT, nAuthor, aTimeStamp,
aEmptyStr, 0, 0 );
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index c9ee5b00e181..31484ac303dd 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -1604,17 +1604,9 @@ bool SwDoc::DeleteAndJoinImpl( SwPaM & rPam,
}
// <--
{
- // dann eine Kopie vom Cursor erzeugen um alle Pams aus den
- // anderen Sichten aus dem Loeschbereich zu verschieben
- // ABER NICHT SICH SELBST !!
- SwPaM aDelPam( *rPam.GetMark(), *rPam.GetPoint() );
- ::PaMCorrAbs( aDelPam, *aDelPam.GetPoint() );
-
- const bool bSuccess( DeleteRangeImpl( aDelPam ) );
+ bool const bSuccess( DeleteRangeImpl( rPam ) );
if (!bSuccess)
return false;
-
- *rPam.GetPoint() = *aDelPam.GetPoint();
}
if( bJoinTxt )
@@ -1625,7 +1617,24 @@ bool SwDoc::DeleteAndJoinImpl( SwPaM & rPam,
return true;
}
-bool SwDoc::DeleteRangeImpl( SwPaM & rPam, const bool )
+bool SwDoc::DeleteRangeImpl(SwPaM & rPam, const bool)
+{
+ // move all cursors out of the deleted range.
+ // but first copy the given PaM, because it could be a cursor that
+ // would be moved!
+ SwPaM aDelPam( *rPam.GetMark(), *rPam.GetPoint() );
+ ::PaMCorrAbs( aDelPam, *aDelPam.GetPoint() );
+
+ bool const bSuccess( DeleteRangeImplImpl( aDelPam ) );
+ if (bSuccess)
+ { // now copy position from temp copy to given PaM
+ *rPam.GetPoint() = *aDelPam.GetPoint();
+ }
+
+ return bSuccess;
+}
+
+bool SwDoc::DeleteRangeImplImpl(SwPaM & rPam)
{
SwPosition *pStt = (SwPosition*)rPam.Start(), *pEnd = (SwPosition*)rPam.End();
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index ebac34bf3540..f4e80e9de52a 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -1241,13 +1241,18 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, USHORT& rTblSize,
// Eintrag in den HashTable eintragen
// Eintrag vorhanden ?
pFnd = Find( rName, ppHashTbl, rTblSize, &nPos );
+ String const value(pFld->ExpandField(IsClipBoard()));
if( pFnd )
+ {
// Eintrag in der HashTabelle aendern
- ((_HashStr*)pFnd)->aSetStr = pFld->Expand();
+ static_cast<_HashStr*>(pFnd)->aSetStr = value;
+ }
else
+ {
// neuen Eintrag einfuegen
*(ppHashTbl + nPos ) = new _HashStr( rName,
- pFld->Expand(), (_HashStr*)*(ppHashTbl + nPos));
+ value, static_cast<_HashStr *>(*(ppHashTbl + nPos)));
+ }
}
break;
}
@@ -1413,13 +1418,18 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
// Eintrag vorhanden ?
USHORT nPos;
SwHash* pFnd = Find( rName, pHashStrTbl, nStrFmtCnt, &nPos );
+ String const value(pFld->ExpandField(IsClipBoard()));
if( pFnd )
+ {
// Eintrag in der HashTabelle aendern
- ((_HashStr*)pFnd)->aSetStr = pFld->Expand();
+ static_cast<_HashStr*>(pFnd)->aSetStr = value;
+ }
else
+ {
// neuen Eintrag einfuegen
*(pHashStrTbl + nPos ) = new _HashStr( rName,
- pFld->Expand(), (_HashStr*)*(pHashStrTbl + nPos));
+ value, static_cast<_HashStr *>(*(pHashStrTbl + nPos)));
+ }
}
break;
case RES_GETEXPFLD:
@@ -2724,7 +2734,7 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
//pDstFld->ChangeFormat( rSrcFld.GetFormat() );
//pDstFld->SetLanguage( rSrcFld.GetLanguage() );
- SwField * pNewFld = rSrcFld.Copy();
+ SwField * pNewFld = rSrcFld.CopyField();
pDstFmtFld->SetFld(pNewFld);
switch( nFldWhich )
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index fe4044dd58ac..1b3d5fe6eb55 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -1084,14 +1084,10 @@ void SwDoc::InitTOXTypes()
/*-- 08.05.2009 10:07:57---------------------------------------------------
-----------------------------------------------------------------------*/
-SwDoc* SwDoc::CreateCopy() const
+SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const
{
SwDoc* pRet = new SwDoc;
//copy settings
-/*
- //aNodes( this ),
- //aUndoNodes( this ),
- mpAttrPool(new SwAttrPool(this)),*/
USHORT __FAR_DATA aRangeOfDefaults[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
@@ -1120,143 +1116,8 @@ SwDoc* SwDoc::CreateCopy() const
if( aNewDefaults.Count() )
pRet->SetDefault( aNewDefaults );
- /*
- pDfltFrmFmt( new SwFrmFmt( GetAttrPool(), sFrmFmtStr, 0 ) ),
- pEmptyPageFmt( new SwFrmFmt( GetAttrPool(), sEmptyPageStr, pDfltFrmFmt ) ),
- pColumnContFmt( new SwFrmFmt( GetAttrPool(), sColumnCntStr, pDfltFrmFmt ) ),
- pDfltCharFmt( new SwCharFmt( GetAttrPool(), sCharFmtStr, 0 ) ),
- pDfltTxtFmtColl( new SwTxtFmtColl( GetAttrPool(), sTxtCollStr ) ),
- pDfltGrfFmtColl( new SwGrfFmtColl( GetAttrPool(), sGrfCollStr ) ),
- pFrmFmtTbl( new SwFrmFmts() ),
- pCharFmtTbl( new SwCharFmts() ),
- pSpzFrmFmtTbl( new SwSpzFrmFmts() ),
- pSectionFmtTbl( new SwSectionFmts() ),
- pTblFrmFmtTbl( new SwFrmFmts() ),
- pTxtFmtCollTbl( new SwTxtFmtColls() ),
- pGrfFmtCollTbl( new SwGrfFmtColls() ),
- pBookmarkTbl( new SwBookmarks( 0, 16 ) ),
- pTOXTypes( new SwTOXTypes() ),
- pDefTOXBases( new SwDefTOXBase_Impl() ),
- pLayout( 0 ), // Rootframe des spezifischen Layouts.
- pDrawModel( 0 ),
- pUndos( new SwUndos( 0, 20 ) ),
- pUpdtFlds( new SwDocUpdtFld() ),
- pFldTypes( new SwFldTypes() ),
- pVirDev( 0 ),
- pPrt( 0 ),
- pPrtData( 0 ),
- pGlossaryDoc( 0 ),
- pOutlineRule( 0 ),
- pFtnInfo( new SwFtnInfo ),
- pEndNoteInfo( new SwEndNoteInfo ),
- pLineNumberInfo( new SwLineNumberInfo ),
- pFtnIdxs( new SwFtnIdxs ),
- pDocStat( new SwDocStat ),
- pDocShell( 0 ),
- pDocShRef( 0 ),
- pLinkMgr( new sfx2::LinkManager( 0 ) ),
- pACEWord( 0 ),
- pURLStateChgd( 0 ),
- pNumberFormatter( 0 ),
- pNumRuleTbl( new SwNumRuleTbl ),
- // --> OD 2008-03-26 #refactorlists#
- maLists(),
- maListStyleLists(),
- // <--
- pRedlineTbl( new SwRedlineTbl ),
- pAutoFmtRedlnComment( 0 ),
- pUnoCrsrTbl( new SwUnoCrsrTbl( 0, 16 ) ),
- pPgPViewPrtData( 0 ),
- pExtInputRing( 0 ),
- pLayouter( 0 ),
- // --> OD 2008-03-07 #refactorlists#
- pStyleAccess( 0 ),
- // <--
- pLayoutCache( 0 ),
- pUnoCallBack(new SwUnoCallBack(0)),
- mpGrammarContact( 0 ),
- aChartDataProviderImplRef(),
- pChartControllerHelper( 0 ),
- // --> OD 2007-10-31 #i83479#
- mpListItemsList( new tImplSortedNodeNumList() ),
- // <--
- nUndoPos( 0 ),
- nUndoSavePos( 0 ),
- nUndoCnt( 0 ),
- nUndoSttEnd( 0 ),
- nAutoFmtRedlnCommentNo( 0 ),
- nLinkUpdMode( GLOBALSETTING ),
- eFldUpdMode( AUTOUPD_GLOBALSETTING ),
- eRedlineMode((RedlineMode_t)(nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE)),
- eChrCmprType( CHARCOMPRESS_NONE ),
- mReferenceCount(0),
- mIdleBlockCount(0),
- nLockExpFld( 0 ),
- mbReadlineChecked(false),
- mbWinEncryption(sal_False),
- // --> OD 2005-02-11 #i38810#
- mbLinksUpdated( sal_False ),
- mbClipBoard( false ),
- mbColumnSelection( false ),
- // i#78591#
- mbProtectForm(false),*/
pRet->n32DummyCompatabilityOptions1 = n32DummyCompatabilityOptions1;
pRet->n32DummyCompatabilityOptions2 = n32DummyCompatabilityOptions2;
- /*
- mbStartIdleTimer(sal_False)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDoc::SwDoc" );
-
- mbGlossDoc =
- mbModified =
- mbDtor =
- mbUndo =
- mbPageNums =
- mbLoaded =
- mbUpdateExpFld =
- mbNewDoc =
- mbCopyIsMove =
- mbNoDrawUndoObj =
- mbBrowseMode =
- mbInReading =
- mbInXMLImport =
- mbUpdateTOX =
- mbInLoadAsynchron =
- mbHTMLMode =
- mbInCallModified =
- mbIsGlobalDoc =
- mbGlblDocSaveLinks =
- mbIsLabelDoc =
- mbIsAutoFmtRedline =
- mbOLEPrtNotifyPending =
- mbAllOLENotify =
- mbIsRedlineMove =
- mbInsOnlyTxtGlssry =
- mbContains_MSVBasic =
- mbKernAsianPunctuation =
-#ifndef PRODUCT
- mbXMLExport =
-#endif
- // --> OD 2006-03-21 #b6375613#
- mbApplyWorkaroundForB6375613 =
- // <--
- false;
-
- mbGroupUndo =
- mbNewFldLst =
- mbVisibleLinks =
- mbPurgeOLE =
- true;
-
- //
- // COMPATIBILITY FLAGS START
- //
-
- // Note: Any non-hidden compatibility flag should obtain its default
- // by asking SvtCompatibilityOptions, see below.
- //
- const SvtCompatibilityOptions aOptions;
- */
pRet->mbParaSpaceMax = mbParaSpaceMax ;
pRet->mbParaSpaceMaxAtPages = mbParaSpaceMaxAtPages ;
pRet->mbTabCompat = mbTabCompat ;
@@ -1286,92 +1147,16 @@ SwDoc* SwDoc::CreateCopy() const
//
// COMPATIBILITY FLAGS END
//
- /*
- pMacroTable = new SvxMacroTableDtor;
-
- mpGrammarContact = ::createGrammarContact();
-
- // Formate
- pFrmFmtTbl->Insert(pDfltFrmFmt, 0 );
- pCharFmtTbl->Insert(pDfltCharFmt, 0 );
-
- // FmtColls
- // TXT
- pTxtFmtCollTbl->Insert(pDfltTxtFmtColl, 0 );
- // GRF
- pGrfFmtCollTbl->Insert(pDfltGrfFmtColl, 0 );
-
- // PageDesc, EmptyPageFmt und ColumnFmt anlegen
- if ( !aPageDescs.Count() )
- GetPageDescFromPool( RES_POOLPAGE_STANDARD );
-
- //Leere Seite Einstellen.
- pEmptyPageFmt->SetFmtAttr( SwFmtFrmSize( ATT_FIX_SIZE ) );
- //BodyFmt fuer Spalten Einstellen.
- pColumnContFmt->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ) );
-
- _InitFieldTypes();
-
- // lege (fuer die Filter) eine Default-OutlineNumRule an
- // --> OD 2008-02-11 #newlistlevelattrs#
- pOutlineRule = new SwNumRule( String::CreateFromAscii( SwNumRule::GetOutlineRuleName() ),
- // --> OD 2008-06-06 #i89178#
- numfunc::GetDefaultPositionAndSpaceMode(),
- // <--
- OUTLINE_RULE );
- // <--
- // #115901#
- AddNumRule(pOutlineRule);
- // --> OD 2005-10-21 - counting of phantoms depends on <IsOldNumbering()>
- pOutlineRule->SetCountPhantoms( !get(IDocumentSettingAccess::OLD_NUMBERING) );
- // <--
-
- new SwTxtNode( SwNodeIndex( aUndoNodes.GetEndOfContent() ), pDfltTxtFmtColl );
- new SwTxtNode( SwNodeIndex( aNodes.GetEndOfContent() ),
- GetTxtCollFromPool( RES_POOLCOLL_STANDARD ));
-
- // den eigenen IdleTimer setzen
- aIdleTimer.SetTimeout( 600 );
- aIdleTimer.SetTimeoutHdl( LINK(this, SwDoc, DoIdleJobs) );
-
- aOLEModifiedTimer.SetTimeout( 1000 );
- aOLEModifiedTimer.SetTimeoutHdl( LINK( this, SwDoc, DoUpdateModifiedOLE ));
-
- // DBMgr anlegen
- pNewDBMgr = new SwNewDBMgr;
-
- // create TOXTypes
- ShellResource* pShellRes = ViewShell::GetShellRes();
-
- SwTOXType * pNew = new SwTOXType(TOX_CONTENT, pShellRes->aTOXContentName );
- pTOXTypes->Insert( pNew, pTOXTypes->Count() );
- pNew = new SwTOXType(TOX_INDEX, pShellRes->aTOXIndexName );
- pTOXTypes->Insert( pNew, pTOXTypes->Count() );
- pNew = new SwTOXType(TOX_USER, pShellRes->aTOXUserName );
- pTOXTypes->Insert( pNew, pTOXTypes->Count() );
- pNew = new SwTOXType(TOX_ILLUSTRATIONS, pShellRes->aTOXIllustrationsName );
- pTOXTypes->Insert( pNew, pTOXTypes->Count() );
- pNew = new SwTOXType(TOX_OBJECTS, pShellRes->aTOXObjectsName );
- pTOXTypes->Insert( pNew, pTOXTypes->Count() );
- pNew = new SwTOXType(TOX_TABLES, pShellRes->aTOXTablesName );
- pTOXTypes->Insert( pNew, pTOXTypes->Count() );
- pNew = new SwTOXType(TOX_AUTHORITIES, pShellRes->aTOXAuthoritiesName );
- pTOXTypes->Insert( pNew, pTOXTypes->Count() );
-
- {
- SfxItemSet aIgnorableParagraphItems( GetAttrPool(),
- RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1,
- 0 );
- pStyleAccess = createStyleManager( &aIgnorableParagraphItems );
- }
-
- ResetModified();
-
-*/
- pRet->ReplaceStyles( *(SwDoc*)this );
+ pRet->ReplaceStyles( * const_cast< SwDoc*>( this ));
+ SfxObjectShellRef aDocShellRef = const_cast< SwDocShell* >( GetDocShell() );
+ pRet->SetRefForDocShell( boost::addressof(aDocShellRef) );
+ SfxObjectShellRef xRetShell = new SwDocShell( pRet, SFX_CREATE_MODE_STANDARD );
+ if( bCallInitNew )
+ xRetShell->DoInitNew();
//copy content
pRet->Paste( *this );
- return pRet;
+ pRet->SetRefForDocShell( 0 );
+ return xRetShell;
}
/*-- 08.05.2009 10:52:40---------------------------------------------------
copy document content - code from SwFEShell::Paste( SwDoc* , BOOL )
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 71dc70106245..9997eabd79c3 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -914,17 +914,24 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
case POS_INSIDE:
{
- pNewRedl->PushData( *pRedl, FALSE );
if( *pRStt == *pStt )
{
- pRedl->SetStart( *pEnd, pRStt );
- // neu einsortieren
- pRedlineTbl->Remove( n );
- pRedlineTbl->Insert( pRedl, n );
- bDec = true;
+ // --> mst 2010-05-17 #i97421#
+ // redline w/out extent loops
+ if (*pStt != *pEnd)
+ // <--
+ {
+ pNewRedl->PushData( *pRedl, FALSE );
+ pRedl->SetStart( *pEnd, pRStt );
+ // re-insert
+ pRedlineTbl->Remove( n );
+ pRedlineTbl->Insert( pRedl, n );
+ bDec = true;
+ }
}
else
{
+ pNewRedl->PushData( *pRedl, FALSE );
if( *pREnd != *pEnd )
{
pNew = new SwRedline( *pRedl );
diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx
index 2b2c809c3cb2..f627870932f9 100644
--- a/sw/source/core/doc/extinput.cxx
+++ b/sw/source/core/doc/extinput.cxx
@@ -54,6 +54,9 @@ SwExtTextInput::SwExtTextInput( const SwPaM& rPam, Ring* pRing )
SwExtTextInput::~SwExtTextInput()
{
+ SwDoc *const pDoc = GetDoc();
+ if (pDoc->IsInDtor()) { return; /* #i58606# */ }
+
SwTxtNode* pTNd = GetPoint()->nNode.GetNode().GetTxtNode();
if( pTNd )
{
@@ -69,7 +72,6 @@ SwExtTextInput::~SwExtTextInput()
// damit Undo / Redlining usw. richtig funktioniert,
// muss ueber die Doc-Schnittstellen gegangen werden !!!
- SwDoc* pDoc = GetDoc();
if(eInputLanguage != LANGUAGE_DONTKNOW)
{
// --> FME 2005-02-11 #i41974# Only set language attribute
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index e762de8489e3..a3e28fc0e425 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -377,32 +377,12 @@ USHORT SwHTMLTableLayout::GetBrowseWidth( const SwDoc& rDoc )
return (USHORT)pPageFrm->Prt().Width();
}
- // Sonst versuchen wir es ueber die ViewShell
- USHORT nWidth = GetBrowseWidthByVisArea( rDoc );
- if( !nWidth )
- {
- // Und wenn das auch nicht geht, gibt es noch die ActualSize an der
- // DocShell.
- if( rDoc.GetDocShell() && GetpApp() && GetpApp()->GetDefaultDevice() )
- {
- // this case shouldn't happen because the filter always waits until
- // a view has been created
-/*
- nWidth = (USHORT)Application::GetDefaultDevice()
- ->PixelToLogic( rDoc.GetDocShell()->GetActualSize(),
- MapMode( MAP_TWIP ) ).Width();
-*/
- ASSERT( nWidth, "No browse width available" );
- }
-#ifdef DBG_UTIL
- else
- {
- // und wenn das auch nicht klappt, gibt es zur Zeit keine Breite
- ASSERT( nWidth, "No browse width available" );
- }
-#endif
- }
- return nWidth;
+ // --> OD 2010-05-12 #i91658#
+ // Assertion removed which state that no browse width is available.
+ // Investigation reveals that all calls can handle the case that no browse
+ // width is provided.
+ return GetBrowseWidthByVisArea( rDoc );
+ // <--
}
USHORT SwHTMLTableLayout::GetBrowseWidthByTabFrm(
@@ -1859,7 +1839,7 @@ BOOL SwHTMLTableLayout::Resize( USHORT nAbsAvail, BOOL bRecalc,
// weil sond die Umschaltung von relativ nach absolut nicht funktioniert.
if( pDoc->GetRootFrm() && pDoc->get(IDocumentSettingAccess::BROWSE_MODE) )
{
- USHORT nVisAreaWidth = GetBrowseWidthByVisArea( *pDoc );
+ const USHORT nVisAreaWidth = GetBrowseWidthByVisArea( *pDoc );
if( nVisAreaWidth < nAbsAvail && !FindFlyFrmFmt() )
nAbsAvail = nVisAreaWidth;
}
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index d2c979535dbb..1d387df76063 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -2061,11 +2061,19 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
// falls aEnd-1 auf keinem ContentNode steht, dann suche den vorherigen
aRg.aEnd--;
- while( (( pAktNode = (*this)[ aRg.aEnd ])->GetStartNode() &&
- !pAktNode->IsSectionNode() ) ||
- ( pAktNode->IsEndNode() &&
- ND_STARTNODE == pAktNode->pStartOfSection->GetNodeType()) )
- aRg.aEnd--;
+ // #i107142#: if aEnd is start node of a special section, do nothing.
+ // Otherwise this could lead to crash: going through all previous
+ // special section nodes and then one before the first.
+ if (aRg.aEnd.GetNode().StartOfSectionIndex() != 0)
+ {
+ while( (( pAktNode = (*this)[ aRg.aEnd ])->GetStartNode() &&
+ !pAktNode->IsSectionNode() ) ||
+ ( pAktNode->IsEndNode() &&
+ ND_STARTNODE == pAktNode->pStartOfSection->GetNodeType()) )
+ {
+ aRg.aEnd--;
+ }
+ }
aRg.aEnd++;
// wird im selben Array's verschoben, dann ueberpruefe die Einfuegepos.
diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx
index df6c8dc8c9f2..cb804b102c0e 100644
--- a/sw/source/core/docnode/swbaslnk.cxx
+++ b/sw/source/core/docnode/swbaslnk.cxx
@@ -357,17 +357,19 @@ BOOL SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfNd )
0 != (pANd = pDoc->GetNodes()[pAPos->nNode]) &&
0 != (pTblNd = pANd->FindTableNode()) )
{
- BOOL bLastGrf = !pTblNd->GetTable().DecGrfsThatResize();
+ const BOOL bLastGrf = !pTblNd->GetTable().DecGrfsThatResize();
SwHTMLTableLayout *pLayout =
pTblNd->GetTable().GetHTMLTableLayout();
if( pLayout )
{
- USHORT nBrowseWidth =
- pLayout->GetBrowseWidthByTable( *pDoc );
- if( nBrowseWidth )
+ const USHORT nBrowseWidth =
+ pLayout->GetBrowseWidthByTable( *pDoc );
+ if ( nBrowseWidth )
+ {
pLayout->Resize( nBrowseWidth, TRUE, TRUE,
bLastGrf ? HTMLTABLE_RESIZE_NOW
: 500 );
+ }
}
}
}
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 37ba5e5ced31..31c4a7dfea3e 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -457,7 +457,7 @@ BOOL lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos,
const SwField* const pFld = pAttr->GetFld().GetFld();
if (pFld)
{
- sExp += pFld->Expand();
+ sExp += pFld->ExpandField(rTNd.GetDoc()->IsClipBoard());
}
}
}
diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx
index a919da9a6515..1e4f699fa203 100644
--- a/sw/source/core/edit/edfld.cxx
+++ b/sw/source/core/edit/edfld.cxx
@@ -42,9 +42,7 @@
#include <expfld.hxx>
#include <flddat.hxx>
#include <swundo.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <swddetbl.hxx>
#include <hints.hxx>
@@ -226,7 +224,8 @@ void SwEditShell::FieldToText( SwFieldType* pType )
*pFmtFld->GetTxtFld()->GetStart() );
// Feldinhalt durch Text ersetzen
- String aEntry( pFmtFld->GetFld()->Expand() );
+ String const aEntry(
+ pFmtFld->GetFld()->ExpandField(GetDoc()->IsClipBoard()) );
pPaM->SetMark();
pPaM->Move( fnMoveForward );
GetDoc()->DeleteRange( *pPaM );
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 7af79fde80a8..32ab9fa07e94 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -1162,8 +1162,7 @@ void SwEditShell::SetExtTextInputData( const CommandExtTextInputData& rData )
void SwEditShell::TransliterateText( sal_uInt32 nType )
{
- utl::TransliterationWrapper aTrans(
- ::comphelper::getProcessServiceFactory(), nType );
+ utl::TransliterationWrapper aTrans( ::comphelper::getProcessServiceFactory(), nType );
StartAllAction();
SET_CURR_SHELL( this );
@@ -1185,6 +1184,32 @@ void SwEditShell::TransliterateText( sal_uInt32 nType )
EndAllAction();
}
+void SwEditShell::TransliterateText( const String& rModuleName )
+{
+ utl::TransliterationWrapper aTrans(::comphelper::getProcessServiceFactory(), 0 );
+ aTrans.loadModuleByImplName( rModuleName, LANGUAGE_SYSTEM );
+ StartAllAction();
+ SET_CURR_SHELL( this );
+
+ SwPaM* pCrsr = GetCrsr();
+ if( pCrsr->GetNext() != pCrsr )
+ {
+ GetDoc()->StartUndo(UNDO_EMPTY, NULL);
+ FOREACHPAM_START( this )
+
+ if( PCURCRSR->HasMark() )
+ GetDoc()->TransliterateText( *PCURCRSR, aTrans );
+
+ FOREACHPAM_END()
+ GetDoc()->EndUndo(UNDO_EMPTY, NULL);
+ }
+ else
+ GetDoc()->TransliterateText( *pCrsr, aTrans );
+
+ EndAllAction();
+}
+
+
void SwEditShell::CountWords( SwDocStat& rStat ) const
{
FOREACHPAM_START( this )
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index 02dc1de62901..d99293071048 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -136,6 +136,7 @@ class SwSpellIter : public SwLinguIter
SpellContentPositions aLastPositions;
bool bBackToStartOfSentence;
+ bool bMoveToEndOfSentence;
void CreatePortion(uno::Reference< XSpellAlternatives > xAlt,
@@ -147,7 +148,7 @@ class SwSpellIter : public SwLinguIter
const SpellContentPositions& rDeletedRedlines);
public:
SwSpellIter() :
- bBackToStartOfSentence(false) {}
+ bBackToStartOfSentence(false), bMoveToEndOfSentence(false) {}
void Start( SwEditShell *pSh, SwDocPositions eStart, SwDocPositions eEnd );
@@ -157,6 +158,7 @@ public:
void ToSentenceStart();
const ::svx::SpellPortions GetLastPortions(){ return aLastPortions;}
SpellContentPositions GetLastPositions() {return aLastPositions;}
+ void ContinueAfterThisSentence() { bMoveToEndOfSentence = true; }
};
/*************************************************************************
@@ -693,6 +695,24 @@ void SwHyphIter::InsertSoftHyph( const xub_StrLen nHyphPos )
// --------------------- Methoden der SwEditShell ------------------------
+bool SwEditShell::HasLastSentenceGotGrammarChecked() const
+{
+ bool bTextWasGrammarChecked = false;
+ if (pSpellIter)
+ {
+ ::svx::SpellPortions aLastPortions( pSpellIter->GetLastPortions() );
+ for (size_t i = 0; i < aLastPortions.size() && !bTextWasGrammarChecked; ++i)
+ {
+ // bIsGrammarError is also true if the text was only checked but no
+ // grammar error was found. (That is if a ProofreadingResult was obtained in
+ // SwDoc::Spell and in turn bIsGrammarError was set in SwSpellIter::CreatePortion)
+ if (aLastPortions[i].bIsGrammarError)
+ bTextWasGrammarChecked = true;
+ }
+ }
+ return bTextWasGrammarChecked;
+}
+
/*************************************************************************
* SwEditShell::HasConvIter
*************************************************************************/
@@ -1283,7 +1303,20 @@ sal_uInt32 lcl_CountRedlines(
/*-- 18.09.2003 15:08:20---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions, bool bIsGrammarCheck)
+
+void SwEditShell::MoveContinuationPosToEndOfCheckedSentence()
+{
+ // give hint that continuation position for spell/grammar checking is
+ // at the end of this sentence
+ if (pSpellIter)
+ {
+ pSpellIter->SetCurr( new SwPosition( *pSpellIter->GetCurrX() ) );
+ pSpellIter->ContinueAfterThisSentence();
+ }
+}
+
+
+void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions, bool bRecheck)
{
ASSERT( pSpellIter, "SpellIter missing" );
if(pSpellIter)
@@ -1300,9 +1333,14 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
if(!rLastPortions.size())
return;
- SwPaM *pCrsr = GetCrsr();
pDoc->StartUndo( UNDO_OVERWRITE, NULL );
StartAction();
+
+ SwPaM *pCrsr = GetCrsr();
+ // save cursor position (which should be at the end of the current sentence)
+ // for later restoration
+ Push();
+
sal_uInt32 nRedlinePortions = lcl_CountRedlines(rLastPortions);
if((rLastPortions.size() - nRedlinePortions) == rNewPortions.size())
{
@@ -1391,16 +1429,24 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
//set the cursor to the end of the inserted string
*pCrsr->Start() = *pCrsr->End();
++aCurrentNewPortion;
-
}
}
- //set the cursor to the end of the new sentence
+
+ // restore cursor to the end of the sentence
+ // (will work also if the sentence length has changed,
+ // since cursors get updated automatically!)
+ Pop( FALSE );
+
+ // collapse cursor to the end of the modified sentence
*pCrsr->Start() = *pCrsr->End();
- if( bIsGrammarCheck)
+ if (bRecheck)
{
//in grammar check the current sentence has to be checked again
GoStartSentence();
}
+ // set continuation position for spell/grammar checking to the end of this sentence
+ pSpellIter->SetCurr( new SwPosition( *pCrsr->Start() ) );
+
pDoc->EndUndo( UNDO_OVERWRITE, NULL );
EndAction();
}
diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx
index aa46869bca1a..182ed12d6ddd 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -203,7 +203,8 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
break;
default:
- nRet = rCalcPara.rCalc.Calculate( pFld->Expand() ).GetDouble();
+ String const value(pFld->ExpandField(pDoc->IsClipBoard()));
+ nRet = rCalcPara.rCalc.Calculate(value).GetDouble();
}
}
else
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index ec65d0644bba..c47bd63e70ad 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -437,6 +437,23 @@ BOOL SwField::IsFixed() const
return bRet;
}
+String SwField::ExpandField(bool const bInClipboard) const
+{
+ if (!bInClipboard) // #i85766# do not expand fields in clipboard documents
+ {
+ m_Cache = Expand();
+ }
+ return m_Cache;
+}
+
+SwField * SwField::CopyField() const
+{
+ SwField *const pNew = Copy();
+ // #i85766# cache expansion of source (for clipboard)
+ pNew->m_Cache = Expand();
+ return pNew;
+}
+
/*--------------------------------------------------------------------
Beschreibung: Numerierung expandieren
--------------------------------------------------------------------*/
diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx
index 0c9f8f2980bf..1d76dce43117 100644
--- a/sw/source/core/fields/postithelper.cxx
+++ b/sw/source/core/fields/postithelper.cxx
@@ -173,22 +173,6 @@ unsigned long SwPostItHelper::getPageInfo( SwRect& rPageFrm, const SwRootFrm* pR
return nRet;
}
-SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos( std::vector< SwLayoutInfo >& rInfo, SwTxtFld* pFld )
-{
- SwLayoutStatus aRet = SwPostItHelper::INVISIBLE;
- if( pFld )
- {
- SwTxtNode* pTNd = pFld->GetpTxtNode();
- if( pTNd )
- {
- SwPosition aPos( *pTNd );
- aPos.nContent.Assign( pTNd, *pFld->GetStart() );
- aRet = getLayoutInfos( rInfo, aPos );
- }
- }
- return aRet;
-}
-
SwPosition SwAnnotationItem::GetAnchorPosition() const
{
SwTxtFld* pFld = pFmtFld->GetTxtFld();
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index d6d13316a1e9..4133433702a3 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -34,6 +34,8 @@
#define _FESHVIEW_ONLY_INLINE_NEEDED
#endif
+#include <svx/sdrobjectfilter.hxx>
+#include <svx/svditer.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdouno.hxx>
#include <svx/svdoole2.hxx>
@@ -1307,197 +1309,225 @@ BOOL lcl_IsControlGroup( const SdrObject *pObj )
return bRet;
}
-BOOL SwFEShell::GotoObj( BOOL bNext, USHORT /*GOTOOBJ_...*/ eType )
+namespace
{
- if( !Imp()->HasDrawView() )
- return FALSE;
- else
+ class MarkableObjectsOnly : public ::svx::ISdrObjectFilter
{
- const SdrObject *pBest = 0,
- *pTop = 0;
-
- const long nTmp = bNext ? LONG_MAX : 0;
- Point aBestPos( nTmp, nTmp );
- Point aTopPos( nTmp, nTmp );
- Point aCurPos;
- Point aPos;
- BOOL bRet = FALSE;
- BOOL bNoDraw = 0 == (GOTOOBJ_DRAW_ANY & eType);
- BOOL bNoFly = 0 == (GOTOOBJ_FLY_ANY & eType);
-
- if( !bNoFly && bNoDraw )
+ public:
+ MarkableObjectsOnly( SdrPageView* i_pPV )
+ :m_pPV( i_pPV )
{
- SwFlyFrm *pFly = GetCurrFrm( FALSE )->FindFlyFrm();
- if( pFly )
- pBest = pFly->GetVirtDrawObj();
}
- const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- SdrPageView* pPV = Imp()->GetDrawView()->GetSdrPageView();
- if( !pBest || rMrkList.GetMarkCount() == 1 )
+ virtual bool includeObject( const SdrObject& i_rObject ) const
{
- // Ausgangspunkt bestimmen.
- SdrObjList* pList = NULL;
- if ( rMrkList.GetMarkCount() )
- {
- const SdrObject* pStartObj = rMrkList.GetMark(0)->GetMarkedSdrObj();
- if( pStartObj->ISA(SwVirtFlyDrawObj) )
- aPos = ((SwVirtFlyDrawObj*)pStartObj)->GetFlyFrm()->Frm().Pos();
- else
- aPos = pStartObj->GetSnapRect().TopLeft();
+ return m_pPV && m_pPV->GetView().IsObjMarkable( const_cast< SdrObject* >( &i_rObject ), m_pPV );
+ }
- // If an object inside a group is selected, we want to
- // iterate over the group members.
- if ( ! pStartObj->GetUserCall() )
- pList = pStartObj->GetObjList();
- }
+ private:
+ SdrPageView* m_pPV;
+ };
+}
+
+const SdrObject* SwFEShell::GetBestObject( BOOL bNext, USHORT /*GOTOOBJ_...*/ eType, BOOL bFlat, const ::svx::ISdrObjectFilter* pFilter )
+{
+ if( !Imp()->HasDrawView() )
+ return NULL;
+
+ const SdrObject *pBest = 0,
+ *pTop = 0;
+
+ const long nTmp = bNext ? LONG_MAX : 0;
+ Point aBestPos( nTmp, nTmp );
+ Point aTopPos( nTmp, nTmp );
+ Point aCurPos;
+ Point aPos;
+ BOOL bNoDraw = 0 == (GOTOOBJ_DRAW_ANY & eType);
+ BOOL bNoFly = 0 == (GOTOOBJ_FLY_ANY & eType);
+
+ if( !bNoFly && bNoDraw )
+ {
+ SwFlyFrm *pFly = GetCurrFrm( FALSE )->FindFlyFrm();
+ if( pFly )
+ pBest = pFly->GetVirtDrawObj();
+ }
+ const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
+ SdrPageView* pPV = Imp()->GetDrawView()->GetSdrPageView();
+
+ MarkableObjectsOnly aDefaultFilter( pPV );
+ if ( !pFilter )
+ pFilter = &aDefaultFilter;
+
+ if( !pBest || rMrkList.GetMarkCount() == 1 )
+ {
+ // Ausgangspunkt bestimmen.
+ SdrObjList* pList = NULL;
+ if ( rMrkList.GetMarkCount() )
+ {
+ const SdrObject* pStartObj = rMrkList.GetMark(0)->GetMarkedSdrObj();
+ if( pStartObj->ISA(SwVirtFlyDrawObj) )
+ aPos = ((SwVirtFlyDrawObj*)pStartObj)->GetFlyFrm()->Frm().Pos();
else
- {
- // If no object is selected, we check if we just entered a group.
- // In this case we want to iterate over the group members.
- aPos = GetCharRect().Center();
- const SdrObject* pStartObj = pPV ? pPV->GetAktGroup() : 0;
- if ( pStartObj && pStartObj->ISA( SdrObjGroup ) )
- pList = pStartObj->GetSubList();
- }
+ aPos = pStartObj->GetSnapRect().TopLeft();
- if ( ! pList )
- {
- // Here we are if
- // A No object has been selected and no group has been entered or
- // B An object has been selected and it is not inside a group
- pList = getIDocumentDrawModelAccess()->GetDrawModel()->GetPage( 0 );
- }
+ // If an object inside a group is selected, we want to
+ // iterate over the group members.
+ if ( ! pStartObj->GetUserCall() )
+ pList = pStartObj->GetObjList();
+ }
+ else
+ {
+ // If no object is selected, we check if we just entered a group.
+ // In this case we want to iterate over the group members.
+ aPos = GetCharRect().Center();
+ const SdrObject* pStartObj = pPV ? pPV->GetAktGroup() : 0;
+ if ( pStartObj && pStartObj->ISA( SdrObjGroup ) )
+ pList = pStartObj->GetSubList();
+ }
+
+ if ( ! pList )
+ {
+ // Here we are if
+ // A No object has been selected and no group has been entered or
+ // B An object has been selected and it is not inside a group
+ pList = getIDocumentDrawModelAccess()->GetDrawModel()->GetPage( 0 );
+ }
- ASSERT( pList, "No object list to iterate" )
+ ASSERT( pList, "No object list to iterate" )
- const ULONG nObjs = pList->GetObjCount();
- for( ULONG nObj = 0; nObj < nObjs; ++nObj )
+ SdrObjListIter aObjIter( *pList, bFlat ? IM_FLAT : IM_DEEPNOGROUPS );
+ while ( aObjIter.IsMore() )
+ {
+ SdrObject* pObj = aObjIter.Next();
+ BOOL bFlyFrm = pObj->ISA(SwVirtFlyDrawObj);
+ if( ( bNoFly && bFlyFrm ) ||
+ ( bNoDraw && !bFlyFrm ) ||
+ ( eType == GOTOOBJ_DRAW_SIMPLE && lcl_IsControlGroup( pObj ) ) ||
+ ( eType == GOTOOBJ_DRAW_CONTROL && !lcl_IsControlGroup( pObj ) ) ||
+ ( pFilter && !pFilter->includeObject( *pObj ) ) )
+ continue;
+ if( bFlyFrm )
{
- SdrObject* pObj = pList->GetObj( nObj );
- BOOL bFlyFrm = pObj->ISA(SwVirtFlyDrawObj);
- if( ( bNoFly && bFlyFrm ) ||
- ( bNoDraw && !bFlyFrm ) ||
- ( eType == GOTOOBJ_DRAW_SIMPLE && lcl_IsControlGroup( pObj ) ) ||
- ( eType == GOTOOBJ_DRAW_CONTROL && !lcl_IsControlGroup( pObj ) ) ||
- ( pPV && ! pPV->GetView().IsObjMarkable( pObj, pPV ) ) )
- continue;
- if( bFlyFrm )
+ SwVirtFlyDrawObj *pO = (SwVirtFlyDrawObj*)pObj;
+ SwFlyFrm *pFly = pO->GetFlyFrm();
+ if( GOTOOBJ_FLY_ANY != ( GOTOOBJ_FLY_ANY & eType ) )
{
- SwVirtFlyDrawObj *pO = (SwVirtFlyDrawObj*)pObj;
- SwFlyFrm *pFly = pO->GetFlyFrm();
- if( GOTOOBJ_FLY_ANY != ( GOTOOBJ_FLY_ANY & eType ) )
+ switch ( eType )
{
- switch ( eType )
- {
- case GOTOOBJ_FLY_FRM:
- if ( pFly->Lower() && pFly->Lower()->IsNoTxtFrm() )
- continue;
- break;
- case GOTOOBJ_FLY_GRF:
- if ( pFly->Lower() &&
- (pFly->Lower()->IsLayoutFrm() ||
- !((SwCntntFrm*)pFly->Lower())->GetNode()->GetGrfNode()))
- continue;
- break;
- case GOTOOBJ_FLY_OLE:
- if ( pFly->Lower() &&
- (pFly->Lower()->IsLayoutFrm() ||
- !((SwCntntFrm*)pFly->Lower())->GetNode()->GetOLENode()))
- continue;
- break;
- }
+ case GOTOOBJ_FLY_FRM:
+ if ( pFly->Lower() && pFly->Lower()->IsNoTxtFrm() )
+ continue;
+ break;
+ case GOTOOBJ_FLY_GRF:
+ if ( pFly->Lower() &&
+ (pFly->Lower()->IsLayoutFrm() ||
+ !((SwCntntFrm*)pFly->Lower())->GetNode()->GetGrfNode()))
+ continue;
+ break;
+ case GOTOOBJ_FLY_OLE:
+ if ( pFly->Lower() &&
+ (pFly->Lower()->IsLayoutFrm() ||
+ !((SwCntntFrm*)pFly->Lower())->GetNode()->GetOLENode()))
+ continue;
+ break;
}
- aCurPos = pFly->Frm().Pos();
}
- else
- aCurPos = pObj->GetCurrentBoundRect().TopLeft();
+ aCurPos = pFly->Frm().Pos();
+ }
+ else
+ aCurPos = pObj->GetCurrentBoundRect().TopLeft();
- // Sonderfall wenn ein anderes Obj auf selber Y steht.
- if( aCurPos != aPos && // nur wenn ich es nicht selber bin
- aCurPos.Y() == aPos.Y() && // ist die Y Position gleich
- (bNext? (aCurPos.X() > aPos.X()) : // liegt neben mir
- (aCurPos.X() < aPos.X())) ) // " reverse
+ // Sonderfall wenn ein anderes Obj auf selber Y steht.
+ if( aCurPos != aPos && // nur wenn ich es nicht selber bin
+ aCurPos.Y() == aPos.Y() && // ist die Y Position gleich
+ (bNext? (aCurPos.X() > aPos.X()) : // liegt neben mir
+ (aCurPos.X() < aPos.X())) ) // " reverse
+ {
+ aBestPos = Point( nTmp, nTmp );
+ SdrObjListIter aTmpIter( *pList, bFlat ? IM_FLAT : IM_DEEPNOGROUPS );
+ while ( aTmpIter.IsMore() )
{
- aBestPos = Point( nTmp, nTmp );
- for( ULONG i = 0; i < nObjs; ++i )
+ SdrObject* pTmpObj = aTmpIter.Next();
+ bFlyFrm = pTmpObj->ISA(SwVirtFlyDrawObj);
+ if( ( bNoFly && bFlyFrm ) || ( bNoDraw && !bFlyFrm ) )
+ continue;
+ if( bFlyFrm )
{
- SdrObject *pTmpObj = pList->GetObj( i );
- bFlyFrm = pTmpObj->ISA(SwVirtFlyDrawObj);
- if( ( bNoFly && bFlyFrm ) || ( bNoDraw && !bFlyFrm ) )
- continue;
- if( bFlyFrm )
- {
- SwVirtFlyDrawObj *pO = (SwVirtFlyDrawObj*)pTmpObj;
- aCurPos = pO->GetFlyFrm()->Frm().Pos();
- }
- else
- aCurPos = pTmpObj->GetCurrentBoundRect().TopLeft();
-
- if( aCurPos != aPos && aCurPos.Y() == aPos.Y() &&
- (bNext? (aCurPos.X() > aPos.X()) : // liegt neben mir
- (aCurPos.X() < aPos.X())) && // " reverse
- (bNext? (aCurPos.X() < aBestPos.X()) : // besser als Beste
- (aCurPos.X() > aBestPos.X())) ) // " reverse
- {
- aBestPos = aCurPos;
- pBest = pTmpObj;
- }
+ SwVirtFlyDrawObj *pO = (SwVirtFlyDrawObj*)pTmpObj;
+ aCurPos = pO->GetFlyFrm()->Frm().Pos();
}
- break;
- }
-
- if( (bNext? (aPos.Y() < aCurPos.Y()) : // nur unter mir
- (aPos.Y() > aCurPos.Y())) && // " reverse
- (bNext? (aBestPos.Y() > aCurPos.Y()) : // naeher drunter
- (aBestPos.Y() < aCurPos.Y())) || // " reverse
- (aBestPos.Y() == aCurPos.Y() &&
- (bNext? (aBestPos.X() > aCurPos.X()) : // weiter links
- (aBestPos.X() < aCurPos.X())))) // " reverse
-
- {
- aBestPos = aCurPos;
- pBest = pObj;
- }
+ else
+ aCurPos = pTmpObj->GetCurrentBoundRect().TopLeft();
- if( (bNext? (aTopPos.Y() > aCurPos.Y()) : // hoeher als Beste
- (aTopPos.Y() < aCurPos.Y())) || // " reverse
- (aTopPos.Y() == aCurPos.Y() &&
- (bNext? (aTopPos.X() > aCurPos.X()) : // weiter links
- (aTopPos.X() < aCurPos.X())))) // " reverse
- {
- aTopPos = aCurPos;
- pTop = pObj;
+ if( aCurPos != aPos && aCurPos.Y() == aPos.Y() &&
+ (bNext? (aCurPos.X() > aPos.X()) : // liegt neben mir
+ (aCurPos.X() < aPos.X())) && // " reverse
+ (bNext? (aCurPos.X() < aBestPos.X()) : // besser als Beste
+ (aCurPos.X() > aBestPos.X())) ) // " reverse
+ {
+ aBestPos = aCurPos;
+ pBest = pTmpObj;
+ }
}
+ break;
}
- // leider nichts gefunden
- if( (bNext? (aBestPos.X() == LONG_MAX) : (aBestPos.X() == 0)) )
- pBest = pTop;
- }
- if( pBest )
- {
- BOOL bFlyFrm = pBest->ISA(SwVirtFlyDrawObj);
- if( bFlyFrm )
+ if( (bNext? (aPos.Y() < aCurPos.Y()) : // nur unter mir
+ (aPos.Y() > aCurPos.Y())) && // " reverse
+ (bNext? (aBestPos.Y() > aCurPos.Y()) : // naeher drunter
+ (aBestPos.Y() < aCurPos.Y())) || // " reverse
+ (aBestPos.Y() == aCurPos.Y() &&
+ (bNext? (aBestPos.X() > aCurPos.X()) : // weiter links
+ (aBestPos.X() < aCurPos.X())))) // " reverse
+
{
- SwVirtFlyDrawObj *pO = (SwVirtFlyDrawObj*)pBest;
- const SwRect& rFrm = pO->GetFlyFrm()->Frm();
- SelectObj( rFrm.Pos(), 0, (SdrObject*)pBest );
- if( !ActionPend() )
- MakeVisible( rFrm );
+ aBestPos = aCurPos;
+ pBest = pObj;
}
- else
+
+ if( (bNext? (aTopPos.Y() > aCurPos.Y()) : // hoeher als Beste
+ (aTopPos.Y() < aCurPos.Y())) || // " reverse
+ (aTopPos.Y() == aCurPos.Y() &&
+ (bNext? (aTopPos.X() > aCurPos.X()) : // weiter links
+ (aTopPos.X() < aCurPos.X())))) // " reverse
{
- SelectObj( Point(), 0, (SdrObject*)pBest );
- if( !ActionPend() )
- MakeVisible( pBest->GetCurrentBoundRect() );
+ aTopPos = aCurPos;
+ pTop = pObj;
}
- CallChgLnk();
- bRet = TRUE;
}
- return bRet;
+ // leider nichts gefunden
+ if( (bNext? (aBestPos.X() == LONG_MAX) : (aBestPos.X() == 0)) )
+ pBest = pTop;
}
+
+ return pBest;
+}
+
+BOOL SwFEShell::GotoObj( BOOL bNext, USHORT /*GOTOOBJ_...*/ eType )
+{
+ const SdrObject* pBest = GetBestObject( bNext, eType );
+
+ if ( !pBest )
+ return FALSE;
+
+ BOOL bFlyFrm = pBest->ISA(SwVirtFlyDrawObj);
+ if( bFlyFrm )
+ {
+ SwVirtFlyDrawObj *pO = (SwVirtFlyDrawObj*)pBest;
+ const SwRect& rFrm = pO->GetFlyFrm()->Frm();
+ SelectObj( rFrm.Pos(), 0, (SdrObject*)pBest );
+ if( !ActionPend() )
+ MakeVisible( rFrm );
+ }
+ else
+ {
+ SelectObj( Point(), 0, (SdrObject*)pBest );
+ if( !ActionPend() )
+ MakeVisible( pBest->GetCurrentBoundRect() );
+ }
+ CallChgLnk();
+ return TRUE;
}
/*************************************************************************
diff --git a/sw/source/core/inc/SwGrammarMarkUp.hxx b/sw/source/core/inc/SwGrammarMarkUp.hxx
index ed3884a767f4..393c917bfc45 100644
--- a/sw/source/core/inc/SwGrammarMarkUp.hxx
+++ b/sw/source/core/inc/SwGrammarMarkUp.hxx
@@ -69,8 +69,6 @@ public:
/* getSentenceEnd returns the first start position of a sentence
which is greater than the given parameter */
xub_StrLen getSentenceEnd( xub_StrLen nPos );
- /* removeSentence removes all start positions in the given range */
- void removeSentence(xub_StrLen nStart, xub_StrLen nLength );
};
#endif
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 552555e925f9..e1560a230d7a 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -250,10 +250,6 @@ class SwFrm: public SwClient
friend SwFrm *SaveCntnt( SwLayoutFrm *, SwFrm* pStart = NULL );
friend void RestoreCntnt( SwFrm *, SwLayoutFrm *, SwFrm *pSibling, bool bGrow );
- //Checkt ob sich beim MakePos die Pos des Frm aendert oder nicht
- //layact.cxx
- friend BOOL CheckPos( SwFrm *pFrm );
-
#if OSL_DEBUG_LEVEL > 1
//entfernt leere SwSectionFrms aus einer Kette
friend SwFrm* SwClearDummies( SwFrm* pFrm );
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 1475a3909220..b51b2efc0a51 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1670,24 +1670,6 @@ BOOL SwLayAction::FormatLayoutFly( SwFlyFrm* pFly )
}
// OD 31.10.2002 #104100#
-// NOTE: no adjustments for vertical layout support necessary
-BOOL CheckPos( SwFrm *pFrm )
-{
- if ( !pFrm->GetValidPosFlag() )
- {
- Point aOld( pFrm->Frm().Pos() );
- pFrm->MakePos();
- if ( aOld != pFrm->Frm().Pos() )
- {
- pFrm->Frm().Pos( aOld );
- pFrm->_InvalidatePos();
- return FALSE;
- }
- }
- return TRUE;
-}
-
-// OD 31.10.2002 #104100#
// Implement vertical layout support
BOOL SwLayAction::FormatLayoutTab( SwTabFrm *pTab, BOOL bAddRect )
{
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index f912be5cb9b1..b747c4e7aaff 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -1680,62 +1680,6 @@ BOOL MA_FASTCALL lcl_InnerCalcLayout( SwFrm *pFrm,
return bRet;
}
-void MA_FASTCALL lcl_FirstTabCalc( SwTabFrm *pTab )
-{
- SWRECTFN( pTab )
- if ( !pTab->IsFollow() && !pTab->GetTable()->IsTblComplex() )
- {
- SwLayoutFrm* pRow = (SwLayoutFrm*)pTab->Lower();
- // --> FME 2006-07-17 #134526# TabFrm without a lower? Better we check
- // it before crashing. However, I still don't know how this can happen!
- while ( pRow )
- {
- SwLayoutFrm *pCell = (SwLayoutFrm*)pRow->Lower();
- SwFrm *pCnt = pCell->Lower();
- // --> OD 2006-11-08 #i70641# - make code robust
- if ( pCnt )
- {
- pCnt->Calc();
- const long nCellHeight = (pCell->Frm().*fnRect->fnGetHeight)();
- const long nCellY = (pCell->Frm().*fnRect->fnGetTop)()-1;
- const long nCntHeight = (pCnt->Frm().*fnRect->fnGetHeight)();
- const long nCntY = (pCnt->Frm().*fnRect->fnGetTop)()-1;
- if ( 0 != (pCell = (SwLayoutFrm*)pCell->GetNext()) )
- {
- do
- {
- (pCell->Frm().*fnRect->fnSetTopAndHeight)( nCellY, nCellHeight );
- (pCell->Prt().*fnRect->fnSetHeight)( nCellHeight );
- pCell->_InvalidateAll();
-
- pCnt = pCell->Lower();
- if ( pCnt )
- {
- (pCnt->Frm().*fnRect->fnSetTopAndHeight)(nCntY, nCntHeight);
- (pCnt->Prt().*fnRect->fnSetHeight)( nCntHeight );
- pCnt->_InvalidateAll();
- }
-
- pCell = (SwLayoutFrm*)pCell->GetNext();
- } while ( pCell );
- }
-
- SwTwips nRowTop = (pRow->Frm().*fnRect->fnGetTop)();
- SwTwips nUpBot = (pTab->GetUpper()->Frm().*fnRect->fnGetBottom)();
- if( (*fnRect->fnYDiff)( nUpBot, nRowTop ) < 0 )
- break;
- }
- // <--
- pRow = (SwLayoutFrm*)pRow->GetNext();
- }
- }
- SwFrm *pUp = pTab->GetUpper();
- long nBottom = (pUp->*fnRect->fnGetPrtBottom)();
- if ( pTab->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
- nBottom += pUp->Grow( LONG_MAX, TRUE );
- lcl_CalcLowers( (SwLayoutFrm*)pTab->Lower(), pTab, LONG_MAX, false );
-}
-
void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom )
{
// --> OD 2004-10-05 #i26945# - For correct appliance of the 'straightforward
@@ -2146,17 +2090,13 @@ void SwTabFrm::MakeAll()
if ( !bValidSize || !bValidPrtArea )
{
- // HB #i101593# no optimization as it leeds to not layouting certain nested tables
- // const BOOL bOptLower = (Frm().*fnRect->fnGetHeight)() == 0;
- const BOOL bOptLower = FALSE;
-
const long nOldPrtWidth = (Prt().*fnRect->fnGetWidth)();
const long nOldFrmWidth = (Frm().*fnRect->fnGetWidth)();
const Point aOldPrtPos = (Prt().*fnRect->fnGetPos)();
Format( pAttrs );
SwHTMLTableLayout *pLayout = GetTable()->GetHTMLTableLayout();
- if ( /*!bOptLower &&*/ pLayout &&
+ if ( pLayout &&
((Prt().*fnRect->fnGetWidth)() != nOldPrtWidth ||
(Frm().*fnRect->fnGetWidth)() != nOldFrmWidth) )
{
@@ -2167,100 +2107,8 @@ void SwTabFrm::MakeAll()
pAccess= new SwBorderAttrAccess( SwFrm::GetCache(), this );
pAttrs = pAccess->Get();
}
- if ( !bOptLower && aOldPrtPos != (Prt().*fnRect->fnGetPos)() )
+ if ( aOldPrtPos != (Prt().*fnRect->fnGetPos)() )
aNotify.SetLowersComplete( FALSE );
-
- if ( bOptLower && Lower() )
- {
- //MA 24. May. 95: Optimierungsversuch!
- //Ganz nigel nagel neu das Teil. Damit wir nicht n-fach
- //MakeAll'en formatieren wir flugs den Inhalt.
- //Das erste Format mussten wir allerdings abwarten, damit
- //die Breiten Stimmen!
- //MA: Fix, Kein Calc wenn evtl. noch Seitengebunde Flys
- //an den Cntnt haengen (siehe frmtool.cxx, ~SwCntntNotify).
- SwDoc *pDoc = GetFmt()->GetDoc();
- if ( !pDoc->GetSpzFrmFmts()->Count() ||
- pDoc->IsLoaded() || pDoc->IsNewDoc() )
- {
- //MA 28. Nov. 95: Und wieder ein Trick, gleich mal sehen
- //ob ein Rueckfluss lohnt.
- if ( bMoveable && !GetPrev() )
- {
- GetLeaf( MAKEPAGE_NONE, FALSE ); //setzt das BackMoveJump
- if ( SwFlowFrm::IsMoveBwdJump() )
- {
- BOOL bDummy;
- SwFtnBossFrm *pOldBoss = bFtnsInDoc ?
- FindFtnBossFrm( TRUE ) : 0;
- const BOOL bOldPrev = GetPrev() != 0;
- if ( MoveBwd( bDummy ) )
- {
- SWREFRESHFN( this )
- bMovedBwd = TRUE;
- if ( bFtnsInDoc )
- MoveLowerFtns( 0, pOldBoss, 0, TRUE );
-
- long nOldTop = (Frm().*fnRect->fnGetTop)();
- MakePos();
- if( nOldTop != (Frm().*fnRect->fnGetTop)() )
- {
- SwHTMLTableLayout *pHTMLLayout =
- GetTable()->GetHTMLTableLayout();
- if( pHTMLLayout )
- {
- delete pAccess;
- bCalcLowers |= pHTMLLayout->Resize(
- pHTMLLayout->GetBrowseWidthByTabFrm(
- *this ), FALSE );
- pAccess= new SwBorderAttrAccess(
- SwFrm::GetCache(), this );
- pAttrs = pAccess->Get();
- }
- }
-
- if ( bOldPrev != (0 != GetPrev()) )
- {
- //Abstand nicht vergessen!
- bValidPrtArea = FALSE;
- Format( pAttrs );
- }
- if ( bKeep && KEEPTAB )
- {
- // --> OD 2005-09-28 #b6329202#
- // Consider case that table is inside another
- // table, because it has to be avoided, that
- // superior table is formatted.
- // Thus, find next content, table or section
- // and, if a section is found, get its first
- // content.
-// SwFrm *pNxt = FindNextCnt();
-// // FindNextCnt geht ggf. in einen Bereich
-// // hinein, in eine Tabelle allerdings auch
-// if( pNxt && pNxt->IsInTab() )
-// pNxt = pNxt->FindTabFrm();
-// if ( pNxt )
-// {
-// pNxt->Calc();
-// if ( !GetNext() )
-// bValidPos = FALSE;
-// }
- if ( 0 != lcl_FormatNextCntntForKeep( this ) &&
- !GetNext() )
- {
- bValidPos = FALSE;
- }
- // <--
- }
- }
- }
- }
- ::lcl_FirstTabCalc( this );
- bValidSize = bValidPrtArea = FALSE;
- Format( pAttrs );
- aNotify.SetLowersComplete( TRUE );
- }
- }
}
//Wenn ich der erste einer Kette bin koennte ich mal sehen ob
diff --git a/sw/source/core/swg/SwXMLSectionList.cxx b/sw/source/core/swg/SwXMLSectionList.cxx
index 69c77ad77226..a12693b8f72a 100644
--- a/sw/source/core/swg/SwXMLSectionList.cxx
+++ b/sw/source/core/swg/SwXMLSectionList.cxx
@@ -68,18 +68,22 @@ SvXMLImportContext *SwXMLSectionList::CreateContext(
{
SvXMLImportContext *pContext = 0;
- if (nPrefix == XML_NAMESPACE_OFFICE && IsXMLToken ( rLocalName, XML_BODY ) ||
- nPrefix == XML_NAMESPACE_TEXT &&
- (IsXMLToken ( rLocalName, XML_P ) ||
- IsXMLToken ( rLocalName, XML_H ) ||
- IsXMLToken ( rLocalName, XML_A ) ||
- IsXMLToken ( rLocalName, XML_SPAN ) ||
- IsXMLToken ( rLocalName, XML_SECTION ) ||
- IsXMLToken ( rLocalName, XML_INDEX_BODY ) ||
- IsXMLToken ( rLocalName, XML_INDEX_TITLE )||
- IsXMLToken ( rLocalName, XML_INSERTION ) ||
- IsXMLToken ( rLocalName, XML_DELETION ) ) )
+ if(( nPrefix == XML_NAMESPACE_OFFICE && IsXMLToken ( rLocalName, XML_BODY )) ||
+ ( nPrefix == XML_NAMESPACE_TEXT &&
+ (IsXMLToken ( rLocalName, XML_P ) ||
+ IsXMLToken ( rLocalName, XML_H ) ||
+ IsXMLToken ( rLocalName, XML_A ) ||
+ IsXMLToken ( rLocalName, XML_SPAN ) ||
+ IsXMLToken ( rLocalName, XML_SECTION ) ||
+ IsXMLToken ( rLocalName, XML_INDEX_BODY ) ||
+ IsXMLToken ( rLocalName, XML_INDEX_TITLE )||
+ IsXMLToken ( rLocalName, XML_INSERTION ) ||
+ IsXMLToken ( rLocalName, XML_DELETION ) )
+ )
+ )
+ {
pContext = new SvXMLSectionListContext (*this, nPrefix, rLocalName, xAttrList);
+ }
else
pContext = SvXMLImport::CreateContext( nPrefix, rLocalName, xAttrList );
return pContext;
diff --git a/sw/source/core/text/SwGrammarMarkUp.cxx b/sw/source/core/text/SwGrammarMarkUp.cxx
index 535e619e2708..cddf4519fd50 100644
--- a/sw/source/core/text/SwGrammarMarkUp.cxx
+++ b/sw/source/core/text/SwGrammarMarkUp.cxx
@@ -136,21 +136,6 @@ void SwGrammarMarkUp::setSentence( xub_StrLen nStart )
maSentence.insert( pIter, nStart );
}
-void SwGrammarMarkUp::removeSentence(xub_StrLen nStart, xub_StrLen nLength )
-{
- std::vector< xub_StrLen >::iterator pIter = maSentence.begin();
- while( pIter != maSentence.end() && *pIter < nStart )
- ++pIter;
- if( nLength == STRING_LEN )
- nStart = STRING_LEN;
- else
- nStart += nLength;
- std::vector< xub_StrLen >::iterator pLast = pIter;
- while( pLast != maSentence.end() && *pLast < nStart )
- ++pLast;
- maSentence.erase( pIter, pLast );
-}
-
xub_StrLen SwGrammarMarkUp::getSentenceStart( xub_StrLen nPos )
{
if( !maSentence.size() )
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index ffcf4b53afbd..1fe2c363d70e 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1139,7 +1139,6 @@ void SwTxtPaintInfo::DrawPostIts( const SwLinePortion&, sal_Bool bScript ) const
}
}
-
void SwTxtPaintInfo::DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) const
{
SwRect aIntersect;
@@ -1169,7 +1168,6 @@ void SwTxtPaintInfo::DrawCheckBox( const SwFieldFormPortion &rPor, bool checked)
pOut->Pop();
}
}
-
/*************************************************************************
* SwTxtPaintInfo::DrawBackGround()
*************************************************************************/
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index c0643653a1d6..382c58a6f5c6 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -474,7 +474,7 @@ public:
inline void DrawBackBrush( const SwLinePortion &rPor ) const
{ /* if( pFnt->GetBackColor() ) */ _DrawBackBrush( rPor ); }
- void DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) const;
+ void DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) const;
inline void NotifyURL( const SwLinePortion &rPor ) const
{ if( URLNotify() ) _NotifyURL( rPor ); }
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 438f7c246287..34c0a9843986 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -57,6 +57,9 @@
#include "pordrop.hxx"
#include "crstate.hxx" // SwCrsrMoveState
#include <pormulti.hxx> // SwMultiPortion
+// --> OD 2010-05-05 #i111284#
+#include <numrule.hxx>
+// <--
// Nicht reentrant !!!
// wird in GetCharRect gesetzt und im UnitUp/Down ausgewertet.
@@ -143,6 +146,27 @@ void lcl_GetCharRectInsideField( SwTxtSizeInfo& rInf, SwRect& rOrig,
}
}
+// --> OD 2010-05-05 #i111284#
+namespace {
+ bool AreListLevelIndentsApplicableAndLabelAlignmentActive( const SwTxtNode& rTxtNode )
+ {
+ bool bRet( false );
+
+ if ( rTxtNode.AreListLevelIndentsApplicable() )
+ {
+ const SwNumFmt& rNumFmt =
+ rTxtNode.GetNumRule()->Get( static_cast<USHORT>(rTxtNode.GetActualListLevel()) );
+ if ( rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
+ {
+ bRet = true;
+ }
+ }
+
+ return bRet;
+ }
+} // end of anonymous namespace
+// <--
+
/*************************************************************************
* SwTxtMargin::CtorInitTxtMargin()
*************************************************************************/
@@ -156,7 +180,9 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
const SvxLRSpaceItem &rSpace = pFrm->GetTxtNode()->GetSwAttrSet().GetLRSpace();
// --> OD 2009-09-08 #i95907#, #b6879723#
- const bool bListLevelIndentsApplicable = pFrm->GetTxtNode()->AreListLevelIndentsApplicable();
+ // --> OD 2010-05-05 #i111284#
+ const bool bListLevelIndentsApplicableAndLabelAlignmentActive(
+ AreListLevelIndentsApplicableAndLabelAlignmentActive( *(pFrm->GetTxtNode()) ) );
// <--
//
@@ -181,9 +207,10 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
nLMWithNum -
pNode->GetLeftMarginWithNum( sal_False ) -
// --> OD 2009-09-08 #i95907#, #b6879723#
+ // --> OD 2010-05-05 #i111284#
// rSpace.GetLeft() +
// rSpace.GetTxtLeft();
- ( bListLevelIndentsApplicable
+ ( bListLevelIndentsApplicableAndLabelAlignmentActive
? 0
: ( rSpace.GetLeft() - rSpace.GetTxtLeft() ) );
// <--
@@ -191,8 +218,9 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
else
{
// --> OD 2009-09-08 #i95907#, #b6879723#
+ // --> OD 2010-05-05 #i111284#
// if ( !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
- if ( bListLevelIndentsApplicable ||
+ if ( bListLevelIndentsApplicableAndLabelAlignmentActive ||
!pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
// <--
{
@@ -202,9 +230,10 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
nLMWithNum -
pNode->GetLeftMarginWithNum( sal_False ) -
// --> OD 2009-09-08 #i95907#, #b6879723#
+ // --> OD 2010-05-05 #i111284#
// rSpace.GetLeft() +
// rSpace.GetTxtLeft();
- ( bListLevelIndentsApplicable
+ ( bListLevelIndentsApplicableAndLabelAlignmentActive
? 0
: ( rSpace.GetLeft() - rSpace.GetTxtLeft() ) );
// <--
@@ -292,10 +321,11 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
nFirstLineOfs = nFLOfst;
// --> OD 2009-09-08 #i95907#, #b6879723#
+ // --> OD 2010-05-05 #i111284#
// if ( pFrm->IsRightToLeft() ||
// !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
if ( pFrm->IsRightToLeft() ||
- bListLevelIndentsApplicable ||
+ bListLevelIndentsApplicableAndLabelAlignmentActive ||
!pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
// <--
{
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 0d34140d4058..dd2c1c3a1d38 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -125,11 +125,6 @@ sal_Bool isHahChar ( xub_Unicode cCh )
|| cCh == 0x6BF );
}
-sal_Bool isTahChar ( xub_Unicode cCh )
-{
- return ( cCh == 0x637 || cCh == 0x638 || cCh == 0x69F );
-}
-
sal_Bool isAinChar ( xub_Unicode cCh )
{
return ( cCh == 0x639 || cCh == 0x63A || cCh == 0x6A0 || cCh == 0x6FC );
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index 5c1598c4db0b..0fd88876532b 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -172,6 +172,11 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
cDec = pTabStop->GetDecimal();
eAdj = pTabStop->GetAdjustment();
nNextPos = pTabStop->GetTabPos();
+ if(!bTabsRelativeToIndent && eAdj == SVX_TAB_ADJUST_DEFAULT && nSearchPos < 0)
+ {
+ //calculate default tab position of default tabs in negative indent
+ nNextPos = ( nSearchPos / nNextPos ) * nNextPos;
+ }
}
else
{
@@ -189,13 +194,8 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
}
SwTwips nCount = nSearchPos;
- // Bei negativen Werten rundet "/" auf, "%" liefert negative Reste,
- // bei positiven Werten rundet "/" ab, "%" liefert positvie Reste!
- if ( nCount < 0 )
- nCount = 0;
-
nCount /= nDefTabDist;
- nNextPos = ( nCount + 1 ) * nDefTabDist ;
+ nNextPos = nCount < 0 || (!nCount && nSearchPos <= 0)? nCount * nDefTabDist :( nCount + 1 ) * nDefTabDist ;
// --> FME 2004-09-21 #117919 Minimum tab stop width is 1 or 51 twips:
const SwTwips nMinimumTabWidth = pFrm->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT) ? 0 : 50;
// <--
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index 5cfffeaf5229..61f873b010b7 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -870,8 +870,9 @@ USHORT SwTOXAuthority::GetLevel() const
-----------------------------------------------------------------------*/
void SwTOXAuthority::_GetText( String& rTxt, String& )
{
- //
- rTxt = m_rField.GetFld()->Expand();
+ bool const isClipBoard(
+ m_rField.GetTxtFld()->GetTxtNode().GetDoc()->IsClipBoard());
+ rTxt = m_rField.GetFld()->ExpandField(isClipBoard);
}
/* -----------------21.09.99 12:50-------------------
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 4ad6c773db1d..6b1adc76fbec 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -32,6 +32,7 @@
#include <fmtfld.hxx>
#include <txtfld.hxx>
#include <docufld.hxx>
+#include <doc.hxx>
#include "reffld.hxx"
#include "ddefld.hxx"
@@ -68,7 +69,7 @@ SwFmtFld::SwFmtFld( const SwField &rFld )
SwClient( rFld.GetTyp() ),
pTxtAttr( 0 )
{
- pField = rFld.Copy();
+ pField = rFld.CopyField();
}
// #i24434#
@@ -83,7 +84,7 @@ SwFmtFld::SwFmtFld( const SwFmtFld& rAttr )
if(rAttr.GetFld())
{
rAttr.GetFld()->GetTyp()->Add(this);
- pField = rAttr.GetFld()->Copy();
+ pField = rAttr.GetFld()->CopyField();
}
}
@@ -258,9 +259,10 @@ BOOL SwFmtFld::IsProtect() const
|*
*************************************************************************/
-SwTxtFld::SwTxtFld( SwFmtFld& rAttr, xub_StrLen nStartPos )
+SwTxtFld::SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStartPos,
+ bool const bInClipboard)
: SwTxtAttr( rAttr, nStartPos )
- , m_aExpand( rAttr.GetFld()->Expand() )
+ , m_aExpand( rAttr.GetFld()->ExpandField(bInClipboard) )
, m_pTxtNode( 0 )
{
rAttr.pTxtAttr = this;
@@ -292,7 +294,8 @@ void SwTxtFld::Expand() const
ASSERT( m_pTxtNode, "SwTxtFld: where is my TxtNode?" );
const SwField* pFld = GetFld().GetFld();
- XubString aNewExpand( pFld->Expand() );
+ XubString aNewExpand(
+ pFld->ExpandField(m_pTxtNode->GetDoc()->IsClipBoard()) );
if( aNewExpand == m_aExpand )
{
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index 7d6b8959787b..45f6c5da2baf 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -289,39 +289,45 @@ void SwTxtFtn::SetNumber( const USHORT nNewNum, const XubString* pStr )
}
// Die Fussnoten duplizieren
-void SwTxtFtn::CopyFtn( SwTxtFtn *pDest ) const
+void SwTxtFtn::CopyFtn(SwTxtFtn & rDest, SwTxtNode & rDestNode) const
{
- if ( m_pStartNode && pDest->GetStartNode() )
+ if (m_pStartNode && !rDest.GetStartNode())
{
- // die Fussnoten koennen in unterschiedlichen Dokumenten stehen !!
- SwDoc* pDstDoc = pDest->m_pTxtNode->GetDoc();
+ // dest missing node section? create it here!
+ // (happens in SwTxtNode::CopyText if pDest == this)
+ rDest.MakeNewTextSection( rDestNode.GetNodes() );
+ }
+ if (m_pStartNode && rDest.GetStartNode())
+ {
+ // footnotes not necessarily in same document!
+ SwDoc *const pDstDoc = rDestNode.GetDoc();
SwNodes &rDstNodes = pDstDoc->GetNodes();
- // Wir kopieren nur den Inhalt der Sektion
+ // copy only the content of the section
SwNodeRange aRg( *m_pStartNode, 1,
*m_pStartNode->GetNode().EndOfSectionNode() );
- // Wir fuegen auf dem Ende von pDest ein, d.h. die Nodes
- // werden angehaengt. nDestLen haelt die Anzahl der CntNodes
- // in pDest _vor_ dem Kopieren.
- SwNodeIndex aStart( *(pDest->GetStartNode()) );
+ // insert at the end of rDest, i.e., the nodes are appended.
+ // nDestLen contains number of CntntNodes in rDest _before_ copy.
+ SwNodeIndex aStart( *(rDest.GetStartNode()) );
SwNodeIndex aEnd( *aStart.GetNode().EndOfSectionNode() );
ULONG nDestLen = aEnd.GetIndex() - aStart.GetIndex() - 1;
m_pTxtNode->GetDoc()->CopyWithFlyInFly( aRg, 0, aEnd, TRUE );
- // Wenn die Dest-Sektion nicht leer war, so muessen die alten
- // Nodes geloescht werden:
- // Vorher: Src: SxxxE, Dst: SnE
- // Nachher: Src: SxxxE, Dst: SnxxxE
- // und Src: SxxxE, Dst: SxxxE
+ // in case the destination section was not empty, delete the old nodes
+ // before: Src: SxxxE, Dst: SnE
+ // now: Src: SxxxE, Dst: SnxxxE
+ // after: Src: SxxxE, Dst: SxxxE
aStart++;
rDstNodes.Delete( aStart, nDestLen );
}
- // Der benutzerdefinierte String muss auch uebertragen werden.
+ // also copy user defined number string
if( GetFtn().aNumber.Len() )
- ((SwFmtFtn&)pDest->GetFtn()).aNumber = GetFtn().aNumber;
+ {
+ const_cast<SwFmtFtn &>(rDest.GetFtn()).aNumber = GetFtn().aNumber;
+ }
}
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 798d7e41602f..76560bae91d7 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1327,11 +1327,11 @@ void lcl_CopyHint( const USHORT nWhich, const SwTxtAttr * const pHt,
ASSERT( nWhich == pHt->Which(), "Falsche Hint-Id" );
switch( nWhich )
{
- // Wenn wir es mit einem Fussnoten-Attribut zu tun haben,
- // muessen wir natuerlich auch den Fussnotenbereich kopieren.
+ // copy nodesarray section with footnote content
case RES_TXTATR_FTN :
+ ASSERT(pDest, "lcl_CopyHint: no destination text node?");
static_cast<const SwTxtFtn*>(pHt)->CopyFtn(
- static_cast<SwTxtFtn*>(pNewHt));
+ *static_cast<SwTxtFtn*>(pNewHt), *pDest);
break;
// Beim Kopieren von Feldern in andere Dokumente
@@ -1535,6 +1535,13 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
xub_StrLen nTxtStartIdx = rStart.GetIndex();
xub_StrLen nDestStart = rDestStart.GetIndex(); // alte Pos merken
+ if (pDest->GetDoc()->IsClipBoard() && this->GetNum())
+ {
+ // #i111677# cache expansion of source (for clipboard)
+ pDest->m_pNumStringCache.reset(
+ new ::rtl::OUString(this->GetNumString()));
+ }
+
if( !nLen )
{
// wurde keine Laenge angegeben, dann Kopiere die Attribute
@@ -1637,6 +1644,7 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
// Del-Array fuer alle RefMarks ohne Ausdehnung
SwpHts aRefMrkArr;
+ USHORT nDeletedDummyChars(0);
//Achtung: kann ungueltig sein!!
for (USHORT n = 0; ( n < nSize ); ++n)
{
@@ -1708,31 +1716,24 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
pNewHt = MakeTxtAttr( *GetDoc(), pHt->GetAttr(),
nAttrStt, nAttrEnd );
-//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-//JP 23.04.95: erstmal so gesondert hier behandeln. Am Besten ist es
-// aber im CopyFtn wenn die pDestFtn keinen StartNode hat,
-// sich diesen dann anlegt.
-// Aber so kurz vor der BETA besser nicht anfassen.
- if( RES_TXTATR_FTN == nWhich )
- {
- SwTxtFtn* pFtn = (SwTxtFtn*)pNewHt;
- pFtn->ChgTxtNode( this );
- pFtn->MakeNewTextSection( GetNodes() );
- lcl_CopyHint( nWhich, pHt, pFtn, 0, 0 );
- pFtn->ChgTxtNode( 0 );
- }
- else
-//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- {
- lcl_CopyHint( nWhich, pHt, pNewHt, 0, pDest );
- }
+ lcl_CopyHint(nWhich, pHt, pNewHt, 0, pDest);
aArr.C40_INSERT( SwTxtAttr, pNewHt, aArr.Count() );
}
else
{
- pNewHt = pDest->InsertItem( pHt->GetAttr(), nAttrStt,
- nAttrEnd, nsSetAttrMode::SETATTR_NOTXTATRCHR );
- lcl_CopyHint( nWhich, pHt, pNewHt, pOtherDoc, pDest );
+ pNewHt = pDest->InsertItem( pHt->GetAttr(), nAttrStt - nDeletedDummyChars,
+ nAttrEnd - nDeletedDummyChars, nsSetAttrMode::SETATTR_NOTXTATRCHR );
+ if (pNewHt)
+ {
+ lcl_CopyHint( nWhich, pHt, pNewHt, pOtherDoc, pDest );
+ }
+ else if (pHt->HasDummyChar())
+ {
+ // The attribute that has failed to be copied would insert
+ // dummy char, so positions of the following attributes have
+ // to be shifted by one to compensate for that missing char.
+ ++nDeletedDummyChars;
+ }
}
if( RES_TXTATR_REFMARK == nWhich && !pEndIdx && !bCopyRefMark )
@@ -2826,6 +2827,11 @@ BOOL SwTxtNode::HasBullet() const
//i53420 added max outline parameter
XubString SwTxtNode::GetNumString( const bool _bInclPrefixAndSuffixStrings, const unsigned int _nRestrictToThisLevel ) const
{
+ if (GetDoc()->IsClipBoard() && m_pNumStringCache.get())
+ {
+ // #i111677# do not expand number strings in clipboard documents
+ return *m_pNumStringCache;
+ }
const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
if ( pRule &&
IsCountedInList() &&
@@ -3049,8 +3055,10 @@ void SwTxtNode::Replace0xFF( XubString& rTxt, xub_StrLen& rTxtStt,
rTxt.Erase( nPos, 1 );
if( bExpandFlds )
{
- const XubString aExpand( ((SwTxtFld*)pAttr)->GetFld().
- GetFld()->Expand() );
+ const XubString aExpand(
+ static_cast<SwTxtFld const*>(pAttr)->GetFld()
+ .GetFld()->ExpandField(
+ GetDoc()->IsClipBoard()));
rTxt.Insert( aExpand, nPos );
nPos = nPos + aExpand.Len();
nEndPos = nEndPos + aExpand.Len();
@@ -3197,7 +3205,9 @@ BOOL SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
{
case RES_TXTATR_FIELD:
{
- const XubString aExpand( ((SwTxtFld*)pHt)->GetFld().GetFld()->Expand() );
+ XubString const aExpand(
+ static_cast<SwTxtFld const*>(pHt)->GetFld().GetFld()
+ ->ExpandField(GetDoc()->IsClipBoard()));
if( aExpand.Len() )
{
aDestIdx++; // dahinter einfuegen;
@@ -3293,7 +3303,9 @@ const ModelToViewHelper::ConversionMap*
const SwTxtAttr* pAttr = (*pSwpHints2)[i];
if ( RES_TXTATR_FIELD == pAttr->Which() )
{
- const XubString aExpand( ((SwTxtFld*)pAttr)->GetFld().GetFld()->Expand() );
+ const XubString aExpand(
+ static_cast<SwTxtFld const*>(pAttr)->GetFld().GetFld()
+ ->ExpandField(GetDoc()->IsClipBoard()));
if ( aExpand.Len() > 0 )
{
const xub_StrLen nFieldPos = *pAttr->GetStart();
@@ -4435,6 +4447,10 @@ namespace {
if ( pNumRuleItem.GetValue().Len() > 0 )
{
mbAddTxtNodeToList = true;
+ // --> OD 2010-05-12 #i105562#
+ //
+ mrTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
+ // <--
}
}
break;
@@ -4446,10 +4462,6 @@ namespace {
dynamic_cast<const SfxStringItem&>(pItem);
ASSERT( pListIdItem.GetValue().Len() > 0,
"<HandleSetAttrAtTxtNode(..)> - empty list id attribute not excepted. Serious defect -> please inform OD." );
-// const SfxStringItem& rListIdItemOfTxtNode =
-// dynamic_cast<const SfxStringItem&>(
-// rTxtNode.GetAttr( RES_PARATR_LIST_ID ));
-// if ( pListIdItem.GetValue() != rListIdItemOfTxtNode.GetValue() )
const String sListIdOfTxtNode = rTxtNode.GetListId();
if ( pListIdItem.GetValue() != sListIdOfTxtNode )
{
@@ -4563,11 +4575,6 @@ namespace {
{
const SfxStringItem* pListIdItem =
dynamic_cast<const SfxStringItem*>(pItem);
-// const SfxStringItem& rListIdItemOfTxtNode =
-// dynamic_cast<const SfxStringItem&>(
-// mrTxtNode.GetAttr( RES_PARATR_LIST_ID ));
-// if ( pListIdItem &&
-// pListIdItem->GetValue() != rListIdItemOfTxtNode.GetValue() )
const String sListIdOfTxtNode = mrTxtNode.GetListId();
if ( pListIdItem &&
pListIdItem->GetValue() != sListIdOfTxtNode )
@@ -4972,7 +4979,9 @@ namespace {
mrTxtNode.AddToList();
}
// --> OD 2008-11-19 #i70748#
- else if ( dynamic_cast<const SfxUInt16Item &>(mrTxtNode.GetAttr( RES_PARATR_OUTLINELEVEL, FALSE )).GetValue() > 0 )
+ // --> OD 2010-05-12 #i105562#
+ else if ( mrTxtNode.GetpSwAttrSet() &&
+ dynamic_cast<const SfxUInt16Item &>(mrTxtNode.GetAttr( RES_PARATR_OUTLINELEVEL, FALSE )).GetValue() > 0 )
{
mrTxtNode.SetEmptyListStyleDueToSetOutlineLevelAttr();
}
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index ff2a40cdd9eb..ac2f281b0d90 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1043,7 +1043,8 @@ SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr,
pNew = new SwTxtINetFmt( (SwFmtINetFmt&)rNew, nStt, nEnd );
break;
case RES_TXTATR_FIELD:
- pNew = new SwTxtFld( (SwFmtFld&)rNew, nStt );
+ pNew = new SwTxtFld( static_cast<SwFmtFld &>(rNew), nStt,
+ rDoc.IsClipBoard() );
break;
case RES_TXTATR_FLYCNT:
{
diff --git a/sw/source/core/undo/SwUndoField.cxx b/sw/source/core/undo/SwUndoField.cxx
index fe189d5adf50..8a3c6c507c93 100644
--- a/sw/source/core/undo/SwUndoField.cxx
+++ b/sw/source/core/undo/SwUndoField.cxx
@@ -63,12 +63,14 @@ SwPosition SwUndoField::GetPosition()
}
SwUndoFieldFromDoc::SwUndoFieldFromDoc(const SwPosition & rPos,
- const SwField & _aOldField,
- const SwField & _aNewField,
+ const SwField & rOldField,
+ const SwField & rNewField,
SwMsgPoolItem * _pHnt, BOOL _bUpdate, SwUndoId _nId)
- : SwUndoField(rPos,_nId), pOldField(_aOldField.Copy()),
- pNewField(_aNewField.Copy()), pHnt(_pHnt),
- bUpdate(_bUpdate)
+ : SwUndoField(rPos,_nId)
+ , pOldField(rOldField.CopyField())
+ , pNewField(rNewField.CopyField())
+ , pHnt(_pHnt)
+ , bUpdate(_bUpdate)
{
ASSERT(pOldField, "No old field!");
ASSERT(pNewField, "No new field!");
diff --git a/sw/source/core/undo/unbkmk.cxx b/sw/source/core/undo/unbkmk.cxx
index 04f7ce596346..b86bdad692ac 100644
--- a/sw/source/core/undo/unbkmk.cxx
+++ b/sw/source/core/undo/unbkmk.cxx
@@ -88,23 +88,6 @@ SwRewriter SwUndoBookmark::GetRewriter() const
//----------------------------------------------------------------------
-SwUndoDelBookmark::SwUndoDelBookmark( const ::sw::mark::IMark& rBkmk )
- : SwUndoBookmark( UNDO_DELBOOKMARK, rBkmk )
-{
-}
-
-
-void SwUndoDelBookmark::Undo( SwUndoIter& rUndoIter )
-{
- SetInDoc( &rUndoIter.GetDoc() );
-}
-
-
-void SwUndoDelBookmark::Redo( SwUndoIter& rUndoIter )
-{
- ResetInDoc( &rUndoIter.GetDoc() );
-}
-
SwUndoInsBookmark::SwUndoInsBookmark( const ::sw::mark::IMark& rBkmk )
: SwUndoBookmark( UNDO_INSBOOKMARK, rBkmk )
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 347a70190006..ef39a4e18950 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -868,7 +868,15 @@ void SwUndoDelete::Redo( SwUndoIter& rUndoIter )
SetPaM( rPam );
if( pRedlSaveData )
- rDoc.DeleteRedline( rPam, false, USHRT_MAX );
+ {
+ bool bSuccess = FillSaveData(rPam, *pRedlSaveData, TRUE);
+ OSL_ENSURE(bSuccess,
+ "SwUndoDelete::Redo: used to have redline data, but now none?");
+ if (!bSuccess)
+ {
+ delete pRedlSaveData, pRedlSaveData = 0;
+ }
+ }
if( !bDelFullPara )
{
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 2c341cb53bf5..1a71a705b2fb 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1120,7 +1120,12 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM& rPam )
if (rDoc.GetDocShell() && (pRedl->GetComment() != String(::rtl::OUString::createFromAscii(""))) )
rDoc.GetDocShell()->Broadcast(SwRedlineHint(pRedl,SWREDLINE_INSERTED));
//
- rDoc.AppendRedline( pRedl, true );
+#if OSL_DEBUG_LEVEL > 0
+ bool const bSuccess =
+#endif
+ rDoc.AppendRedline( pRedl, true );
+ OSL_ENSURE(bSuccess,
+ "SwRedlineSaveData::RedlineToDoc: insert redline failed");
rDoc.SetRedlineMode_intern( eOld );
}
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index 646ffbd4c8f2..dd95d06a34b1 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -164,21 +164,6 @@ SwUndoInsert::SwUndoInsert( const SwNodeIndex& rNd )
// werden kann. Wenn ja, dann aender die Laenge und die InsPos.
// Dann wird von SwDoc::Insert kein neues Object in die Undoliste gestellt.
-BOOL SwUndoInsert::CanGrouping( const SwPosition& rInsPos, sal_Unicode cIns )
-{
- BOOL bRet = FALSE;
- if( !bIsAppend )
- {
- ++nCntnt;
- bRet = CanGrouping( rInsPos );
- --nCntnt;
- if( bRet )
- bRet = CanGrouping( cIns );
- }
- return bRet;
-}
-
-
BOOL SwUndoInsert::CanGrouping( sal_Unicode cIns )
{
if( !bIsAppend && bIsWordDelim ==
diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx
index 06bee956f95a..4c5fbca4085c 100644
--- a/sw/source/core/undo/unmove.cxx
+++ b/sw/source/core/undo/unmove.cxx
@@ -354,13 +354,3 @@ void SwUndoMove::DelFtn( const SwPaM& rRange )
}
}
-void SwUndoMove::AddTblMrgFlyHstry( SwHistory& rHstr )
-{
- if( !pHistory )
- pHistory = new SwHistory;
-
- USHORT nInsPos = nFtnStt;
- nFtnStt = nFtnStt + rHstr.Count();
- pHistory->Move( nInsPos, &rHstr );
-}
-
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 8ae8f948900f..ab5d68910769 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -39,6 +39,7 @@
#include <unotextrange.hxx>
#include <unoprnms.hxx>
#include <editeng/unoprnms.hxx>
+#include <svx/svditer.hxx>
#include <swunohelper.hxx>
#include <doc.hxx>
#include <fmtcntnt.hxx>
@@ -1052,25 +1053,34 @@ SwXShape::SwXShape(uno::Reference< uno::XInterface > & xShape) :
-----------------------------------------------------------------------*/
void SwXShape::AddExistingShapeToFmt( SdrObject& _rObj )
{
- SwXShape* pSwShape = NULL;
- uno::Reference< lang::XUnoTunnel > xShapeTunnel( _rObj.getWeakUnoShape(), uno::UNO_QUERY );
- if ( xShapeTunnel.is() )
- pSwShape = reinterpret_cast< SwXShape * >(
- sal::static_int_cast< sal_IntPtr >( xShapeTunnel->getSomething( SwXShape::getUnoTunnelId() ) ) );
- if ( pSwShape )
+ SdrObjListIter aIter( _rObj, IM_DEEPNOGROUPS );
+ while ( aIter.IsMore() )
{
- if ( pSwShape->m_bDescriptor )
- {
- SwFrmFmt* pFmt = ::FindFrmFmt( &const_cast< SdrObject& >( _rObj ) );
- if ( pFmt )
- pFmt->Add( pSwShape );
- pSwShape->m_bDescriptor = sal_False;
- }
+ SdrObject* pCurrent = aIter.Next();
+ OSL_ENSURE( pCurrent, "SwXShape::AddExistingShapeToFmt: invalid object list element!" );
+ if ( !pCurrent )
+ continue;
- if ( !pSwShape->pImpl->bInitializedPropertyNotifier )
+ SwXShape* pSwShape = NULL;
+ uno::Reference< lang::XUnoTunnel > xShapeTunnel( pCurrent->getWeakUnoShape(), uno::UNO_QUERY );
+ if ( xShapeTunnel.is() )
+ pSwShape = reinterpret_cast< SwXShape * >(
+ sal::static_int_cast< sal_IntPtr >( xShapeTunnel->getSomething( SwXShape::getUnoTunnelId() ) ) );
+ if ( pSwShape )
{
- lcl_addShapePropertyEventFactories( _rObj, *pSwShape );
- pSwShape->pImpl->bInitializedPropertyNotifier = true;
+ if ( pSwShape->m_bDescriptor )
+ {
+ SwFrmFmt* pFmt = ::FindFrmFmt( const_cast< SdrObject* >( pCurrent ) );
+ if ( pFmt )
+ pFmt->Add( pSwShape );
+ pSwShape->m_bDescriptor = sal_False;
+ }
+
+ if ( !pSwShape->pImpl->bInitializedPropertyNotifier )
+ {
+ lcl_addShapePropertyEventFactories( *pCurrent, *pSwShape );
+ pSwShape->pImpl->bInitializedPropertyNotifier = true;
+ }
}
}
}
diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx
index 44991960ac25..d0d74fa023c7 100644
--- a/sw/source/core/unocore/unoftn.cxx
+++ b/sw/source/core/unocore/unoftn.cxx
@@ -78,7 +78,9 @@ public:
, m_rThis(rThis)
, m_bIsEndnote(bIsEndnote)
, m_ListenerContainer(static_cast< ::cppu::OWeakObject* >(&rThis))
- , m_bIsDescriptor(0 == pFootnote)
+// #i111177#: unxsols4 (Sun C++ 5.9 SunOS_sparc) generates wrong code for this
+// , m_bIsDescriptor(0 == pFootnote)
+ , m_bIsDescriptor((0 == pFootnote) ? true : false)
, m_pFmtFtn(pFootnote)
{
}
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 980306be3aec..ab486b71ed04 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1659,9 +1659,14 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
aPropertyValues.Insert(pData, aPropertyValues.Count());
}
Size aSize = rFmt.GetGraphicSize();
- aSize.Width() = TWIP_TO_MM100( aSize.Width() );
- aSize.Height() = TWIP_TO_MM100( aSize.Height() );
- pData = new PropValData((void*)&aSize, SW_PROP_NAME_STR(UNO_NAME_GRAPHIC_SIZE), ::getCppuType((const awt::Size*)0));
+ // --> OD 2010-05-04 #i101131# - applying patch from CMC
+ // adjust conversion due to type mismatch between <Size> and <awt::Size>
+// aSize.Width() = TWIP_TO_MM100( aSize.Width() );
+// aSize.Height() = TWIP_TO_MM100( aSize.Height() );
+// pData = new PropValData((void*)&aSize, SW_PROP_NAME_STR(UNO_NAME_GRAPHIC_SIZE), ::getCppuType((const awt::Size*)0));
+ awt::Size aAwtSize(TWIP_TO_MM100(aSize.Width()), TWIP_TO_MM100(aSize.Height()));
+ pData = new PropValData((void*)&aAwtSize, SW_PROP_NAME_STR(UNO_NAME_GRAPHIC_SIZE), ::getCppuType((const awt::Size*)0));
+ // <--
aPropertyValues.Insert(pData, aPropertyValues.Count());
const SwFmtVertOrient* pOrient = rFmt.GetGraphicOrientation();
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index bf1df93d5d16..b7098710802b 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -494,6 +494,40 @@ String lcl_GetCellName( sal_Int32 nColumn, sal_Int32 nRow )
return sCellName;
}
+/** Find the top left or bottom right corner box in given table.
+ Consider nested lines when finding the box.
+
+ @param i_pTable the table
+
+ @param i_bTopLeft if true, find top left box, otherwise find bottom
+ right box
+ */
+
+const SwTableBox* lcl_FindCornerTableBox(const SwTableLines& rTableLines, const bool i_bTopLeft)
+{
+ bool bFirst = true;
+ const SwTableBox* pBox = 0;
+ do
+ {
+ const SwTableLines& rLines(bFirst ? rTableLines : pBox->GetTabLines());
+ bFirst = false;
+ OSL_ASSERT(rLines.Count() != 0);
+ if (rLines.Count() != 0)
+ {
+ const SwTableLine* pLine(rLines[i_bTopLeft ? 0 : rLines.Count() - 1]);
+ OSL_ASSERT(pLine);
+ const SwTableBoxes& rBoxes(pLine->GetTabBoxes());
+ OSL_ASSERT(rBoxes.Count() != 0);
+ pBox = rBoxes[i_bTopLeft ? 0 : rBoxes.Count() - 1];
+ OSL_ASSERT(pBox);
+ }
+ else
+ {
+ pBox = 0;
+ }
+ } while (pBox && !pBox->GetSttNd());
+ return pBox;
+}
/* -----------------21.11.05 14:46-------------------
@@ -3318,7 +3352,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
// hier muessen die Actions aufgehoben werden
UnoActionRemoveContext aRemoveContext(pDoc);
- SwTableBox* pTLBox = rLines[0]->GetTabBoxes()[0];
+ const SwTableBox* pTLBox = lcl_FindCornerTableBox(rLines, true);
const SwStartNode* pSttNd = pTLBox->GetSttNd();
SwPosition aPos(*pSttNd);
// Cursor in die obere linke Zelle des Ranges setzen
@@ -3326,9 +3360,9 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
pUnoCrsr->Move( fnMoveForward, fnGoNode );
pUnoCrsr->SetRemainInSection( sal_False );
- SwTableLine* pLastLine = rLines[rLines.Count() - 1];
- SwTableBoxes &rBoxes = pLastLine->GetTabBoxes();
- const SwTableBox* pBRBox = rBoxes[rBoxes.Count() -1];
+
+
+ const SwTableBox* pBRBox = lcl_FindCornerTableBox(rLines, false);
pUnoCrsr->SetMark();
pUnoCrsr->GetPoint()->nNode = *pBRBox->GetSttNd();
pUnoCrsr->Move( fnMoveForward, fnGoNode );
@@ -3514,7 +3548,7 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be
// hier muessen die Actions aufgehoben werden
UnoActionRemoveContext aRemoveContext(pDoc);
- SwTableBox* pTLBox = rLines[0]->GetTabBoxes()[0];
+ const SwTableBox* pTLBox = lcl_FindCornerTableBox(rLines, true);
const SwStartNode* pSttNd = pTLBox->GetSttNd();
SwPosition aPos(*pSttNd);
// Cursor in die obere linke Zelle des Ranges setzen
@@ -3522,11 +3556,11 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be
pUnoCrsr->Move( fnMoveForward, fnGoNode );
pUnoCrsr->SetRemainInSection( sal_False );
- SwTableLine* pLastLine = rLines[rLines.Count() - 1];
- SwTableBoxes &rBoxes = pLastLine->GetTabBoxes();
- const SwTableBox* pBRBox = rBoxes[rBoxes.Count() -1];
+ const SwTableBox* pBRBox = lcl_FindCornerTableBox(rLines, false);
pUnoCrsr->SetMark();
- pUnoCrsr->GetPoint()->nNode = *pBRBox->GetSttNd();
+ const SwStartNode* pLastNd = pBRBox->GetSttNd();
+ pUnoCrsr->GetPoint()->nNode = *pLastNd;
+
pUnoCrsr->Move( fnMoveForward, fnGoNode );
SwUnoTableCrsr* pCrsr = dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr);
pCrsr->MakeBoxSels();
@@ -4448,41 +4482,6 @@ void SwXCellRange::GetDataSequence(
pDblSeq->realloc( nDtaCnt );
}
-/*-- 04.06.04 11:42:47---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-
-SwUnoCrsr * lcl_CreateCursor( SwFrmFmt &rTblFmt,
- SwTableBox *pStartBox, // should be top-left cell of cell range
- SwTableBox *pEndBox ) // should be bottom right-cell cell range
-{
- // create a *new* UNO cursor spanning the cell range defined by
- // the start and end box. Both boxes must be belong to the same table!
-
- SwUnoCrsr *pUnoCrsr = 0;
- if (pStartBox && pEndBox)
- {
- // hier muessen die Actions aufgehoben werden um
- // (zB dem Layout zu ermöglichen die Tabelle zu formatieren, da
- // sonst kein Tabellen Cursor aufgespannt werden kann.)
- UnoActionRemoveContext aRemoveContext(rTblFmt.GetDoc());
-
- // set point of cursor to top left box of range
- const SwStartNode* pSttNd = pStartBox->GetSttNd();
- SwPosition aPos(*pSttNd);
- pUnoCrsr = rTblFmt.GetDoc()->CreateUnoCrsr(aPos, sal_True);
- pUnoCrsr->Move( fnMoveForward, fnGoNode );
- pUnoCrsr->SetRemainInSection( sal_False );
- pUnoCrsr->SetMark();
- pUnoCrsr->GetPoint()->nNode = *pEndBox->GetSttNd();
- pUnoCrsr->Move( fnMoveForward, fnGoNode );
- SwUnoTableCrsr *pCrsr = dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr);
- pCrsr->MakeBoxSels();
- }
- return pUnoCrsr;
-}
-
-
/*-- 29.04.02 11:42:47---------------------------------------------------
-----------------------------------------------------------------------*/
diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx
index fcb702a7112a..fcb702a7112a 100755..100644
--- a/sw/source/core/view/viewpg.cxx
+++ b/sw/source/core/view/viewpg.cxx
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 156447fda9da..0bbfc70d5a22 100755..100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -860,21 +860,6 @@ void ViewShell::SetTabCompat( bool bNew )
}
}
-/*-- 29.11.2007 09:03:18---------------------------------------------------
- //#i24363# tab stops relative to indent
- -----------------------------------------------------------------------*/
-void ViewShell::SetTabsRelativeToIndent(bool bNew)
-{
- IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
- if( pIDSA->get(IDocumentSettingAccess::TABS_RELATIVE_TO_INDENT) != bNew )
- {
- SwWait aWait( *GetDoc()->GetDocShell(), TRUE );
- pIDSA->set(IDocumentSettingAccess::TABS_RELATIVE_TO_INDENT, bNew );
- const BYTE nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION;
- lcl_InvalidateAllCntnt( *this, nInv );
- }
-}
-
void ViewShell::SetAddExtLeading( bool bNew )
{
IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx
index 9249d4e5d11b..c1ba4908a339 100644
--- a/sw/source/filter/ascii/ascatr.cxx
+++ b/sw/source/filter/ascii/ascatr.cxx
@@ -124,7 +124,8 @@ BOOL SwASC_AttrIter::OutAttr( xub_StrLen nSwPos )
switch( pHt->Which() )
{
case RES_TXTATR_FIELD:
- sOut = ((SwTxtFld*)pHt)->GetFld().GetFld()->Expand();
+ sOut = static_cast<SwTxtFld const*>(pHt)->GetFld().GetFld()
+ ->ExpandField(rWrt.pDoc->IsClipBoard());
break;
case RES_TXTATR_FTN:
diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx
index 2e67ffcde1f8..50b7bdc7ddc8 100644
--- a/sw/source/filter/html/htmlfldw.cxx
+++ b/sw/source/filter/html/htmlfldw.cxx
@@ -305,7 +305,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pFld,
}
// Inhalt des Feldes ausgeben
- String sExpand( pFld->Expand() );
+ String const sExpand( pFld->ExpandField(rWrt.pDoc->IsClipBoard()) );
sal_Bool bNeedsCJKProcessing = sal_False;
if( sExpand.Len() )
{
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index 4fd450cbffd5..bb1567d978f6 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -547,18 +547,20 @@ void SwHTMLImageWatcher::init( sal_Int32 Width, sal_Int32 Height )
0 != (pANd = pDoc->GetNodes()[pAPos->nNode]) &&
0 != (pTblNd = pANd->FindTableNode()) )
{
- sal_Bool bLastGrf = !pTblNd->GetTable().DecGrfsThatResize();
+ const sal_Bool bLastGrf = !pTblNd->GetTable().DecGrfsThatResize();
SwHTMLTableLayout *pLayout =
pTblNd->GetTable().GetHTMLTableLayout();
if( pLayout )
{
- sal_uInt16 nBrowseWidth =
+ const sal_uInt16 nBrowseWidth =
pLayout->GetBrowseWidthByTable( *pDoc );
- if( nBrowseWidth )
+ if ( nBrowseWidth )
+ {
pLayout->Resize( nBrowseWidth, sal_True, sal_True,
bLastGrf ? HTMLTABLE_RESIZE_NOW
: 500 );
+ }
}
}
}
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 1e4f975ba3ec..fba6a477757d 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -4957,7 +4957,7 @@ USHORT SwHTMLParser::ToTwips( USHORT nPixel ) const
SwTwips SwHTMLParser::GetCurrentBrowseWidth()
{
- SwTwips nWidth = SwHTMLTableLayout::GetBrowseWidth( *pDoc );
+ const SwTwips nWidth = SwHTMLTableLayout::GetBrowseWidth( *pDoc );
if( nWidth )
return nWidth;
diff --git a/sw/source/filter/rtf/rtfatr.cxx b/sw/source/filter/rtf/rtfatr.cxx
index 7dcb732df601..507c83c2a204 100644
--- a/sw/source/filter/rtf/rtfatr.cxx
+++ b/sw/source/filter/rtf/rtfatr.cxx
@@ -2902,7 +2902,8 @@ static Writer& OutRTF_SwField( Writer& rWrt, const SfxPoolItem& rHt )
case RES_HIDDENTXTFLD:
if( TYP_CONDTXTFLD == ((SwHiddenTxtField*)pFld)->GetSubType() )
- RTFOutFuncs::Out_String( rWrt.Strm(), pFld->Expand(),
+ RTFOutFuncs::Out_String( rWrt.Strm(),
+ pFld->ExpandField(rWrt.pDoc->IsClipBoard()),
rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
else
{
@@ -2958,7 +2959,8 @@ static Writer& OutRTF_SwField( Writer& rWrt, const SfxPoolItem& rHt )
rWrt.Strm() >> cCh;
if( ' ' != cCh ) // vorweg immer einen Trenner
rWrt.Strm() << ' ';
- RTFOutFuncs::Out_String( rWrt.Strm(), pFld->Expand(),
+ RTFOutFuncs::Out_String( rWrt.Strm(),
+ pFld->ExpandField(rWrt.pDoc->IsClipBoard()),
rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
}
break;
@@ -2967,7 +2969,8 @@ static Writer& OutRTF_SwField( Writer& rWrt, const SfxPoolItem& rHt )
if( aFldStt.Len() )
{
rWrt.Strm() << "}{" << OOO_STRING_SVTOOLS_RTF_FLDRSLT << ' ';
- RTFOutFuncs::Out_String( rWrt.Strm(), pFld->Expand(),
+ RTFOutFuncs::Out_String( rWrt.Strm(),
+ pFld->ExpandField(rWrt.pDoc->IsClipBoard()),
rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
rWrt.Strm() << "}}";
rRTFWrt.bOutFmtAttr = FALSE;
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index 5a5e7a65e0a7..e83ab108bbc9 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -1599,79 +1599,6 @@ USHORT SwRTFParser::ReadRevTbl()
return nAuthorTableIndex;
}
-// #117910# simulate words behaviour of \keepn in table rows
-void fixKeepAndSplitAttributes(SwTableNode *pTableNode)
-{
- ASSERT(pTableNode!=NULL, "no table node!");
- if (!pTableNode) return;
- SwDoc *pDoc=pTableNode->GetDoc();
- if (pTableNode==NULL) return;
- SwTable& rTable=pTableNode->GetTable();
- SwTableLines& rLns = rTable.GetTabLines();
- USHORT nLines=rLns.Count();
- if (nLines==0) return;
- // get first paragaph in left down-most box
- SwTableLine* pLastLine = rLns[ nLines-1 ];
- SwTableBox* pBox = pLastLine->GetTabBoxes()[ 0 ];
- ULONG iFirstParagraph=pBox->GetSttIdx()+1;
- SwTxtNode *pTxtNode=(SwTxtNode *)pDoc->GetNodes()[iFirstParagraph];
- SwFrmFmt* pFmt=rTable.GetFrmFmt();
-
- SwFmtLayoutSplit *pTableSplit=(SwFmtLayoutSplit *)pFmt->GetAttrSet().GetItem(RES_LAYOUT_SPLIT);
- BOOL isTableKeep = pTableSplit!=NULL && !pTableSplit->GetValue();
- SvxFmtKeepItem *pTableKeep=(SvxFmtKeepItem *)pFmt->GetAttrSet().GetItem(RES_KEEP);
- BOOL isTableKeepNext = pTableKeep!=NULL && pTableKeep->GetValue();
- SvxFmtKeepItem *pKeepNext = (SvxFmtKeepItem *)pTxtNode->GetSwAttrSet().GetItem(RES_KEEP);
-
- if (isTableKeepNext)
- {
- if (nLines>2 && !isTableKeep)
- { // split
- SwTableLine* pSplitLine = rLns[ nLines-2 ];
- SwTableBox* pSplitBox = pSplitLine->GetTabBoxes()[ 0 ];
- SwNodeIndex aSplitIdx( *pSplitBox->GetSttNd() );
- pDoc->SplitTable( SwPosition(aSplitIdx), HEADLINE_NONE,
- !isTableKeep );
- SwTable& rSplitTable=aSplitIdx.GetNode().FindTableNode()->GetTable();
- aSplitIdx-=2;
- pDoc->GetNodes().Delete(aSplitIdx);
- pFmt=rSplitTable.GetFrmFmt();
- pFmt->ResetFmtAttr(RES_PAGEDESC);
- }
- // set keep=1(i.e. split=0) attribut
- SwFmtLayoutSplit aSplit(0);
- SwAttrSet aNewSet(pFmt->GetAttrSet());
- aNewSet.Put(aSplit);
- pFmt->SetFmtAttr(aNewSet);
- }
- else // !isTableKeepNext
- {
- if (isTableKeep)
- {
- SwNodeIndex aTmpIdx( *pBox->GetSttNd() );
- pDoc->SplitTable( SwPosition(aTmpIdx), HEADLINE_NONE, FALSE );
- SwTable& rSplitTable=aTmpIdx.GetNode().FindTableNode()->GetTable();
- aTmpIdx-=2;
- pDoc->GetNodes().Delete(aTmpIdx);
- pFmt=rSplitTable.GetFrmFmt();
- pFmt->ResetFmtAttr(RES_PAGEDESC);
- }
- // set keep=0(i.e. split=1) attribut
- SwFmtLayoutSplit aSplit(1);
- SwAttrSet aNewSet(pFmt->GetAttrSet());
- aNewSet.Put(aSplit);
- pFmt->SetFmtAttr(aNewSet);
- }
- // move keepnext attribtue from last paragraph to table
- if (pKeepNext!=NULL)
- {
- SvxFmtKeepItem aNewKeepItem(pKeepNext->GetValue(), RES_KEEP);
- SwAttrSet aNewSet(pFmt->GetAttrSet());
- aNewSet.Put(aNewKeepItem);
- pFmt->SetFmtAttr(aNewSet);
- }
-}
-
void SwRTFParser::NextToken( int nToken )
{
USHORT eDateFmt;
diff --git a/sw/source/filter/rtf/wrtrtf.cxx b/sw/source/filter/rtf/wrtrtf.cxx
index 34fe44eae053..8e17bee3874b 100644
--- a/sw/source/filter/rtf/wrtrtf.cxx
+++ b/sw/source/filter/rtf/wrtrtf.cxx
@@ -85,9 +85,6 @@ const sal_Char SwRTFWriter::sNewLine = '\012';
const sal_Char __FAR_DATA SwRTFWriter::sNewLine[] = "\015\012";
#endif
-static ::rtl::OUString aEmpty;
-
-
SV_DECL_VARARR( RTFColorTbl, Color, 5, 8 )
SV_IMPL_VARARR( RTFColorTbl, Color )
@@ -1302,6 +1299,7 @@ void SwRTFWriter::OutBookmarks( xub_StrLen nCntntPos)
OutComment( *this, OOO_STRING_SVTOOLS_RTF_BKMKEND ) << ' ';
{
+ ::rtl::OUString aEmpty;
::rtl::OUString & rBookmarkName = aEmpty;
if (pAsBookmark)
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx
index 4bee56fa12ef..8ca7c8d71571 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -53,6 +53,7 @@ WW8TableNodeInfoInner::WW8TableNodeInfoInner(WW8TableNodeInfo * pParent)
, mnShadowsAfter(0)
, mbEndOfLine(false)
, mbEndOfCell(false)
+, mbFirstInTable(false)
, mbVertMerge(false)
, mpTableBox(NULL)
, mpTable(NULL)
@@ -98,7 +99,13 @@ void WW8TableNodeInfoInner::setEndOfCell(bool bEndOfCell)
mbEndOfCell = bEndOfCell;
}
+void WW8TableNodeInfoInner::setFirstInTable(bool bFirstInTable)
+{
+ mbFirstInTable = bFirstInTable;
+}
+
void WW8TableNodeInfoInner::setVertMerge(bool bVertMerge)
+
{
mbVertMerge = bVertMerge;
}
@@ -153,6 +160,11 @@ bool WW8TableNodeInfoInner::isEndOfLine() const
return mbEndOfLine;
}
+bool WW8TableNodeInfoInner::isFirstInTable() const
+{
+ return mbFirstInTable;
+}
+
const SwNode * WW8TableNodeInfoInner::getNode() const
{
const SwNode * pResult = NULL;
@@ -320,7 +332,6 @@ string WW8TableNodeInfoInner::toString() const
return string(buffer);
}
-
// WW8TableTextNodeInfo
WW8TableNodeInfo::WW8TableNodeInfo(WW8TableInfo * pParent,
@@ -356,16 +367,13 @@ WW8TableNodeInfo::~WW8TableNodeInfo()
aIt++;
}
-
#ifdef DEBUG
sResult += dbg_out(*mpNode);
#endif
-
sResult += "</tableNodeInfo>";
return sResult;
}
-
void WW8TableNodeInfo::setDepth(sal_uInt32 nDepth)
{
mnDepth = nDepth;
@@ -400,11 +408,25 @@ void WW8TableNodeInfo::setEndOfCell(bool bEndOfCell)
#endif
}
+void WW8TableNodeInfo::setFirstInTable(bool bFirstInTable)
+{
+ WW8TableNodeInfoInner::Pointer_t pInner = getInnerForDepth(mnDepth);
+
+ pInner->setFirstInTable(bFirstInTable);
+
+#ifdef DEBUG
+ ::std::clog << "<firstInTable depth=\"" << mnDepth << "\">"
+ << toString() << "</firstInTable>" << ::std::endl;
+#endif
+}
+
void WW8TableNodeInfo::setVertMerge(bool bVertMerge)
{
WW8TableNodeInfoInner::Pointer_t pInner = getInnerForDepth(mnDepth);
+
pInner->setVertMerge(bVertMerge);
+
#ifdef DEBUG
::std::clog << "<vertMerge depth=\"" << mnDepth << "\">"
<< toString() << "</vertMerge>" << ::std::endl;
@@ -868,6 +890,16 @@ WW8TableNodeInfo::Pointer_t WW8TableInfo::insertTableNodeInfo
pNodeInfo->setCell(nCell);
pNodeInfo->setRow(nRow);
+ if (pNode->IsTxtNode())
+ {
+ FirstInTableMap_t::const_iterator aIt = mFirstInTableMap.find(pTable);
+ if (aIt == mFirstInTableMap.end())
+ {
+ mFirstInTableMap[pTable] = pNode;
+ pNodeInfo->setFirstInTable(true);
+ }
+ }
+
if (pRect)
{
WW8TableCellGrid::Pointer_t pCellGrid = getCellGridForTable(pTable);
diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx
index 47397310bd2d..b844615fecad 100644
--- a/sw/source/filter/ww8/WW8TableInfo.hxx
+++ b/sw/source/filter/ww8/WW8TableInfo.hxx
@@ -67,6 +67,7 @@ class WW8TableNodeInfoInner
sal_uInt32 mnShadowsAfter;
bool mbEndOfLine;
bool mbEndOfCell;
+ bool mbFirstInTable;
bool mbVertMerge;
const SwTableBox * mpTableBox;
const SwTable * mpTable;
@@ -85,6 +86,7 @@ public:
void setShadowsAfter(sal_uInt32 nShadowsAfter);
void setEndOfLine(bool bEndOfLine);
void setEndOfCell(bool bEndOfCell);
+ void setFirstInTable(bool bFirstInTable);
void setVertMerge(bool bVertMErge);
void setTableBox(const SwTableBox * pTableBox);
void setTable(const SwTable * pTable);
@@ -97,6 +99,7 @@ public:
sal_uInt32 getShadowsAfter() const;
bool isEndOfCell() const;
bool isEndOfLine() const;
+ bool isFirstInTable() const;
bool isVertMerge() const;
const SwTableBox * getTableBox() const;
const SwTable * getTable() const;
@@ -140,6 +143,7 @@ public:
void setDepth(sal_uInt32 nDepth);
void setEndOfLine(bool bEndOfLine);
void setEndOfCell(bool bEndOfCell);
+ void setFirstInTable(bool bFirstInTable);
void setVertMerge(bool bVertMerge);
void setTableBox(const SwTableBox *pTableBox);
void setTable(const SwTable * pTable);
@@ -155,6 +159,7 @@ public:
sal_uInt32 getDepth() const;
bool isEndOfLine() const;
bool isEndOfCell() const;
+ bool isFirstInTable() const;
const SwNode * getNode() const;
const SwTableBox * getTableBox() const;
const SwTable * getTable() const;
@@ -247,11 +252,14 @@ class WW8TableInfo
{
friend class WW8TableNodeInfoInner;
typedef hash_map<const SwNode *, WW8TableNodeInfo::Pointer_t, hashNode > Map_t;
- typedef hash_map<const SwTable *, WW8TableCellGrid::Pointer_t, hashTable > CellGridMap_t;
-
Map_t mMap;
+
+ typedef hash_map<const SwTable *, WW8TableCellGrid::Pointer_t, hashTable > CellGridMap_t;
CellGridMap_t mCellGridMap;
+ typedef hash_map<const SwTable *, const SwNode *, hashTable > FirstInTableMap_t;
+ FirstInTableMap_t mFirstInTableMap;
+
WW8TableNodeInfo *
processTableLine(const SwTable * pTable,
const SwTableLine * pTableLine,
@@ -295,6 +303,7 @@ public:
WW8TableNodeInfo * processSwTableByLayout(const SwTable * pTable);
WW8TableNodeInfo::Pointer_t getTableNodeInfo(const SwNode * pNode);
const SwNode * getNextNode(const SwNode * pNode);
+ const WW8TableNodeInfo * getFirstTableNodeInfo() const;
WW8TableNodeInfo * reorderByLayout(const SwTable * pTable);
};
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx
index 5e1ca48b5ab3..6f69f8e591a5 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -232,6 +232,8 @@ public:
virtual void TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) = 0;
+ virtual void TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) = 0;
+
virtual void TableRowEnd( sal_uInt32 nDepth ) = 0;
/// Start of the styles table.
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index bb26e670928a..0a6151b98388 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -731,9 +731,7 @@ void DocxAttributeOutput::RunText( const String& rText, rtl_TextEncoding /*eChar
if ( *pIt < 0x0020 ) // filter out the control codes
{
impl_WriteRunText( m_pSerializer, nTextToken, pBegin, pIt );
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "Ignored control code %x in a text run.", *pIt );
-#endif
+ OSL_TRACE( "Ignored control code %x in a text run.", *pIt );
}
break;
}
@@ -744,23 +742,17 @@ void DocxAttributeOutput::RunText( const String& rText, rtl_TextEncoding /*eChar
void DocxAttributeOutput::RawText( const String& /*rText*/, bool /*bForceUnicode*/, rtl_TextEncoding /*eCharSet*/ )
{
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet )\n" );
-#endif
+ OSL_TRACE("TODO DocxAttributeOutput::RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet )\n" );
}
void DocxAttributeOutput::StartRuby( const SwTxtNode& /*rNode*/, const SwFmtRuby& /*rRuby*/ )
{
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::StartRuby( const SwTxtNode& rNode, const SwFmtRuby& rRuby )\n" );
-#endif
+ OSL_TRACE("TODO DocxAttributeOutput::StartRuby( const SwTxtNode& rNode, const SwFmtRuby& rRuby )\n" );
}
void DocxAttributeOutput::EndRuby()
{
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::EndRuby()\n" );
-#endif
+ OSL_TRACE( "TODO DocxAttributeOutput::EndRuby()\n" );
}
bool DocxAttributeOutput::AnalyzeURL( const String& rUrl, const String& rTarget, String* pLinkURL, String* pMark )
@@ -849,9 +841,7 @@ void DocxAttributeOutput::FieldVanish( const String& rTxt, ww::eField eType )
void DocxAttributeOutput::Redline( const SwRedlineData* /*pRedline*/ )
{
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::Redline( const SwRedlineData* pRedline )\n" );
-#endif
+ OSL_TRACE( "TODO DocxAttributeOutput::Redline( const SwRedlineData* pRedline )\n" );
}
/// Append the number as 2-digit when less than 10.
@@ -936,9 +926,7 @@ void DocxAttributeOutput::StartRedline( const SwRedlineData* pRedlineData )
break;
case nsRedlineType_t::REDLINE_FORMAT:
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::StartRedline()\n" );
-#endif
+ OSL_TRACE( "TODO DocxAttributeOutput::StartRedline()\n" );
default:
break;
}
@@ -960,9 +948,7 @@ void DocxAttributeOutput::EndRedline()
break;
case nsRedlineType_t::REDLINE_FORMAT:
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::EndRedline()\n" );
-#endif
+ OSL_TRACE( "TODO DocxAttributeOutput::EndRedline()\n" );
break;
default:
break;
@@ -973,9 +959,7 @@ void DocxAttributeOutput::EndRedline()
void DocxAttributeOutput::FormatDrop( const SwTxtNode& /*rNode*/, const SwFmtDrop& /*rSwFmtDrop*/, USHORT /*nStyle*/, ww8::WW8TableNodeInfo::Pointer_t /*pTextNodeInfo*/, ww8::WW8TableNodeInfoInner::Pointer_t )
{
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::FormatDrop( const SwTxtNode& rNode, const SwFmtDrop& rSwFmtDrop, USHORT nStyle )\n" );
-#endif
+ OSL_TRACE( "TODO DocxAttributeOutput::FormatDrop( const SwTxtNode& rNode, const SwFmtDrop& rSwFmtDrop, USHORT nStyle )\n" );
}
void DocxAttributeOutput::ParagraphStyle( USHORT nStyle )
@@ -990,7 +974,7 @@ void DocxAttributeOutput::ParagraphStyle( USHORT nStyle )
void DocxAttributeOutput::InTable()
{
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::InTable()\n" );
+ OSL_TRACE( "TODO DocxAttributeOutput::InTable()\n" );
#endif
}
@@ -998,7 +982,7 @@ void DocxAttributeOutput::InTable()
void DocxAttributeOutput::TableRowProperties( bool /*bHeader*/, long /*nCellHeight*/, bool /*bCannotSplit*/, bool /*bRightToLeft*/ )
{
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::TableRowProperties()\n" );
+ OSL_TRACE( "TODO DocxAttributeOutput::TableRowProperties()\n" );
#endif
}
#endif
@@ -1439,9 +1423,7 @@ void DocxAttributeOutput::TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer
void DocxAttributeOutput::TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t /*pNodeInfo*/ )
{
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO: DocxAttributeOutput::TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t pNodeInfo )\n" );
-#endif
+ OSL_TRACE( "TODO: DocxAttributeOutput::TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t pNodeInfo )\n" );
}
void DocxAttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner )
@@ -1455,16 +1437,19 @@ void DocxAttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointe
void DocxAttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ )
{
+ OSL_TRACE( "TODO: DocxAttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )\n" );
+}
+
+void DocxAttributeOutput::TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ )
+{
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO: DocxAttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )\n" );
+ fprintf( stderr, "TODO: DocxAttributeOutput::TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )\n" );
#endif
}
void DocxAttributeOutput::TableRowEnd( sal_uInt32 /*nDepth*/ )
{
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO: DocxAttributeOutput::TableRowEnd( sal_uInt32 nDepth = 1 )\n" );
-#endif
+ OSL_TRACE( "TODO: DocxAttributeOutput::TableRowEnd( sal_uInt32 nDepth = 1 )\n" );
}
void DocxAttributeOutput::StartStyles()
@@ -1483,7 +1468,7 @@ void DocxAttributeOutput::DefaultStyle( USHORT nStyle )
{
// are these the values of enum ww::sti (see ../inc/wwstyles.hxx)?
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::DefaultStyle( USHORT nStyle )- %d\n", nStyle );
+ OSL_TRACE( "TODO DocxAttributeOutput::DefaultStyle( USHORT nStyle )- %d\n", nStyle );
#else
(void) nStyle; // to quiet the warning
#endif
@@ -1492,7 +1477,7 @@ void DocxAttributeOutput::DefaultStyle( USHORT nStyle )
void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size& rSize )
{
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size& rSize ) - some stuff still missing\n" );
+ OSL_TRACE( "TODO DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size& rSize ) - some stuff still missing\n" );
#endif
// create the relation ID
OString aRelId;
@@ -1710,7 +1695,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po
break;
default:
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Point& rNdTopLeft ) - frame type '%s'\n",
+ OSL_TRACE( "TODO DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Point& rNdTopLeft ) - frame type '%s'\n",
rFrame.GetWriterType() == sw::Frame::eTxtBox? "eTxtBox":
( rFrame.GetWriterType() == sw::Frame::eOle? "eOle":
( rFrame.GetWriterType() == sw::Frame::eFormControl? "eFormControl": "???" ) ) );
@@ -1839,7 +1824,7 @@ void DocxAttributeOutput::SectionBreak( BYTE nC, const WW8_SepInfo* pSectionInfo
break;
default:
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "Unknown section break to write: %d\n", nC );
+ OSL_TRACE( "Unknown section break to write: %d\n", nC );
#endif
break;
}
@@ -1879,7 +1864,7 @@ void DocxAttributeOutput::SectionLineNumbering( ULONG /*nRestartNo*/, const SwLi
{
// see 2.6.8 lnNumType (Line Numbering Settings)
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::SectionLineNumbering()\n" );
+ OSL_TRACE( "TODO DocxAttributeOutput::SectionLineNumbering()\n" );
#endif
}
@@ -1965,7 +1950,7 @@ void DocxAttributeOutput::SectionPageNumbering( USHORT nNumType, USHORT nPageRes
// see 2.6.12 pgNumType (Page Numbering Settings)
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::SectionPageNumbering()\n" );
+ OSL_TRACE( "TODO DocxAttributeOutput::SectionPageNumbering()\n" );
#endif
}
@@ -2073,7 +2058,7 @@ void DocxAttributeOutput::NumberingDefinition( USHORT nId, const SwNumRule &rRul
#if OSL_DEBUG_LEVEL > 0
// TODO ww8 version writes this, anything to do about it here?
if ( rRule.IsContinusNum() )
- fprintf( stderr, "TODO DocxAttributeOutput::NumberingDefinition()\n" );
+ OSL_TRACE( "TODO DocxAttributeOutput::NumberingDefinition()\n" );
#else
(void) rRule; // to quiet the warning...
#endif
@@ -2265,7 +2250,7 @@ void DocxAttributeOutput::CharCrossedOut( const SvxCrossedOutItem& rCrossedOut )
void DocxAttributeOutput::CharEscapement( const SvxEscapementItem& /*rEscapement*/ )
{
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::CharEscapement()\n" );
+ OSL_TRACE( "TODO DocxAttributeOutput::CharEscapement()\n" );
#endif
}
@@ -2382,7 +2367,7 @@ void DocxAttributeOutput::CharWeight( const SvxWeightItem& rWeight )
void DocxAttributeOutput::CharAutoKern( const SvxAutoKernItem& )
{
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::CharAutoKern()\n" );
+ OSL_TRACE( "TODO DocxAttributeOutput::CharAutoKern()\n" );
#endif
}
@@ -2554,7 +2539,7 @@ void DocxAttributeOutput::TextINetFormat( const SwFmtINetFmt& rLink )
void DocxAttributeOutput::TextCharFormat( const SwFmtCharFmt& )
{
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::TextCharFormat()\n" );
+ OSL_TRACE( "TODO DocxAttributeOutput::TextCharFormat()\n" );
#endif
}
@@ -2577,14 +2562,14 @@ void DocxAttributeOutput::RefField( const SwField& rFld, const String& rRef )
void DocxAttributeOutput::HiddenField( const SwField& /*rFld*/ )
{
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::HiddenField()\n" );
+ OSL_TRACE( "TODO DocxAttributeOutput::HiddenField()\n" );
#endif
}
void DocxAttributeOutput::PostitField( const SwField* /* pFld*/ )
{
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::PostitField()\n" );
+ OSL_TRACE( "TODO DocxAttributeOutput::PostitField()\n" );
#endif
}
@@ -2970,7 +2955,7 @@ void DocxAttributeOutput::FormatFrameSize( const SwFmtFrmSize& rSize )
if ( m_rExport.bOutFlyFrmAttrs )
{
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::FormatFrameSize() - Fly frames\n" );
+ OSL_TRACE( "TODO DocxAttributeOutput::FormatFrameSize() - Fly frames\n" );
#endif
}
else if ( m_rExport.bOutPageDescs )
@@ -2993,7 +2978,7 @@ void DocxAttributeOutput::FormatFrameSize( const SwFmtFrmSize& rSize )
void DocxAttributeOutput::FormatPaperBin( const SvxPaperBinItem& )
{
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::FormatPaperBin()\n" );
+ OSL_TRACE( "TODO DocxAttributeOutput::FormatPaperBin()\n" );
#endif
}
@@ -3002,7 +2987,7 @@ void DocxAttributeOutput::FormatLRSpace( const SvxLRSpaceItem& rLRSpace )
if ( m_rExport.bOutFlyFrmAttrs )
{
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "DocxAttributeOutput::FormatLRSpace() - Fly frames\n" );
+ OSL_TRACE( "DocxAttributeOutput::FormatLRSpace() - Fly frames\n" );
#endif
}
else if ( m_rExport.bOutPageDescs )
@@ -3093,28 +3078,28 @@ void DocxAttributeOutput::FormatULSpace( const SvxULSpaceItem& rULSpace )
void DocxAttributeOutput::FormatSurround( const SwFmtSurround& )
{
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::FormatSurround()\n" );
+ OSL_TRACE( "TODO DocxAttributeOutput::FormatSurround()\n" );
#endif
}
void DocxAttributeOutput::FormatVertOrientation( const SwFmtVertOrient& )
{
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::FormatVertOrientation()\n" );
+ OSL_TRACE( "TODO DocxAttributeOutput::FormatVertOrientation()\n" );
#endif
}
void DocxAttributeOutput::FormatHorizOrientation( const SwFmtHoriOrient& )
{
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::FormatHorizOrientation()\n" );
+ OSL_TRACE( "TODO DocxAttributeOutput::FormatHorizOrientation()\n" );
#endif
}
void DocxAttributeOutput::FormatAnchor( const SwFmtAnchor& )
{
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::FormatAnchor()\n" );
+ OSL_TRACE( "TODO DocxAttributeOutput::FormatAnchor()\n" );
#endif
}
@@ -3129,7 +3114,7 @@ void DocxAttributeOutput::FormatBackground( const SvxBrushItem& rBrush )
}
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::FormatBackground()\n" );
+ OSL_TRACE( "TODO DocxAttributeOutput::FormatBackground()\n" );
#endif
}
@@ -3215,9 +3200,7 @@ void DocxAttributeOutput::FormatKeep( const SvxFmtKeepItem& )
void DocxAttributeOutput::FormatTextGrid( const SwTextGridItem& )
{
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxAttributeOutput::FormatTextGrid()\n" );
-#endif
+ OSL_TRACE( "TODO DocxAttributeOutput::FormatTextGrid()\n" );
}
void DocxAttributeOutput::FormatLineNumbering( const SwFmtLineNumber& rNumbering )
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index bbfec465973a..0962edd65085 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -342,9 +342,7 @@ void DocxExport::OutputField( const SwField* pFld, ww::eField eFldType, const St
void DocxExport::WriteFormData( const ::sw::mark::IFieldmark& /*rFieldmark*/ )
{
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxExport::WriteFormData()\n" );
-#endif
+ OSL_TRACE( "TODO DocxExport::WriteFormData()\n" );
}
void DocxExport::DoComboBox(const rtl::OUString& rName,
@@ -404,9 +402,7 @@ void DocxExport::DoComboBox(const rtl::OUString& rName,
void DocxExport::DoFormText(const SwInputField* /*pFld*/)
{
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxExport::ForFormText()\n" );
-#endif
+ OSL_TRACE( "TODO DocxExport::ForFormText()\n" );
}
void DocxExport::ExportDocument_Impl()
@@ -430,16 +426,14 @@ void DocxExport::ExportDocument_Impl()
void DocxExport::OutputPageSectionBreaks( const SwTxtNode& )
{
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxExport::OutputPageSectionBreaks( const SwTxtNode& )\n" );
-#endif
+ OSL_TRACE( "TODO DocxExport::OutputPageSectionBreaks( const SwTxtNode& )\n" );
}
void DocxExport::AppendSection( const SwPageDesc *pPageDesc, const SwSectionFmt* pFmt, ULONG nLnNum )
{
AttrOutput().SectionBreak( msword::PageBreak, m_pSections->CurrentSectionInfo() );
- m_pSections->AppendSep( pPageDesc, pFmt, nLnNum );
+ m_pSections->AppendSection( pPageDesc, pFmt, nLnNum );
}
void DocxExport::OutputEndNode( const SwEndNode& rEndNode )
@@ -473,30 +467,24 @@ void DocxExport::OutputEndNode( const SwEndNode& rEndNode )
nRstLnNum = 0;
AttrOutput().SectionBreak( msword::PageBreak, m_pSections->CurrentSectionInfo( ) );
- m_pSections->AppendSep( pAktPageDesc, pParentFmt, nRstLnNum );
+ m_pSections->AppendSection( pAktPageDesc, pParentFmt, nRstLnNum );
}
}
}
void DocxExport::OutputTableNode( const SwTableNode& )
{
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxExport::OutputTableNode( const SwTableNode& )\n" );
-#endif
+ OSL_TRACE( "TODO DocxExport::OutputTableNode( const SwTableNode& )\n" );
}
void DocxExport::OutputGrfNode( const SwGrfNode& )
{
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxExport::OutputGrfNode( const SwGrfNode& )\n" );
-#endif
+ OSL_TRACE( "TODO DocxExport::OutputGrfNode( const SwGrfNode& )\n" );
}
void DocxExport::OutputOLENode( const SwOLENode& )
{
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "TODO DocxExport::OutputOLENode( const SwOLENode& )\n" );
-#endif
+ OSL_TRACE( "TODO DocxExport::OutputOLENode( const SwOLENode& )\n" );
}
ULONG DocxExport::ReplaceCr( BYTE )
@@ -521,11 +509,11 @@ void DocxExport::PrepareNewPageDesc( const SfxItemSet* pSet,
if ( pNewPgDescFmt )
{
- m_pSections->AppendSep( *pNewPgDescFmt, rNd, pFmt, nLnNm );
+ m_pSections->AppendSection( *pNewPgDescFmt, rNd, pFmt, nLnNm );
}
else if ( pNewPgDesc )
{
- m_pSections->AppendSep( pNewPgDesc, rNd, pFmt, nLnNm );
+ m_pSections->AppendSection( pNewPgDesc, rNd, pFmt, nLnNm );
}
}
diff --git a/sw/source/filter/ww8/docxexportfilter.cxx b/sw/source/filter/ww8/docxexportfilter.cxx
index 5f23f23a8dd5..13715fcd2bbe 100644
--- a/sw/source/filter/ww8/docxexportfilter.cxx
+++ b/sw/source/filter/ww8/docxexportfilter.cxx
@@ -47,7 +47,7 @@ DocxExportFilter::DocxExportFilter( const uno::Reference< lang::XMultiServiceFac
bool DocxExportFilter::exportDocument()
{
- fprintf( stderr, "DocxExportFilter::exportDocument()\n" ); // DEBUG remove me
+ OSL_TRACE(, "DocxExportFilter::exportDocument()\n" ); // DEBUG remove me
// get SwDoc*
uno::Reference< uno::XInterface > xIfc( getModel(), uno::UNO_QUERY );
diff --git a/sw/source/filter/ww8/dump/ww8scan.cxx b/sw/source/filter/ww8/dump/ww8scan.cxx
index f3e784643403..cd211520e083 100644
--- a/sw/source/filter/ww8/dump/ww8scan.cxx
+++ b/sw/source/filter/ww8/dump/ww8scan.cxx
@@ -31,12 +31,8 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
-#ifndef __SGI_STL_ALGORITHM
#include <algorithm>
-#endif
-#ifndef __SGI_STL_FUNCTIONAL
#include <functional>
-#endif
#include <string.h> // memset()
#include <osl/endian.h>
diff --git a/sw/source/filter/ww8/dump/ww8scan.hxx b/sw/source/filter/ww8/dump/ww8scan.hxx
index 6ac516b541ee..7db1224704e3 100644
--- a/sw/source/filter/ww8/dump/ww8scan.hxx
+++ b/sw/source/filter/ww8/dump/ww8scan.hxx
@@ -297,8 +297,7 @@ class WW8PLCFx // virtueller Iterator fuer Piece Table Exceptions
public:
WW8PLCFx( BYTE nFibVersion, BOOL bSprm )
{ bIsSprm = bSprm; nVersion = nFibVersion; }
-
-// virtual ~WW8PLCFx() {}
+ virtual ~WW8PLCFx() {}
BOOL IsSprm() { return bIsSprm; }
virtual ULONG GetIdx() const = 0;
virtual void SetIdx( ULONG nIdx ) = 0;
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index 62a3726e5543..850e9b118fae 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -567,6 +567,7 @@ namespace sw
return aRet;
}
+#if 0
Frames GetFramesBetweenNodes(const Frames &rFrames,
const SwNode &rStart, const SwNode &rEnd)
{
@@ -580,7 +581,7 @@ namespace sw
return aRet;
}
-
+#endif
Frames GetFramesInNode(const Frames &rFrames, const SwNode &rNode)
{
Frames aRet;
diff --git a/sw/source/filter/ww8/writerhelper.hxx b/sw/source/filter/ww8/writerhelper.hxx
index a10330d5f3ec..ec149ee08326 100644
--- a/sw/source/filter/ww8/writerhelper.hxx
+++ b/sw/source/filter/ww8/writerhelper.hxx
@@ -663,6 +663,7 @@ namespace sw
*/
Frames GetFramesInNode(const Frames &rFrames, const SwNode &rNode);
+#if 0
/** Get the Frames anchored for all nodes between two points
Given a container of frames, find the ones anchored to the nodes
@@ -685,7 +686,7 @@ namespace sw
*/
Frames GetFramesBetweenNodes(const Frames &rFrames,
const SwNode &rStart, const SwNode &rEnd);
-
+#endif
/** Get the Numbering Format used on a paragraph
There are two differing types of numbering formats that may be on a
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 6686ae5b13d7..7f1b6658800e 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -170,10 +170,20 @@ void WW8Export::DoComboBox(uno::Reference<beans::XPropertySet> xPropSet)
rtl::OUString sHelp;
{
- uno::Any aTmp = xPropSet->getPropertyValue(C2U("Help"));
- const rtl::OUString *pStr = (const rtl::OUString *)aTmp.getValue();
- if (pStr)
- sHelp = *pStr;
+ // --> OD 2010-05-14 #160026#
+ // property "Help" does not exist and due to the no-existence an exception is thrown.
+// uno::Any aTmp = xPropSet->getPropertyValue(C2U("Help"));
+ try
+ {
+ uno::Any aTmp = xPropSet->getPropertyValue(C2U("HelpText"));
+ // <--
+ const rtl::OUString *pStr = (const rtl::OUString *)aTmp.getValue();
+ if (pStr)
+ sHelp = *pStr;
+ }
+ catch( uno::Exception& )
+ {}
+ // <--
}
rtl::OUString sToolTip;
@@ -270,25 +280,10 @@ void WW8Export::DoCheckBox(uno::Reference<beans::XPropertySet> xPropSet)
sal_Int16 nTemp = 0;
xPropSet->getPropertyValue(C2U("DefaultState")) >>= nTemp;
- sal_uInt32 nIsDefaultChecked(nTemp);
+ aFFData.setDefaultResult(nTemp);
xPropSet->getPropertyValue(C2U("State")) >>= nTemp;
- sal_uInt32 nIsChecked(nTemp);
-
- if (nIsDefaultChecked != nIsChecked)
- {
- switch (nIsChecked)
- {
- case false:
- aFFData.setResult(0);
- break;
- case true:
- aFFData.setResult(1);
- break;
- default:
- ASSERT(!this, "how did that happen");
- }
- }
+ aFFData.setResult(nTemp);
::rtl::OUString aStr;
static ::rtl::OUString sName(C2U("Name"));
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 9e114aa11b0a..6e6dcf813767 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -77,6 +77,7 @@
#include <doc.hxx>
#include <docary.hxx>
#include <swtable.hxx>
+#include <swtblfmt.hxx>
#include <section.hxx>
#include <pagedesc.hxx>
#include <swrect.hxx>
@@ -1899,6 +1900,17 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
#endif
AttrOutput().TableInfoCell( pTextNodeInfoInner );
+ if (pTextNodeInfoInner->isFirstInTable())
+ {
+ const SwTable * pTable = pTextNodeInfoInner->getTable();
+ const SwTableFmt * pTabFmt =
+ dynamic_cast<const SwTableFmt *>(pTable->GetRegisteredIn());
+ if (pTabFmt != NULL)
+ {
+ if (pTabFmt->GetBreak().GetBreak() == SVX_BREAK_PAGE_BEFORE)
+ AttrOutput().PageBreakBefore(true);
+ }
+ }
}
if ( !bFlyInTable )
@@ -2713,7 +2725,7 @@ void MSWordExportBase::OutputContentNode( const SwCntntNode& rNode )
break;
default:
#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "Unhandled node, type == %d\n", rNode.GetNodeType() );
+ OSL_TRACE("Unhandled node, type == %d\n", rNode.GetNodeType() );
#endif
break;
}
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 0871325a2d43..70d0d043710c 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -913,10 +913,10 @@ MSWordSections::MSWordSections( MSWordExportBase& rExport )
SFX_ITEM_ON == pSet->GetItemState( RES_PAGEDESC, true, &pI ) &&
( (SwFmtPageDesc*)pI )->GetPageDesc() )
{
- AppendSep( *(SwFmtPageDesc*)pI, *pNd, pFmt, nRstLnNum );
+ AppendSection( *(SwFmtPageDesc*)pI, *pNd, pFmt, nRstLnNum );
}
else
- AppendSep( rExport.pAktPageDesc, pFmt, nRstLnNum );
+ AppendSection( rExport.pAktPageDesc, pFmt, nRstLnNum );
}
WW8_WrPlcSepx::WW8_WrPlcSepx( MSWordExportBase& rExport )
@@ -925,7 +925,7 @@ WW8_WrPlcSepx::WW8_WrPlcSepx( MSWordExportBase& rExport )
pAttrs( 0 ),
pTxtPos( 0 )
{
- // to be in sync with the AppendSep() call in the MSWordSections
+ // to be in sync with the AppendSection() call in the MSWordSections
// constructor
aCps.Insert( ULONG( 0 ), aCps.Count() );
}
@@ -988,7 +988,7 @@ const WW8_SepInfo* MSWordSections::CurrentSectionInfo()
return NULL;
}
-void MSWordSections::AppendSep( const SwPageDesc* pPd,
+void MSWordSections::AppendSection( const SwPageDesc* pPd,
const SwSectionFmt* pSectionFmt, ULONG nLnNumRestartNo )
{
aSects.Insert( WW8_SepInfo( pPd, pSectionFmt, nLnNumRestartNo ),
@@ -1001,10 +1001,10 @@ void WW8_WrPlcSepx::AppendSep( WW8_CP nStartCp, const SwPageDesc* pPd,
{
aCps.Insert( nStartCp, aCps.Count() );
- MSWordSections::AppendSep( pPd, pSectionFmt, nLnNumRestartNo );
+ AppendSection( pPd, pSectionFmt, nLnNumRestartNo );
}
-void MSWordSections::AppendSep( const SwFmtPageDesc& rPD,
+void MSWordSections::AppendSection( const SwFmtPageDesc& rPD,
const SwNode& rNd, const SwSectionFmt* pSectionFmt, ULONG nLnNumRestartNo )
{
WW8_SepInfo aI( rPD.GetPageDesc(), pSectionFmt, nLnNumRestartNo,
@@ -1018,7 +1018,7 @@ void WW8_WrPlcSepx::AppendSep( WW8_CP nStartCp, const SwFmtPageDesc& rPD,
{
aCps.Insert(nStartCp, aCps.Count());
- MSWordSections::AppendSep( rPD, rNd, pSectionFmt, nLnNumRestartNo );
+ AppendSection( rPD, rNd, pSectionFmt, nLnNumRestartNo );
}
// MSWordSections::SetNum() setzt in jeder Section beim 1. Aufruf den
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index f6fb18aa0c63..2e992335598e 100644..100755
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -58,10 +58,12 @@
#include <filter/msfilter/msoleexp.hxx>
#include <filter/msfilter/msocximex.hxx>
#include <editeng/lrspitem.hxx>
+#include <editeng/ulspitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/brshitem.hxx>
#include <swtypes.hxx>
#include <swrect.hxx>
+#include <swtblfmt.hxx>
#include <txatbase.hxx>
#include <fmtcntnt.hxx>
#include <fmtpdsc.hxx>
@@ -1023,7 +1025,8 @@ bool WW8_WrFkp::Combine()
return false;
if( nIMax )
memcpy( pFkp + ( nIMax + 1 ) * 4, pOfs, nIMax * nItemSize );
- DELETEZ( pOfs );
+ delete[] pOfs;
+ pOfs = 0;
((BYTE*)pFkp)[511] = nIMax;
bCombined = true;
@@ -1910,6 +1913,7 @@ void WW8AttributeOutput::TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTa
TableBidi( pTableTextNodeInfoInner );
TableVerticalCell( pTableTextNodeInfoInner );
TableOrientation( pTableTextNodeInfoInner );
+ TableSpacing( pTableTextNodeInfoInner );
}
}
}
@@ -2092,6 +2096,41 @@ void WW8AttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t
}
}
+void WW8AttributeOutput::TableSpacing(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner)
+{
+ const SwTable * pTable = pTableTextNodeInfoInner->getTable();
+ const SwTableFmt * pTableFmt = dynamic_cast<const SwTableFmt *>(pTable->GetRegisteredIn());
+
+ if (pTableFmt != NULL)
+ {
+ const SvxULSpaceItem & rUL = pTableFmt->GetULSpace();
+
+ if (rUL.GetUpper() > 0)
+ {
+ sal_uInt8 nPadding = 2;
+ sal_uInt8 nPcVert = 0;
+ sal_uInt8 nPcHorz = 0;
+
+ sal_uInt8 nTPc = (nPadding << 4) | (nPcVert << 2) | nPcHorz;
+
+ m_rWW8Export.InsUInt16(NS_sprm::LN_TPc);
+ m_rWW8Export.pO->Insert( nTPc, m_rWW8Export.pO->Count() );
+
+ m_rWW8Export.InsUInt16(NS_sprm::LN_TDyaAbs);
+ m_rWW8Export.InsUInt16(rUL.GetUpper());
+
+ m_rWW8Export.InsUInt16(NS_sprm::LN_TDyaFromText);
+ m_rWW8Export.InsUInt16(rUL.GetUpper());
+ }
+
+ if (rUL.GetLower() > 0)
+ {
+ m_rWW8Export.InsUInt16(NS_sprm::LN_TDyaFromTextBottom);
+ m_rWW8Export.InsUInt16(rUL.GetLower());
+ }
+ }
+}
+
void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner )
{
const SwTable * pTable = pTableTextNodeInfoInner->getTable();
@@ -2416,13 +2455,15 @@ typedef ::std::deque<SwNode *> SwNodeDeque;
void MSWordExportBase::WriteText()
{
-#ifdef DEBUG
- ::std::clog << "<WriteText>" << ::std::endl;
- ::std::clog << dbg_out(pCurPam->GetDoc()->GetNodes()) << ::std::endl;
-
- SwNodeHashSet aNodeSet;
- SwNodeDeque aNodeDeque;
-#endif
+// whoever has need of the missing function should go and implement it!
+// This damned piece of code always breaks builds...
+//#ifdef DEBUG
+// ::std::clog << "<WriteText>" << ::std::endl;
+// ::std::clog << dbg_out(pCurPam->GetDoc()->GetNodes()) << ::std::endl;
+//
+// SwNodeHashSet aNodeSet;
+// SwNodeDeque aNodeDeque;
+//#endif
while( pCurPam->GetPoint()->nNode < pCurPam->GetMark()->nNode ||
( pCurPam->GetPoint()->nNode == pCurPam->GetMark()->nNode &&
@@ -2430,6 +2471,9 @@ void MSWordExportBase::WriteText()
{
SwNode * pNd = pCurPam->GetNode();
+// whoever has need of the missing function should go and implement it!
+// This damned piece of code always breaks builds...
+#if 0
#ifdef DEBUG
if (aNodeSet.find(pNd) == aNodeSet.end())
{
@@ -2441,6 +2485,7 @@ void MSWordExportBase::WriteText()
::std::clog << "<already-done>" << dbg_out(*pNd) << "</already-done>" << ::std::endl;
}
#endif
+#endif
if ( pNd->IsTxtNode() )
SectionBreaksAndFrames( *pNd->GetTxtNode() );
@@ -3775,7 +3820,9 @@ void MSWordExportBase::OutputStartNode( const SwStartNode & rNode)
void MSWordExportBase::OutputEndNode( const SwEndNode &rNode )
{
#ifdef DEBUG
- ::std::clog << "<OutWW8_SwEndNode>" << dbg_out(&rNode) << ::std::endl;
+// whoever has need of the missing function should go and implement it!
+// This piece of code always breaks builds...
+// ::std::clog << "<OutWW8_SwEndNode>" << dbg_out(&rNode) << ::std::endl;
#endif
ww8::WW8TableNodeInfo::Pointer_t pNodeInfo = mpTableInfo->getTableNodeInfo( &rNode );
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 64fc363fa294..3c2f0d4d6d13 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -190,12 +190,12 @@ protected:
MSWordSections& operator=( const MSWordSections& );
public:
MSWordSections( MSWordExportBase& rExport );
- ~MSWordSections();
+ virtual ~MSWordSections();
- void AppendSep( const SwPageDesc* pPd,
+ void AppendSection( const SwPageDesc* pPd,
const SwSectionFmt* pSectionFmt = 0,
ULONG nLnNumRestartNo = 0 );
- void AppendSep( const SwFmtPageDesc& rPd,
+ void AppendSection( const SwFmtPageDesc& rPd,
const SwNode& rNd,
const SwSectionFmt* pSectionFmt,
ULONG nLnNumRestartNo );
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index 3d200268731d..5d96a74b009d 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -99,9 +99,7 @@ using namespace nsFieldFlags;
void WW8Export::OutputGrfNode( const SwGrfNode& /*rNode*/ )
{
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "WW8Export::OutputGrfNode( const SwGrfNode& )\n" );
-#endif
+ OSL_TRACE("WW8Export::OutputGrfNode( const SwGrfNode& )\n" );
ASSERT( mpParentFrame, "frame not set!" );
if ( mpParentFrame )
{
@@ -221,9 +219,7 @@ bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet,
void WW8Export::OutputOLENode( const SwOLENode& rOLENode )
{
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "WW8Export::OutputOLENode( const SwOLENode& rOLENode )\n" );
-#endif
+ OSL_TRACE("WW8Export::OutputOLENode( const SwOLENode& rOLENode )\n" );
BYTE *pSpecOLE;
BYTE *pDataAdr;
short nSize;
@@ -607,7 +603,7 @@ void SwWW8WrGrf::WritePICFHeader(SvStream& rStrm, const sw::Frame &rFly,
substitute the final size and loose on retaining the scaling factor but
still keep the correct display size anyway.
*/
- if ( (aGrTwipSz.Width() > USHRT_MAX) || (aGrTwipSz.Height() > USHRT_MAX)
+ if ( (aGrTwipSz.Width() > SHRT_MAX) || (aGrTwipSz.Height() > SHRT_MAX)
|| (aGrTwipSz.Width() < 0 ) || (aGrTwipSz.Height() < 0) )
{
aGrTwipSz.Width() = nWidth;
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 2db25106d330..89aef162ec01 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1743,9 +1743,9 @@ static void InsertSpecialChar( WW8Export& rWrt, BYTE c,
aItems.GetData());
}
-String lcl_GetExpandedField(const SwField &rFld)
+String lcl_GetExpandedField(const SwField &rFld, SwDoc const& rDoc)
{
- String sRet(rFld.Expand());
+ String sRet(rFld.ExpandField(rDoc.IsClipBoard()));
//replace LF 0x0A with VT 0x0B
sRet.SearchAndReplaceAll(0x0A, 0x0B);
@@ -1871,7 +1871,7 @@ void WW8Export::OutputField( const SwField* pFld, ww::eField eFldType,
{
String sOut;
if( pFld )
- sOut = lcl_GetExpandedField(*pFld);
+ sOut = lcl_GetExpandedField(*pFld, *pDoc);
else
sOut = rFldCmd;
if( sOut.Len() )
@@ -2598,7 +2598,7 @@ void WW8AttributeOutput::RefField( const SwField &rFld, const String &rRef)
sStr.APPEND_CONST_ASC( "\" " );
m_rWW8Export.OutputField( &rFld, ww::eREF, sStr, WRITEFIELD_START |
WRITEFIELD_CMD_START | WRITEFIELD_CMD_END );
- String sVar = lcl_GetExpandedField( rFld );
+ String sVar = lcl_GetExpandedField( rFld, *GetExport().pDoc );
if ( sVar.Len() )
{
if ( m_rWW8Export.IsUnicode() )
@@ -2614,7 +2614,7 @@ void WW8AttributeOutput::RefField( const SwField &rFld, const String &rRef)
void WW8AttributeOutput::WriteExpand( const SwField* pFld )
{
- String sExpand( lcl_GetExpandedField( *pFld ) );
+ String sExpand( lcl_GetExpandedField( *pFld, *GetExport().pDoc ) );
if ( m_rWW8Export.IsUnicode() )
SwWW8Writer::WriteString16( m_rWW8Export.Strm(), sExpand, false );
else
@@ -5261,9 +5261,7 @@ void AttributeOutputBase::OutputItem( const SfxPoolItem& rHt )
break;
default:
-#if OSL_DEBUG_LEVEL > 0
- fprintf( stderr, "Unhandled SfxPoolItem with id %d.\n", rHt.Which() );
-#endif
+ OSL_TRACE("Unhandled SfxPoolItem with id %d.\n", rHt.Which() );
break;
}
}
diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx
index b9d9038b484b..b9d9ba38c246 100644
--- a/sw/source/filter/ww8/ww8attributeoutput.hxx
+++ b/sw/source/filter/ww8/ww8attributeoutput.hxx
@@ -124,6 +124,8 @@ public:
virtual void TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+ virtual void TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
+
virtual void TableRowEnd( sal_uInt32 nDepth = 1 );
/// Start of the styles table.
diff --git a/sw/source/filter/ww8/ww8graf.hxx b/sw/source/filter/ww8/ww8graf.hxx
index 502b1e8f95c7..12d168724cbd 100644
--- a/sw/source/filter/ww8/ww8graf.hxx
+++ b/sw/source/filter/ww8/ww8graf.hxx
@@ -30,12 +30,8 @@
#ifndef _WW8GRAF_HXX
#define _WW8GRAF_HXX
-#ifndef __SGI_STL_VECTOR
#include <vector>
-#endif
-#ifndef __SGI_STL_STACK
#include <stack>
-#endif
#include "writerhelper.hxx"
struct EscherShape
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 3cf85185b434..983bc9c73c77 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -573,60 +573,63 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
aSet.Put( SdrTextVertAdjustItem( eTVA ) );
aSet.Put( SdrTextHorzAdjustItem( eTHA ) );
- pObj->SetMergedItemSet(aSet);
- pObj->SetModel(pSdrModel);
+ if (pObj != NULL)
+ {
+ pObj->SetMergedItemSet(aSet);
+ pObj->SetModel(pSdrModel);
- if (bVerticalText && dynamic_cast< SdrTextObj* >( pObj ) )
- dynamic_cast< SdrTextObj* >( pObj )->SetVerticalWriting(sal_True);
+ if (bVerticalText && dynamic_cast< SdrTextObj* >( pObj ) )
+ dynamic_cast< SdrTextObj* >( pObj )->SetVerticalWriting(sal_True);
- if ( bIsSimpleDrawingTextBox )
- {
- if ( nTextRotationAngle )
+ if ( bIsSimpleDrawingTextBox )
{
- long nMinWH = rTextRect.GetWidth() < rTextRect.GetHeight() ?
- rTextRect.GetWidth() : rTextRect.GetHeight();
- nMinWH /= 2;
- Point aPivot(rTextRect.TopLeft());
- aPivot.X() += nMinWH;
- aPivot.Y() += nMinWH;
- double a = nTextRotationAngle * nPi180;
- pObj->NbcRotate(aPivot, nTextRotationAngle, sin(a), cos(a));
+ if ( nTextRotationAngle )
+ {
+ long nMinWH = rTextRect.GetWidth() < rTextRect.GetHeight() ?
+ rTextRect.GetWidth() : rTextRect.GetHeight();
+ nMinWH /= 2;
+ Point aPivot(rTextRect.TopLeft());
+ aPivot.X() += nMinWH;
+ aPivot.Y() += nMinWH;
+ double a = nTextRotationAngle * nPi180;
+ pObj->NbcRotate(aPivot, nTextRotationAngle, sin(a), cos(a));
+ }
}
- }
- if ( ( ( rObjData.nSpFlags & SP_FFLIPV ) || mnFix16Angle || nTextRotationAngle ) && dynamic_cast< SdrObjCustomShape* >( pObj ) )
- {
- SdrObjCustomShape* pCustomShape = dynamic_cast< SdrObjCustomShape* >( pObj );
+ if ( ( ( rObjData.nSpFlags & SP_FFLIPV ) || mnFix16Angle || nTextRotationAngle ) && dynamic_cast< SdrObjCustomShape* >( pObj ) )
+ {
+ SdrObjCustomShape* pCustomShape = dynamic_cast< SdrObjCustomShape* >( pObj );
- double fExtraTextRotation = 0.0;
- if ( mnFix16Angle && !( GetPropertyValue( DFF_Prop_FitTextToShape ) & 4 ) )
- { // text is already rotated, we have to take back the object rotation if DFF_Prop_RotateText is false
- fExtraTextRotation = -mnFix16Angle;
- }
- if ( rObjData.nSpFlags & SP_FFLIPV ) // sj: in ppt the text is flipped, whereas in word the text
- { // remains unchanged, so we have to take back the flipping here
- fExtraTextRotation += 18000.0; // because our core will flip text if the shape is flipped.
+ double fExtraTextRotation = 0.0;
+ if ( mnFix16Angle && !( GetPropertyValue( DFF_Prop_FitTextToShape ) & 4 ) )
+ { // text is already rotated, we have to take back the object rotation if DFF_Prop_RotateText is false
+ fExtraTextRotation = -mnFix16Angle;
+ }
+ if ( rObjData.nSpFlags & SP_FFLIPV ) // sj: in ppt the text is flipped, whereas in word the text
+ { // remains unchanged, so we have to take back the flipping here
+ fExtraTextRotation += 18000.0; // because our core will flip text if the shape is flipped.
+ }
+ fExtraTextRotation += nTextRotationAngle;
+ if ( !::basegfx::fTools::equalZero( fExtraTextRotation ) )
+ {
+ fExtraTextRotation /= 100.0;
+ SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+ const rtl::OUString sTextRotateAngle( RTL_CONSTASCII_USTRINGPARAM ( "TextRotateAngle" ) );
+ com::sun::star::beans::PropertyValue aPropVal;
+ aPropVal.Name = sTextRotateAngle;
+ aPropVal.Value <<= fExtraTextRotation;
+ aGeometryItem.SetPropertyValue( aPropVal );
+ pCustomShape->SetMergedItem( aGeometryItem );
+ }
}
- fExtraTextRotation += nTextRotationAngle;
- if ( !::basegfx::fTools::equalZero( fExtraTextRotation ) )
+ else if ( mnFix16Angle )
{
- fExtraTextRotation /= 100.0;
- SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
- const rtl::OUString sTextRotateAngle( RTL_CONSTASCII_USTRINGPARAM ( "TextRotateAngle" ) );
- com::sun::star::beans::PropertyValue aPropVal;
- aPropVal.Name = sTextRotateAngle;
- aPropVal.Value <<= fExtraTextRotation;
- aGeometryItem.SetPropertyValue( aPropVal );
- pCustomShape->SetMergedItem( aGeometryItem );
+ // rotate text with shape ?
+ double a = mnFix16Angle * nPi180;
+ pObj->NbcRotate( rObjData.aBoundRect.Center(), mnFix16Angle,
+ sin( a ), cos( a ) );
}
}
- else if ( mnFix16Angle )
- {
- // rotate text with shape ?
- double a = mnFix16Angle * nPi180;
- pObj->NbcRotate( rObjData.aBoundRect.Center(), mnFix16Angle,
- sin( a ), cos( a ) );
- }
}
else if( !pObj )
{
@@ -844,13 +847,35 @@ long lcl_GetTrueMargin(const SvxLRSpaceItem &rLR, const SwNumFmt &rFmt,
return nExtraListIndent > 0 ? nExtraListIndent : 0;
}
-void SyncIndentWithList(SvxLRSpaceItem &rLR, const SwNumFmt &rFmt)
+// --> OD 2010-05-06 #i103711#
+// --> OD 2010-05-11 #i105414#
+void SyncIndentWithList( SvxLRSpaceItem &rLR,
+ const SwNumFmt &rFmt,
+ const bool bFirstLineOfstSet,
+ const bool bLeftIndentSet )
{
- long nWantedFirstLinePos;
- long nExtraListIndent = lcl_GetTrueMargin(rLR, rFmt, nWantedFirstLinePos);
- rLR.SetTxtLeft(nWantedFirstLinePos - nExtraListIndent);
- rLR.SetTxtFirstLineOfst(0);
+ if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
+ {
+ long nWantedFirstLinePos;
+ long nExtraListIndent = lcl_GetTrueMargin(rLR, rFmt, nWantedFirstLinePos);
+ rLR.SetTxtLeft(nWantedFirstLinePos - nExtraListIndent);
+ rLR.SetTxtFirstLineOfst(0);
+ }
+ else if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
+ {
+ if ( !bFirstLineOfstSet && bLeftIndentSet &&
+ rFmt.GetFirstLineIndent() != 0 )
+ {
+ rLR.SetTxtFirstLineOfst( rFmt.GetFirstLineIndent() );
+ }
+ else if ( bFirstLineOfstSet && !bLeftIndentSet &&
+ rFmt.GetIndentAt() != 0 )
+ {
+ rLR.SetTxtLeft( rFmt.GetIndentAt() );
+ }
+ }
}
+// <--
const SwNumFmt* SwWW8FltControlStack::GetNumFmtFromStack(const SwPosition &rPos,
const SwTxtNode &rTxtNode)
@@ -907,16 +932,24 @@ void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
pNum = GetNumFmtFromStack(*aRegion.GetPoint(),
*pTxtNode);
if (!pNum)
+ {
pNum = GetNumFmtFromTxtNode(*pTxtNode);
+ }
- // --> OD 2008-06-03 #i86652#
-// if (pNum)
- if ( pNum &&
- pNum->GetPositionAndSpaceMode() ==
- SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
- // <--
+ if ( pNum )
{
- SyncIndentWithList(aNewLR, *pNum);
+ // --> OD 2010-05-06 #i103711#
+ const bool bFirstLineIndentSet =
+ ( rReader.maTxtNodesHavingFirstLineOfstSet.end() !=
+ rReader.maTxtNodesHavingFirstLineOfstSet.find( pNode ) );
+ // --> OD 2010-05-11 #i105414#
+ const bool bLeftIndentSet =
+ ( rReader.maTxtNodesHavingLeftIndentSet.end() !=
+ rReader.maTxtNodesHavingLeftIndentSet.find( pNode ) );
+ SyncIndentWithList( aNewLR, *pNum,
+ bFirstLineIndentSet,
+ bLeftIndentSet );
+ // <--
}
if (aNewLR == aOldLR)
@@ -1681,6 +1714,13 @@ void SwWW8ImplReader::Read_HdFtText(long nStart, long nLen, SwFrmFmt* pHdFtFmt)
*pPaM->GetPoint() = aTmpPos;
}
+
+bool SwWW8ImplReader::isValid_HdFt_CP(WW8_CP nHeaderCP) const
+{
+ //each CP of Plcfhdd MUST be less than FibRgLw97.ccpHdd
+ return (nHeaderCP < pWwFib->ccpHdr) ? true : false;
+}
+
bool SwWW8ImplReader::HasOwnHeaderFooter(BYTE nWhichItems, BYTE grpfIhdt,
int nSect)
{
@@ -1700,7 +1740,7 @@ bool SwWW8ImplReader::HasOwnHeaderFooter(BYTE nWhichItems, BYTE grpfIhdt,
else
{
pHdFt->GetTextPosExact( static_cast< short >(nNumber + (nSect+1)*6), start, nLen);
- bOk = ( 2 <= nLen );
+ bOk = ( 2 <= nLen ) && isValid_HdFt_CP(start);
}
if (bOk)
@@ -1752,7 +1792,7 @@ void SwWW8ImplReader::Read_HdFt(bool bIsTitle, int nSect,
else
{
pHdFt->GetTextPosExact( static_cast< short >(nNumber + (nSect+1)*6), start, nLen);
- bOk = ( 2 <= nLen );
+ bOk = ( 2 <= nLen ) && isValid_HdFt_CP(start);
}
bool bUseLeft
@@ -2443,6 +2483,7 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, long nEnd, long nCpOfs)
{
rPos = WW8_CP_MAX-10; // -> eof or other error
sPlainCharsBuf.ReleaseBufferAccess( 0 );
+ delete [] p8Bits;
return true;
}
@@ -2588,6 +2629,16 @@ bool SwWW8ImplReader::HandlePageBreakChar()
//itself ignores them in this case.
if (!nInTable)
{
+ //xushanchuan add for issue106569
+ BOOL IsTemp=TRUE;
+ SwTxtNode* pTemp = pPaM->GetNode()->GetTxtNode();
+ if ( pTemp && !( pTemp->GetTxt().Len() ) && ( bFirstPara || bFirstParaOfPage ) )
+ {
+ IsTemp = FALSE;
+ AppendTxtNode(*pPaM->GetPoint());
+ pTemp->SetAttr(*GetDfltAttr(RES_PARATR_NUMRULE));
+ }
+ //xushanchuan end
bPgSecBreak = true;
pCtrlStck->KillUnlockedAttrs(*pPaM->GetPoint());
/*
@@ -2596,7 +2647,9 @@ bool SwWW8ImplReader::HandlePageBreakChar()
paragraph end, but nevertheless, numbering (and perhaps other
similiar constructs) do not exist on the para.
*/
- if (!bWasParaEnd)
+ //xushanchuan add for issue106569
+ if (!bWasParaEnd && IsTemp)
+ //xushanchuan end
{
bParaEndAdded = true;
if (0 >= pPaM->GetPoint()->nContent.GetIndex())
@@ -2632,6 +2685,10 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs)
sal_Char cInsert = '\x0';
bool bRet = false;
+ //xushanchuan add for issue106569
+ if ( 0xc != nWCharVal )
+ bFirstParaOfPage = false;
+ //xushanchuan end
switch (nWCharVal)
{
case 0:
@@ -3148,6 +3205,7 @@ bool SwWW8ImplReader::ReadText(long nStartCp, long nTextLen, ManTypes nType)
// <--
rDoc.InsertPoolItem(*pPaM,
SvxFmtBreakItem(SVX_BREAK_PAGE_BEFORE, RES_BREAK), 0);
+ bFirstParaOfPage = true;//xushanchuan add for issue106569
bPgSecBreak = false;
}
}
@@ -3185,6 +3243,12 @@ SwWW8ImplReader::SwWW8ImplReader(BYTE nVersionPara, SvStorage* pStorage,
maGrfNameGenerator(bNewDoc,String('G')),
maParaStyleMapper(rD),
maCharStyleMapper(rD),
+ // --> OD 2010-05-06 #i103711#
+ maTxtNodesHavingFirstLineOfstSet(),
+ // <--
+ // --> OD 2010-05-11 #i105414#
+ maTxtNodesHavingLeftIndentSet(),
+ // <--
pMSDffManager(0),
mpAtnNames(0),
pAuthorInfos(0),
@@ -3239,6 +3303,7 @@ SwWW8ImplReader::SwWW8ImplReader(BYTE nVersionPara, SvStorage* pStorage,
bWasParaEnd = false;
bDropCap = false;
bFirstPara = true;
+ bFirstParaOfPage = false;//xushanchuan add for issue106569
bParaAutoBefore = false;
bParaAutoAfter = false;
nProgress = 0;
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 0473f3c1431e..025cf0f588f4 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -35,21 +35,11 @@
#include <editeng/frmdir.hxx>
#include <fltshell.hxx> // fuer den Attribut Stack
-#ifndef __SGI_STL_VECTOR
#include <vector>
-#endif
-#ifndef __SGI_STL_STACK
#include <stack>
-#endif
-#ifndef __SGI_STL_DEQUE
#include <deque>
-#endif
-#ifndef __SGI_STL_MAP
#include <map>
-#endif
-#ifndef __SGI_STL_UTILITY
#include <utility>
-#endif
#include "tracer.hxx"
#include "ww8struc.hxx" // WW8_BRC
@@ -956,6 +946,13 @@ private:
WW8PLCFMan* pPlcxMan;
std::map<short, String> aLinkStringMap;
+ // --> OD 2010-05-06 #i103711#
+ std::set<const SwNode*> maTxtNodesHavingFirstLineOfstSet;
+ // <--
+ // --> OD 2010-05-11 #i105414#
+ std::set<const SwNode*> maTxtNodesHavingLeftIndentSet;
+ // <--
+
WW8RStyle* pStyles; // Pointer auf die Style-Einleseklasse
SwFmt* pAktColl; // gerade zu erzeugende Collection
// ( ist ausserhalb einer Style-Def immer 0 )
@@ -1086,7 +1083,7 @@ private:
// the very 1st Line Numbering and ignore the rest)
bool bFirstPara; // first paragraph?
-
+ bool bFirstParaOfPage;//cs2c--xushanchuan add for bug11210
bool bParaAutoBefore;
bool bParaAutoAfter;
@@ -1112,6 +1109,8 @@ private:
void Read_HdFtTextAsHackedFrame(long nStart, long nLen,
SwFrmFmt &rHdFtFmt, sal_uInt16 nPageWidth);
+ bool isValid_HdFt_CP(WW8_CP nHeaderCP) const;
+
bool HasOwnHeaderFooter(BYTE nWhichItems, BYTE grpfIhdt, int nSect);
void HandleLineNumbering(const wwSection &rSection);
@@ -1155,7 +1154,12 @@ private:
void ImportTox( int nFldId, String aStr );
void EndSprm( USHORT nId );
- void NewAttr( const SfxPoolItem& rAttr );
+ // --> OD 2010-05-06 #i103711#
+ // --> OD 2010-05-11 #i105414#
+ void NewAttr( const SfxPoolItem& rAttr,
+ const bool bFirstLineOfStSet = false,
+ const bool bLeftIndentSet = false );
+ // <--
bool GetFontParams(USHORT, FontFamily&, String&, FontPitch&,
rtl_TextEncoding&);
@@ -1612,7 +1616,13 @@ public: // eigentlich private, geht aber leider nur public
bool CanUseRemoteLink(const String &rGrfName);
void UseListIndent(SwWW8StyInf &rStyle, const SwNumFmt &rFmt);
void SetStyleIndent(SwWW8StyInf &rStyleInfo, const SwNumFmt &rFmt);
-void SyncIndentWithList(SvxLRSpaceItem &rLR, const SwNumFmt &rFmt);
+// --> OD 2010-05-06 #i103711#
+// --> OD 2010-05-11 #i105414#
+void SyncIndentWithList( SvxLRSpaceItem &rLR,
+ const SwNumFmt &rFmt,
+ const bool bFirstLineOfStSet,
+ const bool bLeftIndentSet );
+// <--
long GetListFirstLineIndent(const SwNumFmt &rFmt);
String BookmarkToWriter(const String &rBookmark);
bool RTLGraphicsHack(SwTwips &rLeft, SwTwips nWidth,
diff --git a/sw/source/filter/ww8/ww8par2.hxx b/sw/source/filter/ww8/ww8par2.hxx
index b32fbf7f0037..71aa7022ed31 100644
--- a/sw/source/filter/ww8/ww8par2.hxx
+++ b/sw/source/filter/ww8/ww8par2.hxx
@@ -285,7 +285,6 @@ public:
const WW8SwFlyPara* pFS, bool bGraf);
WW8FlySet(SwWW8ImplReader& rReader, const SwPaM* pPaM, const WW8_PIC& rPic,
long nWidth, long nHeight);
- WW8FlySet(const SwWW8ImplReader& rReader, const SwPaM* pPaM);
};
enum WW8LvlType {WW8_None, WW8_Outline, WW8_Numbering, WW8_Sequence, WW8_Pause};
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 465d07c0d2b5..75454dddbc58 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -1697,7 +1697,12 @@ void SetStyleIndent(SwWW8StyInf &rStyle, const SwNumFmt &rFmt)
{
SvxLRSpaceItem aLR(ItemGet<SvxLRSpaceItem>(*rStyle.pFmt, RES_LR_SPACE));
if (rStyle.bListReleventIndentSet)
- SyncIndentWithList(aLR, rFmt);
+ {
+ // --> OD 2010-05-06 #i103711#
+ // --> OD 2010-05-11 #i105414#
+ SyncIndentWithList( aLR, rFmt, false, false );
+ // <--
+ }
else
{
aLR.SetTxtLeft(0);
@@ -2207,20 +2212,17 @@ void WW8FormulaControl::FormulaRead(SwWw8ControlType nWhich,
{
*pDataStream >> nDefaultChecked;
nChecked = nDefaultChecked;
- //Don't know the details yet
- switch (nHeaderByte)
+
+ sal_uInt8 iRes = (nHeaderByte >> 2) & 0x1F;
+ switch (iRes)
{
- case 0x65: //01100101
- //use defaults ?
+ case 1: //checked
+ nChecked = true;
break;
- case 0x1: //00000001
- //swap to unchecked from checked (#114841)?
+ case 25: //undefined, Undefined checkboxes are treated as unchecked
+ case 0: //unchecked
nChecked = false;
break;
- case 0x5: //00000101
- //change to checked
- nChecked = true;
- break;
default:
ASSERT(!this, "unknown option, please report to cmc");
break;
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 6dacf0d126fe..1588944e179b 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2265,12 +2265,6 @@ WW8FlySet::WW8FlySet( SwWW8ImplReader& rReader, const SwPaM* pPaM,
+ aSizeArray[WW8_BOT]) );
}
-WW8FlySet::WW8FlySet(const SwWW8ImplReader& rReader, const SwPaM* pPaM)
- : SfxItemSet(rReader.rDoc.GetAttrPool(),RES_FRMATR_BEGIN,RES_FRMATR_END-1)
-{
- Init(rReader, pPaM);
-}
-
void WW8FlySet::Init(const SwWW8ImplReader& rReader, const SwPaM* pPaM)
{
if (!rReader.mbNewDoc)
@@ -2716,7 +2710,9 @@ bool SwWW8ImplReader::TestSameApo(const ApoTestResults &rApo,
# Attribut - Verwaltung
#**************************************************************************/
-void SwWW8ImplReader::NewAttr( const SfxPoolItem& rAttr )
+void SwWW8ImplReader::NewAttr( const SfxPoolItem& rAttr,
+ const bool bFirstLineOfStSet,
+ const bool bLeftIndentSet )
{
if( !bNoAttrImport ) // zum Ignorieren von Styles beim Doc-Einfuegen
{
@@ -2726,11 +2722,31 @@ void SwWW8ImplReader::NewAttr( const SfxPoolItem& rAttr )
pAktColl->SetFmtAttr(rAttr);
}
else if (pAktItemSet)
+ {
pAktItemSet->Put(rAttr);
+ }
else if (rAttr.Which() == RES_FLTR_REDLINE)
+ {
mpRedlineStack->open(*pPaM->GetPoint(), rAttr);
+ }
else
+ {
pCtrlStck->NewAttr(*pPaM->GetPoint(), rAttr);
+ // --> OD 2010-05-06 #i103711#
+ if ( bFirstLineOfStSet )
+ {
+ const SwNode* pNd = &(pPaM->GetPoint()->nNode.GetNode());
+ maTxtNodesHavingFirstLineOfstSet.insert( pNd );
+ }
+ // <--
+ // --> OD 2010-05-11 #i105414#
+ if ( bLeftIndentSet )
+ {
+ const SwNode* pNd = &(pPaM->GetPoint()->nNode.GetNode());
+ maTxtNodesHavingLeftIndentSet.insert( pNd );
+ }
+ // <--
+ }
if (mpPostProcessAttrsInfo && mpPostProcessAttrsInfo->mbCopy)
mpPostProcessAttrsInfo->mItemSet.Put(rAttr);
@@ -3959,6 +3975,13 @@ void SwWW8ImplReader::Read_LR( USHORT nId, const BYTE* pData, short nLen )
}
}
+ // --> OD 2010-05-06 #i103711#
+ bool bFirstLinOfstSet( false );
+ // <--
+ // --> OD 2010-05-11 #i105414#
+ bool bLeftIndentSet( false );
+ // <--
+
switch (nId)
{
//sprmPDxaLeft
@@ -3967,7 +3990,12 @@ void SwWW8ImplReader::Read_LR( USHORT nId, const BYTE* pData, short nLen )
case 0x845E:
aLR.SetTxtLeft( nPara );
if (pAktColl)
+ {
pCollA[nAktColl].bListReleventIndentSet = true;
+ }
+ // --> OD 2010-05-11 #i105414#
+ bLeftIndentSet = true;
+ // <--
break;
//sprmPDxaLeft1
case 19:
@@ -3999,7 +4027,12 @@ void SwWW8ImplReader::Read_LR( USHORT nId, const BYTE* pData, short nLen )
aLR.SetTxtFirstLineOfst(nPara);
if (pAktColl)
+ {
pCollA[nAktColl].bListReleventIndentSet = true;
+ }
+ // --> OD 2010-05-06 #i103711#
+ bFirstLinOfstSet = true;
+ // <--
break;
//sprmPDxaRight
case 16:
@@ -4011,7 +4044,10 @@ void SwWW8ImplReader::Read_LR( USHORT nId, const BYTE* pData, short nLen )
return;
}
- NewAttr(aLR);
+ // --> OD 2010-05-06 #i103711#
+ // --> OD 2010-05-11 #i105414#
+ NewAttr( aLR, bFirstLinOfstSet, bLeftIndentSet );
+ // <--
}
// Sprm 20
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 8dd77f5bea7b..d318522100cf 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -32,6 +32,7 @@
#include <functional>
+#include <algorithm>
#include <string.h> // memset()
#include <rtl/tencinfo.h>
@@ -2121,7 +2122,7 @@ xub_StrLen WW8ScannerBase::WW8ReadString( SvStream& rStrm, String& rStr,
// Bei nStartPos < 0 wird das erste Element des PLCFs genommen
WW8PLCFspecial::WW8PLCFspecial(SvStream* pSt, long nFilePos, long nPLCF,
- long nStruct, long nStartPos, bool bNoEnd)
+ long nStruct, long nStartPos)
: nIdx(0), nStru(nStruct)
{
nIMax = ( nPLCF - 4 ) / ( 4 + nStruct );
@@ -2137,8 +2138,6 @@ WW8PLCFspecial::WW8PLCFspecial(SvStream* pSt, long nFilePos, long nPLCF,
pPLCF_PosArray[nIdx] = SWAPLONG( pPLCF_PosArray[nIdx] );
nIdx = 0;
#endif // OSL_BIGENDIAN
- if( bNoEnd )
- nIMax++;
if( nStruct ) // Pointer auf Inhalts-Array
pPLCF_Contents = (BYTE*)&pPLCF_PosArray[nIMax + 1];
else
@@ -4004,8 +4003,7 @@ WW8PLCFx_Book::WW8PLCFx_Book(SvStream* pTblSt, const WW8Fib& rFib)
{
pBook[0] = new WW8PLCFspecial(pTblSt,rFib.fcPlcfbkf,rFib.lcbPlcfbkf,4);
- pBook[1] = new WW8PLCFspecial( pTblSt, rFib.fcPlcfbkl, rFib.lcbPlcfbkl,
- 0, -1, true);
+ pBook[1] = new WW8PLCFspecial(pTblSt,rFib.fcPlcfbkl,rFib.lcbPlcfbkl,0);
rtl_TextEncoding eStructChrSet = WW8Fib::GetFIBCharset(rFib.chseTables);
@@ -6400,8 +6398,10 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
#ifdef __WW8_NEEDS_COPY
{
BYTE nLen = 0x28;
+ BYTE nLength = sizeof( pVer8->szFfn ) / sizeof( SVBT16 );
+ nLength = std::min( nLength, BYTE( pVer8->cbFfnM1+1 ) );
for( UINT16* pTmp = pVer8->szFfn;
- nLen < pVer8->cbFfnM1 + 1 ; ++pTmp, nLen+=2 )
+ nLen < nLength; ++pTmp, nLen+=2 )
{
*pTmp = SVBT16ToShort( *(SVBT16*)pTmp );
}
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index 922edf7b0179..33d40bcf4c0d 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -220,7 +220,7 @@ private:
long nStru;
public:
WW8PLCFspecial( SvStream* pSt, long nFilePos, long nPLCF,
- long nStruct, long nStartPos = -1, bool bNoEnd = false);
+ long nStruct, long nStartPos = -1 );
~WW8PLCFspecial() { delete[] pPLCF_PosArray; }
long GetIdx() const { return nIdx; }
void SetIdx( long nI ) { nIdx = nI; }
@@ -382,6 +382,7 @@ private:
public:
WW8PLCFx(ww::WordVersion eVersion, bool bSprm)
: meVer(eVersion), bIsSprm(bSprm), bDirty(false) {}
+ virtual ~WW8PLCFx() {}
bool IsSprm() const { return bIsSprm; }
virtual ULONG GetIdx() const = 0;
virtual void SetIdx( ULONG nIdx ) = 0;
diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx
index c78d422a397c..653208aaf250 100644
--- a/sw/source/ui/app/apphdl.cxx
+++ b/sw/source/ui/app/apphdl.cxx
@@ -765,23 +765,28 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
DELETEZ(pWebToolbarConfig) ;
DELETEZ(pAuthorNames) ;
DELETEZ(pDBConfig);
- if (pColorConfig != 0) {
+ if( pColorConfig )
+ {
pColorConfig->RemoveListener(this);
DELETEZ(pColorConfig);
}
- if (pAccessibilityOptions != 0) {
+ if( pAccessibilityOptions )
+ {
pAccessibilityOptions->RemoveListener(this);
DELETEZ(pAccessibilityOptions);
}
- if (pCTLOptions != 0) {
+ if( pCTLOptions )
+ {
pCTLOptions->RemoveListener(this);
DELETEZ(pCTLOptions);
}
- if (pUserOptions != 0) {
+ if( pUserOptions )
+ {
pUserOptions->RemoveListener(this);
DELETEZ(pUserOptions);
}
- if (pUndoOptions != 0) {
+ if( pUndoOptions )
+ {
pUndoOptions->RemoveListener(this);
DELETEZ(pUndoOptions);
}
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index 34ccac06a256..c3f6585e325e 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -101,7 +101,6 @@
#include <cmdid.h>
#include <globals.hrc>
#include <app.hrc>
-#include "warnpassword.hxx"
#include <cfgid.h>
#include <unotools/moduleoptions.hxx>
diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx
index 8d451be1c8cb..4bf8238ade61 100644
--- a/sw/source/ui/app/swmodule.cxx
+++ b/sw/source/ui/app/swmodule.cxx
@@ -59,13 +59,13 @@
#include <svx/tbxcolor.hxx>
#include <svx/clipboardctl.hxx>
#include <svx/lboxctrl.hxx>
-#include <svx/extrusioncontrols.hxx>
#include <svx/hyprlink.hxx>
#include <svx/tbxcustomshapes.hxx>
-#include <svx/fontworkgallery.hxx>
#include <svx/imapdlg.hxx>
#include <svx/srchdlg.hxx>
#include <svx/hyperdlg.hxx>
+#include <svx/extrusioncolorcontrol.hxx>
+#include <svx/fontworkgallery.hxx>
#include <com/sun/star/scanner/XScannerManager.hpp>
#include <com/sun/star/container/XSet.hpp>
#include <comphelper/processfactory.hxx>
@@ -379,15 +379,8 @@ void SwDLL::RegisterControls()
SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_CALLOUT, pMod );
SvxTbxCtlCustomShapes::RegisterControl( SID_DRAWTBX_CS_STAR, pMod );
- svx::ExtrusionDepthControl::RegisterControl( SID_EXTRUSION_DEPTH_FLOATER, pMod );
- svx::ExtrusionDirectionControl::RegisterControl( SID_EXTRUSION_DIRECTION_FLOATER, pMod );
- svx::ExtrusionLightingControl::RegisterControl( SID_EXTRUSION_LIGHTING_FLOATER, pMod );
- svx::ExtrusionSurfaceControl::RegisterControl( SID_EXTRUSION_SURFACE_FLOATER, pMod );
svx::ExtrusionColorControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod );
-
svx::FontWorkShapeTypeControl::RegisterControl( SID_FONTWORK_SHAPE_TYPE, pMod );
- svx::FontWorkAlignmentControl::RegisterControl( SID_FONTWORK_ALIGNMENT_FLOATER, pMod );
- svx::FontWorkCharacterSpacingControl::RegisterControl( SID_FONTWORK_CHARACTER_SPACING_FLOATER, pMod );
SvxClipBoardControl::RegisterControl(SID_PASTE, pMod );
SvxUndoRedoControl::RegisterControl(SID_UNDO, pMod );
@@ -470,12 +463,6 @@ void SwDLL::RegisterControls()
SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_LEFT_TO_RIGHT, pMod);
SvxCTLTextTbxCtrl::RegisterControl(SID_ATTR_PARA_RIGHT_TO_LEFT, pMod);
- svx::ExtrusionDepthControl::RegisterControl( SID_EXTRUSION_DEPTH_FLOATER, pMod );
- svx::ExtrusionDirectionControl::RegisterControl( SID_EXTRUSION_DIRECTION_FLOATER, pMod );
- svx::ExtrusionLightingControl::RegisterControl( SID_EXTRUSION_LIGHTING_FLOATER, pMod );
- svx::ExtrusionSurfaceControl::RegisterControl( SID_EXTRUSION_SURFACE_FLOATER, pMod );
- svx::ExtrusionColorControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod );
-
GalleryChildWindow::RegisterChildWindow(0, pMod);
::avmedia::MediaToolBoxControl::RegisterControl(SID_AVMEDIA_TOOLBOX, pMod);
diff --git a/sw/source/ui/cctrl/makefile.mk b/sw/source/ui/cctrl/makefile.mk
index c724f287fc3a..33ba83f34d7c 100644
--- a/sw/source/ui/cctrl/makefile.mk
+++ b/sw/source/ui/cctrl/makefile.mk
@@ -50,6 +50,9 @@ SLOFILES = \
$(SLO)$/popbox.obj \
$(SLO)$/swlbox.obj
+EXCEPTIONSFILES = \
+ $(SLO)$/popbox.obj
+
# --- Tagets -------------------------------------------------------
.INCLUDE : target.mk
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 97930582ce5a..921d2a652002 100755
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -542,10 +542,15 @@ void SwAddPrinterTabPage::Reset( const SfxItemSet& )
aFaxLB.SelectEntry( pAddPrinterAttr->sFaxName );
}
if (aProspectCB.IsChecked())
+ {
aProspectCB_RTL.Enable(TRUE);
+ aNoRB.Enable( FALSE );
+ aOnlyRB.Enable( FALSE );
+ aEndRB.Enable( FALSE );
+ aEndPageRB.Enable( FALSE );
+ }
else
- aProspectCB_RTL.Disable();
-
+ aProspectCB_RTL.Enable( FALSE );
}
//-----------------------------------------------------------------------
@@ -560,13 +565,14 @@ void SwAddPrinterTabPage::Init()
IMPL_LINK_INLINE_START( SwAddPrinterTabPage, AutoClickHdl, CheckBox *, EMPTYARG )
{
bAttrModified = TRUE;
- if (aProspectCB.IsChecked())
- aProspectCB_RTL.Enable(TRUE);
- else
- {
+ bool bIsProspect = aProspectCB.IsChecked();
+ if (!bIsProspect)
aProspectCB_RTL.Check( FALSE );
- aProspectCB_RTL.Disable();
- }
+ aProspectCB_RTL.Enable( bIsProspect );
+ aNoRB.Enable( !bIsProspect );
+ aOnlyRB.Enable( !bIsProspect );
+ aEndRB.Enable( !bIsProspect );
+ aEndPageRB.Enable( !bIsProspect );
return 0;
}
IMPL_LINK_INLINE_END( SwAddPrinterTabPage, AutoClickHdl, CheckBox *, EMPTYARG )
diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx
index 73e5d69d7764..13cec2b93bb5 100644
--- a/sw/source/ui/config/viewopt.cxx
+++ b/sw/source/ui/config/viewopt.cxx
@@ -112,6 +112,7 @@ BOOL SwViewOption::IsEqualFlags( const SwViewOption &rOpt ) const
&& bFormView == rOpt.IsFormView()
&& mbViewLayoutBookMode == rOpt.mbViewLayoutBookMode
&& bShowPlaceHolderFields == rOpt.bShowPlaceHolderFields
+ && bIdle == rOpt.bIdle
#ifdef DBG_UTIL
// korrespondieren zu den Angaben in ui/config/cfgvw.src
&& bTest1 == rOpt.IsTest1()
@@ -226,7 +227,7 @@ SwViewOption::SwViewOption() :
{
// Initialisierung ist jetzt etwas einfacher
// alle Bits auf 0
- nCoreOptions = VIEWOPT_1_IDLE | VIEWOPT_1_HARDBLANK | VIEWOPT_1_SOFTHYPH |
+ nCoreOptions = VIEWOPT_1_HARDBLANK | VIEWOPT_1_SOFTHYPH |
VIEWOPT_1_REF |
VIEWOPT_1_GRAPHIC |
VIEWOPT_1_TABLE | VIEWOPT_1_DRAW | VIEWOPT_1_CONTROL |
@@ -243,6 +244,8 @@ SwViewOption::SwViewOption() :
bSelectionInReadonly = SW_MOD()->GetAccessibilityOptions().IsSelectionInReadonly();
+ bIdle = true;
+
#ifdef DBG_UTIL
// korrespondieren zu den Angaben in ui/config/cfgvw.src
bTest1 = bTest2 = bTest3 = bTest4 =
@@ -277,6 +280,7 @@ SwViewOption::SwViewOption(const SwViewOption& rVOpt)
bBookview = rVOpt.bBookview;
mbViewLayoutBookMode = rVOpt.mbViewLayoutBookMode;
bShowPlaceHolderFields = rVOpt.bShowPlaceHolderFields;
+ bIdle = rVOpt.bIdle;
#ifdef DBG_UTIL
bTest1 = rVOpt.bTest1 ;
@@ -317,6 +321,7 @@ SwViewOption& SwViewOption::operator=( const SwViewOption &rVOpt )
bBookview = rVOpt.bBookview;
mbViewLayoutBookMode = rVOpt.mbViewLayoutBookMode;
bShowPlaceHolderFields = rVOpt.bShowPlaceHolderFields;
+ bIdle = rVOpt.bIdle;
#ifdef DBG_UTIL
bTest1 = rVOpt.bTest1 ;
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 97455d9e2514..9e62f7a4de36 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -33,15 +33,10 @@
#include "dbinsdlg.hxx"
-#ifndef INCLUDED_MEMORY
#include <memory>
-#define INCLUDED_MEMORY
-#endif
-#ifndef INCLUDED_FLOAT_H
#include <float.h>
-#define INCLUDED_FLOAT_H
-#endif
+
#include <hintids.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -65,9 +60,7 @@
#include <svl/stritem.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
-#ifndef __SV_MNEMONIC_HXX
#include <vcl/mnemonic.hxx>
-#endif
#include <svl/style.hxx>
#include <svl/zformat.hxx>
#include <svx/htmlmode.hxx>
@@ -78,24 +71,16 @@
#include <editeng/boxitem.hxx>
#include <svx/rulritem.hxx>
#include <swdbtoolsclient.hxx>
-#ifndef _SWTABLEREP_HXX //autogen
#include <tabledlg.hxx>
-#endif
#include <fmtclds.hxx>
#include <tabcol.hxx>
#include <uiitems.hxx>
#include <viewopt.hxx>
#include <uitool.hxx>
#include <wrtsh.hxx>
-#ifndef _WVIEW_HXX
#include <wview.hxx>
-#endif
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <tblafmt.hxx>
#include <cellatr.hxx>
#include <swtable.hxx>
@@ -108,19 +93,11 @@
#include <poolfmt.hxx>
#include <crsskip.hxx>
-#ifndef _DBINSDLG_HRC
#include <dbinsdlg.hrc>
-#endif
-#ifndef _DBUI_HRC
#include <dbui.hrc>
-#endif
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
#include <cfgid.h>
#include <SwStyleNameMapper.hxx>
#include <comphelper/uno3.hxx>
@@ -1380,8 +1357,8 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
case _DB_Column::DB_COL_FIELD:
{
- SwDBField* pFld = (SwDBField*)pDBCol->DB_ColumnData.
- pField->Copy();
+ SwDBField *const pFld = static_cast<SwDBField *>(
+ pDBCol->DB_ColumnData.pField->CopyField());
double nValue = DBL_MAX;
Reference< XPropertySet > xColumnProps;
@@ -1934,7 +1911,7 @@ void SwInsertDBColAutoPilot::Load()
SwInsDBColumn& rSet = *aDBColumns[ n ];
for( USHORT m = 0; m < pNewData->aDBColumns.Count() ; ++m )
{
- const SwInsDBColumn& rGet = *pNewData->aDBColumns[ m ];
+ SwInsDBColumn& rGet = *pNewData->aDBColumns[ m ];
if(rGet.sColumn == rSet.sColumn)
{
if( rGet.bHasFmt && !rGet.bIsDBFmt )
@@ -1946,8 +1923,10 @@ void SwInsertDBColAutoPilot::Load()
{
xub_StrLen nCheckPos;
short nType;
- rNFmtr.PutEntry( (String&)rGet.sUsrNumFmt, nCheckPos, nType,
+ String sTmpFmt = rGet.sUsrNumFmt;
+ rNFmtr.PutEntry( sTmpFmt, nCheckPos, nType,
rSet.nUsrNumFmt, rGet.eUsrNumFmtLng );
+ rGet.sUsrNumFmt = sTmpFmt;
}
}
break;
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index 8ad861713e0a..cf894f8728c4 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -2907,9 +2907,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
}
else
{
- SwDoc* pNewDoc = rSourceView.GetDocShell()->GetDoc()->CreateCopy();
- xWorkDocSh = new SwDocShell( pNewDoc, SFX_CREATE_MODE_STANDARD );
- xWorkDocSh->DoInitNew();
+ xWorkDocSh = rSourceView.GetDocShell()->GetDoc()->CreateCopy(true);
}
//create a ViewFrame
SwView* pWorkView = static_cast< SwView* >( SfxViewFrame::LoadHiddenDocument( *xWorkDocSh, 0 )->GetViewShell() );
@@ -3032,8 +3030,9 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
pTargetShell->SttDoc();
//
}
- catch( Exception& )
+ catch( Exception& rEx)
{
+ (void)rEx;
DBG_ERROR("exception caught in SwNewDBMgr::MergeDocuments");
}
DELETEZ(pImpl->pMergeData);
diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
index 8bf658d504b0..c9e99979e66b 100644
--- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
@@ -32,13 +32,13 @@
#include <vcl/msgbox.hxx>
#include <editeng/svxacorr.hxx>
#include <editeng/acorrcfg.hxx>
-#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
-#endif
#include <sfx2/app.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <editeng/unolingu.hxx>
+#include <editeng/editeng.hxx>
+#include <editeng/editview.hxx>
#include <wrtsh.hxx>
#include <sfx2/printer.hxx>
#include <svx/svdoutl.hxx>
@@ -56,9 +56,7 @@
#include <pam.hxx>
#include <drawbase.hxx>
#include <unotextrange.hxx>
-#ifndef _DIALOG_HXX
#include <dialog.hrc>
-#endif
#include <cmdid.h>
@@ -202,12 +200,19 @@ SfxChildWinInfo SwSpellDialogChildWindow::GetInfo (void) const
-----------------------------------------------------------------------*/
-svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void)
+svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence(bool bRecheck)
{
svx::SpellPortions aRet;
SwWrtShell* pWrtShell = GetWrtShell_Impl();
if(pWrtShell)
{
+ if (!bRecheck)
+ {
+ // first set continuation point for spell/grammar check to the
+ // end of the current sentence
+ pWrtShell->MoveContinuationPosToEndOfCheckedSentence();
+ }
+
ShellModes eSelMode = pWrtShell->GetView().GetShellMode();
bool bDrawText = SHELL_MODE_DRAWTEXT == eSelMode;
bool bNormalText =
@@ -239,7 +244,10 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void)
if(!pWrtShell->HasSelection())
pWrtShell->GoStartSentence();
else
+ {
+ pWrtShell->ExpandToSentenceBorders();
m_pSpellState->m_bStartedInSelection = true;
+ }
//determine if the selection is outside of the body text
bOtherText = !(pWrtShell->GetFrmType(0,sal_True) & FRMTYPE_BODY);
m_pSpellState->m_SpellStartPosition = bOtherText ? SPELL_START_OTHER : SPELL_START_BODY;
@@ -269,7 +277,24 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void)
m_pSpellState->m_SpellStartPosition = SPELL_START_DRAWTEXT;
m_pSpellState->m_pStartDrawing = pSdrView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
- m_pSpellState->m_aStartDrawingSelection = pOLV->GetSelection();
+ // start checking at the top of the drawing object
+ pOLV->SetSelection( ESelection() );
+ m_pSpellState->m_aStartDrawingSelection = ESelection();
+/*
+Note: spelling in a selection only, or starting in a mid of a drawing object requires
+further changes elsewhere. (Especially if it should work in sc and sd as well.)
+The code below would only be part of the solution.
+(Keeping it a as a comment for the time being)
+ ESelection aCurSel( pOLV->GetSelection() );
+ ESelection aSentenceSel( pOLV->GetEditView().GetEditEngine()->SelectSentence( aCurSel ) );
+ if (!aCurSel.HasRange())
+ {
+ aSentenceSel.nEndPara = aSentenceSel.nStartPara;
+ aSentenceSel.nEndPos = aSentenceSel.nStartPos;
+ }
+ pOLV->SetSelection( aSentenceSel );
+ m_pSpellState->m_aStartDrawingSelection = aSentenceSel;
+*/
}
m_pSpellState->m_bInitialCall = false;
@@ -316,61 +341,66 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void)
//spell inside of the Writer text
if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn))
{
- //find out which text has been spelled body or other
- bOtherText = !(pWrtShell->GetFrmType(0,sal_True) & FRMTYPE_BODY);
- if(bOtherText && m_pSpellState->m_bStartedInOther && m_pSpellState->pOtherCursor)
+ // if there is a selection (within body or header/footer text)
+ // then spell/grammar checking should not move outside of it.
+ if (!m_pSpellState->m_bStartedInSelection)
{
- m_pSpellState->m_bStartedInOther = false;
- pWrtShell->SetSelection(*m_pSpellState->pOtherCursor);
- pWrtShell->SpellEnd();
- delete m_pSpellState->pOtherCursor;
- m_pSpellState->pOtherCursor = 0;
- pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_CURR, DOCPOS_OTHERSTART, FALSE );
- pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn);
- }
- if(!aRet.size())
- {
- //end spelling
- pWrtShell->SpellEnd();
- if(bOtherText)
+ //find out which text has been spelled body or other
+ bOtherText = !(pWrtShell->GetFrmType(0,sal_True) & FRMTYPE_BODY);
+ if(bOtherText && m_pSpellState->m_bStartedInOther && m_pSpellState->pOtherCursor)
{
- m_pSpellState->m_bOtherSpelled = true;
- //has the body been spelled?
- if(!m_pSpellState->m_bBodySpelled)
+ m_pSpellState->m_bStartedInOther = false;
+ pWrtShell->SetSelection(*m_pSpellState->pOtherCursor);
+ pWrtShell->SpellEnd();
+ delete m_pSpellState->pOtherCursor;
+ m_pSpellState->pOtherCursor = 0;
+ pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_CURR, DOCPOS_OTHERSTART, FALSE );
+ pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn);
+ }
+ if(!aRet.size())
+ {
+ //end spelling
+ pWrtShell->SpellEnd();
+ if(bOtherText)
{
- pWrtShell->SpellStart(DOCPOS_START, DOCPOS_END, DOCPOS_START, FALSE );
- if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn))
+ m_pSpellState->m_bOtherSpelled = true;
+ //has the body been spelled?
+ if(!m_pSpellState->m_bBodySpelled)
{
- m_pSpellState->m_bBodySpelled = true;
- pWrtShell->SpellEnd();
+ pWrtShell->SpellStart(DOCPOS_START, DOCPOS_END, DOCPOS_START, FALSE );
+ if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn))
+ {
+ m_pSpellState->m_bBodySpelled = true;
+ pWrtShell->SpellEnd();
+ }
}
}
+ else
+ {
+ m_pSpellState->m_bBodySpelled = true;
+ if(!m_pSpellState->m_bOtherSpelled && pWrtShell->HasOtherCnt())
+ {
+ pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_OTHEREND, DOCPOS_OTHERSTART, FALSE );
+ if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn))
+ {
+ pWrtShell->SpellEnd();
+ m_pSpellState->m_bOtherSpelled = true;
+ }
+ }
+ else
+ m_pSpellState->m_bOtherSpelled = true;
+ }
}
- else
+
+ //search for a draw text object that contains error and spell it
+ if(!aRet.size() &&
+ (m_pSpellState->m_bDrawingsSpelled ||
+ !FindNextDrawTextError_Impl(*pWrtShell) || !SpellDrawText_Impl(*pWrtShell, aRet)))
{
- m_pSpellState->m_bBodySpelled = true;
- if(!m_pSpellState->m_bOtherSpelled && pWrtShell->HasOtherCnt())
- {
- pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_OTHEREND, DOCPOS_OTHERSTART, FALSE );
- if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn))
- {
- pWrtShell->SpellEnd();
- m_pSpellState->m_bOtherSpelled = true;
- }
- }
- else
- m_pSpellState->m_bOtherSpelled = true;
+ lcl_LeaveDrawText(*pWrtShell);
+ m_pSpellState->m_bDrawingsSpelled = true;
}
}
-
- //search for a draw text object that contains error and spell it
- if(!aRet.size() &&
- (m_pSpellState->m_bDrawingsSpelled ||
- !FindNextDrawTextError_Impl(*pWrtShell) || !SpellDrawText_Impl(*pWrtShell, aRet)))
- {
- lcl_LeaveDrawText(*pWrtShell);
- m_pSpellState->m_bDrawingsSpelled = true;
- }
}
}
// now only the rest of the body text can be spelled -
@@ -430,7 +460,7 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void)
/*-- 09.09.2003 10:39:40---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwSpellDialogChildWindow::ApplyChangedSentence(const svx::SpellPortions& rChanged)
+void SwSpellDialogChildWindow::ApplyChangedSentence(const svx::SpellPortions& rChanged, bool bRecheck)
{
SwWrtShell* pWrtShell = GetWrtShell_Impl();
DBG_ASSERT(!m_pSpellState->m_bInitialCall, "ApplyChangedSentence in initial call or after resume");
@@ -443,13 +473,19 @@ void SwSpellDialogChildWindow::ApplyChangedSentence(const svx::SpellPortions& rC
SHELL_MODE_LIST_TEXT == eSelMode ||
SHELL_MODE_TABLE_LIST_TEXT == eSelMode ||
SHELL_MODE_TEXT == eSelMode;
+
+ // evaluate if the same sentence should be rechecked or not.
+ // Sentences that got grammar checked should always be rechecked in order
+ // to detect possible errors that get introduced with the changes
+ bRecheck |= pWrtShell->HasLastSentenceGotGrammarChecked();
+
if(bNormalText)
- pWrtShell->ApplyChangedSentence(rChanged, m_bIsGrammarCheckingOn);
+ pWrtShell->ApplyChangedSentence(rChanged, bRecheck);
else if(bDrawText )
{
SdrView* pDrView = pWrtShell->GetDrawView();
SdrOutliner *pOutliner = pDrView->GetTextEditOutliner();
- pOutliner->ApplyChangedSentence(pDrView->GetTextEditOutlinerView()->GetEditView(), rChanged, m_bIsGrammarCheckingOn);
+ pOutliner->ApplyChangedSentence(pDrView->GetTextEditOutlinerView()->GetEditView(), rChanged, bRecheck);
}
}
}
@@ -847,7 +883,7 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh)
Point aTmp( 0,0 );
rSh.SelectObj( aTmp, 0, pTextObj );
SdrPageView* pPV = pDrView->GetSdrPageView();
- rView.BeginTextEdit( pTextObj, pPV, &rView.GetEditWin(), FALSE );
+ rView.BeginTextEdit( pTextObj, pPV, &rView.GetEditWin(), FALSE, TRUE );
rView.AttrChangedNotify(&rSh);
bNextDoc = true;
}
diff --git a/sw/source/ui/dochdl/dochdl.src b/sw/source/ui/dochdl/dochdl.src
index 8ecccb5395cb..f92ea43681d8 100644..100755
--- a/sw/source/ui/dochdl/dochdl.src
+++ b/sw/source/ui/dochdl/dochdl.src
@@ -73,13 +73,4 @@ String STR_DDEFORMAT
{
Text [ en-US ] = "DDE link" ;
};
-Bitmap BMP_SW_TEAM_MUGSHOT
-{
- File ="writerteam.bmp";
-};
-
-String STR_SW_TEAM_NAMES
-{
- Text = "Back row: Aidan Butler, Hans-Peter Burow, Caolan McNamara, Michael Brauer, Martin Maher, Gunnar Timm\nFront row: Thomas Lange, Oliver-Rainer Duesterhoeft, Henning Brinkmann, Andreas Martens, Oliver Specht, Frank Meies, Daniel Vogelheim";
-};
diff --git a/sw/source/ui/dochdl/gloshdl.cxx b/sw/source/ui/dochdl/gloshdl.cxx
index 5cb1df8a9ebb..cc789d6e4498 100644..100755
--- a/sw/source/ui/dochdl/gloshdl.cxx
+++ b/sw/source/ui/dochdl/gloshdl.cxx
@@ -607,48 +607,9 @@ BOOL SwGlossaryHdl::Expand( const String& rShortName,
aShortName.Erase(nMaxLen);
aShortName.AppendAscii(" ...");
}
- if ( aShortName.EqualsAscii ( "StarWriterTeam", 0, 14 ) )
- {
- String sGraphicName ( RTL_CONSTASCII_USTRINGPARAM ( "StarWriter team photo" ) );
- String sTeamCredits ( RTL_CONSTASCII_USTRINGPARAM ( "StarWriter team credits" ) );
- pWrtShell->StartUndo ( UNDO_INSGLOSSARY );
- pWrtShell->StartAllAction();
- if(pWrtShell->HasSelection())
- pWrtShell->DelLeft();
- Bitmap aBitmap ( SW_RES ( BMP_SW_TEAM_MUGSHOT ) );
- pWrtShell->Insert ( aEmptyStr, aEmptyStr, aBitmap);
- pWrtShell->SetFlyName ( sGraphicName );
- SwTxtFmtColl* pColl = pWrtShell->GetTxtCollFromPool ( RES_POOLCOLL_LABEL_ABB );
- const IDocumentFieldsAccess* pIDFA = pWrtShell->getIDocumentFieldsAccess();
- SwFieldType* pType = pIDFA->GetFldType( RES_SETEXPFLD, pColl->GetName(), false );
- sal_uInt16 nId = pIDFA->GetFldTypes()->GetPos( pType );
- pWrtShell->InsertLabel( LTYPE_OBJECT, aEmptyStr, aEmptyStr, aEmptyStr, FALSE, nId, aEmptyStr );
- pWrtShell->SwFEShell::SetFlyName( sTeamCredits );
- pWrtShell->SwFEShell::SelectObj ( Point ( ULONG_MAX, ULONG_MAX ) );
- pWrtShell->EnterStdMode();
- pWrtShell->EndPara ( TRUE );
- String aTmp ( SW_RES ( STR_SW_TEAM_NAMES ) );
- pWrtShell->Insert ( aTmp );
- SvxAdjustItem aAdjustItem( SVX_ADJUST_CENTER, RES_PARATR_ADJUST );
- pWrtShell->SetAttr( aAdjustItem );
- pWrtShell->SttPara ();
- pWrtShell->SplitNode();
- pWrtShell->Left(CRSR_SKIP_CHARS, FALSE, 1, FALSE );
- SvxWeightItem aWeightItem ( WEIGHT_BOLD, RES_CHRATR_WEIGHT );
- pWrtShell->Insert ( String ( RTL_CONSTASCII_USTRINGPARAM ( "The StarWriter team!" ) ) );
- pWrtShell->SttPara ( TRUE );
- pWrtShell->SetAttr( aWeightItem);
- pWrtShell->GotoFly ( sTeamCredits);
- pWrtShell->EndAllAction();
- pWrtShell->EndUndo( UNDO_INSGLOSSARY );
- }
- else
- {
- String aTmp( SW_RES(STR_NOGLOS));
- aTmp.SearchAndReplaceAscii("%1", aShortName);
- InfoBox( pWrtShell->GetView().GetWindow(), aTmp ).Execute();
-
- }
+ String aTmp( SW_RES(STR_NOGLOS));
+ aTmp.SearchAndReplaceAscii("%1", aShortName);
+ InfoBox( pWrtShell->GetView().GetWindow(), aTmp ).Execute();
}
return FALSE;
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index 66cb07f33e9c..704172b21074 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -322,6 +322,19 @@ SwTransferable::~SwTransferable()
// -----------------------------------------------------------------------
+static SwDoc * lcl_GetDoc(SwDocFac & rDocFac)
+{
+ SwDoc *const pDoc = rDocFac.GetDoc();
+ ASSERT( pDoc, "Document not found" );
+ if (pDoc)
+ {
+ pDoc->SetClipBoard( true );
+ }
+ return pDoc;
+}
+
+// -----------------------------------------------------------------------
+
void SwTransferable::ObjectReleased()
{
SwModule *pMod = SW_MOD();
@@ -443,7 +456,7 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
}
pClpDocFac = new SwDocFac;
- SwDoc* pTmpDoc = pClpDocFac->GetDoc();
+ SwDoc *const pTmpDoc = lcl_GetDoc(*pClpDocFac);
pTmpDoc->SetRefForDocShell( boost::addressof(aDocShellRef) );
pTmpDoc->LockExpFlds(); // nie die Felder updaten - Text so belassen
@@ -530,8 +543,7 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
case SOT_FORMATSTR_ID_DRAWING:
{
- SwDoc *pDoc = pClpDocFac->GetDoc();
- ASSERT( pDoc, "Document not found" );
+ SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac);
bOK = SetObject( pDoc->GetDrawModel(),
SWTRANSFER_OBJECTTYPE_DRAWMODEL, rFlavor );
}
@@ -539,21 +551,22 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
case SOT_FORMAT_STRING:
{
- SwDoc* pDoc = pClpDocFac->GetDoc();
- ASSERT( pDoc, "Document not found" );
- pDoc->SetClipBoard( true );
- bOK = SetObject( pDoc,
- SWTRANSFER_OBJECTTYPE_STRING, rFlavor );
+ SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac);
+ bOK = SetObject( pDoc, SWTRANSFER_OBJECTTYPE_STRING, rFlavor );
}
break;
case SOT_FORMAT_RTF:
- bOK = SetObject( pClpDocFac->GetDoc(),
- SWTRANSFER_OBJECTTYPE_RTF, rFlavor );
+ {
+ SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac);
+ bOK = SetObject( pDoc, SWTRANSFER_OBJECTTYPE_RTF, rFlavor );
+ }
break;
case SOT_FORMATSTR_ID_HTML:
- bOK = SetObject( pClpDocFac->GetDoc(),
- SWTRANSFER_OBJECTTYPE_HTML, rFlavor );
+ {
+ SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac);
+ bOK = SetObject( pDoc, SWTRANSFER_OBJECTTYPE_HTML, rFlavor );
+ }
break;
case SOT_FORMATSTR_ID_SVXB:
@@ -597,7 +610,7 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
// default:
if( !aDocShellRef.Is() )
{
- SwDoc *pDoc = pClpDocFac->GetDoc();
+ SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac);
SwDocShell* pNewDocSh = new SwDocShell( pDoc,
SFX_CREATE_MODE_EMBEDDED );
aDocShellRef = pNewDocSh;
@@ -805,7 +818,8 @@ int SwTransferable::PrepareForCopy( BOOL bIsCut )
pOrigGrf = pClpBitmap;
pClpDocFac = new SwDocFac;
- pWrtShell->Copy( pClpDocFac->GetDoc() );
+ SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac);
+ pWrtShell->Copy( pDoc );
if (pOrigGrf && !pOrigGrf->GetBitmap().IsEmpty())
AddFormat( SOT_FORMATSTR_ID_SVXB );
@@ -827,7 +841,7 @@ int SwTransferable::PrepareForCopy( BOOL bIsCut )
else if ( nSelection == nsSelectionType::SEL_OLE )
{
pClpDocFac = new SwDocFac;
- SwDoc *pDoc = pClpDocFac->GetDoc();
+ SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac);
aDocShellRef = new SwDocShell( pDoc, SFX_CREATE_MODE_EMBEDDED);
aDocShellRef->DoInitNew( NULL );
pWrtShell->Copy( pDoc );
@@ -857,8 +871,7 @@ int SwTransferable::PrepareForCopy( BOOL bIsCut )
if( pWrtShell->IsAddMode() && pWrtShell->SwCrsrShell::HasSelection() )
pWrtShell->CreateCrsr();
- SwDoc* pTmpDoc = pClpDocFac->GetDoc();
- pTmpDoc->SetClipBoard( true );
+ SwDoc *const pTmpDoc = lcl_GetDoc(*pClpDocFac);
pTmpDoc->SetRefForDocShell( boost::addressof(aDocShellRef) );
pTmpDoc->LockExpFlds(); // nie die Felder updaten - Text so belassen
@@ -1017,7 +1030,8 @@ int SwTransferable::CalculateAndCopy()
String aStr( pWrtShell->Calculate() );
pClpDocFac = new SwDocFac;
- pWrtShell->Copy( pClpDocFac->GetDoc(), &aStr);
+ SwDoc *const pDoc = lcl_GetDoc(*pClpDocFac);
+ pWrtShell->Copy(pDoc, & aStr);
eBufferType = TRNSFR_DOCUMENT;
AddFormat( FORMAT_STRING );
@@ -1037,7 +1051,7 @@ int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary,
SwWait aWait( *pWrtShell->GetView().GetDocShell(), TRUE );
pClpDocFac = new SwDocFac;
- SwDoc* pCDoc = pClpDocFac->GetDoc();
+ SwDoc *const pCDoc = lcl_GetDoc(*pClpDocFac);
SwNodes& rNds = pCDoc->GetNodes();
SwNodeIndex aNodeIdx( *rNds.GetEndOfContent().StartOfSectionNode() );
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index c6b0ad4a136f..53770059cbcd 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -1304,7 +1304,7 @@ void SwPostItMgr::Delete()
CalcRects();
LayoutPostIts();
}
-
+#if 0
void SwPostItMgr::Hide(SwPostItField* pPostItField )
{
for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
@@ -1323,7 +1323,7 @@ void SwPostItMgr::Hide(SwPostItField* pPostItField )
LayoutPostIts();
}
-
+#endif
void SwPostItMgr::Hide( const String& rAuthor )
{
for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
@@ -1398,30 +1398,6 @@ sw::annotation::SwAnnotationWin* SwPostItMgr::GetAnnotationWin(const SwPostItFie
return NULL;
}
-bool SwPostItMgr::ShowPreview(const SwField* pFld, SwFmtFld*& pFmtFld) const
-{
- for (unsigned long n=0;n<mPages.size();n++)
- {
- if (mPages[n]->mList->size()>0)
- {
- for(const_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); i++)
- {
- if ( (*i)->GetFmtFld() && ((*i)->GetFmtFld()->GetFld()==pFld) )
- {
- pFmtFld = (*i)->GetFmtFld();
- const long aSidebarheight = mPages[n]->bScrollbar ? mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height() : 0;
- bool bTopPage = mpEditWin->PixelToLogic(Point(0,(*i)->pPostIt->GetPosPixel().Y())).Y() >= (mPages[n]->mPageRect.Top()+aSidebarheight);
- bool bBottomPage = mpEditWin->PixelToLogic(Point(0,(*i)->pPostIt->GetPosPixel().Y()+(*i)->pPostIt->GetSizePixel().Height())).Y() <= (mPages[n]->mPageRect.Bottom()-aSidebarheight);
- const bool bTopVis = mpEditWin->PixelToLogic(Point(0,(*i)->pPostIt->GetPosPixel().Y())).Y() > mpView->GetVisArea().Top();
- const bool bBottomVis = mpEditWin->PixelToLogic(Point(0,(*i)->pPostIt->GetPosPixel().Y()/*+(*i)->pPostIt->GetSizePixel().Height()*/)).Y() <= mpView->GetVisArea().Bottom();
- return !(bBottomPage && bTopPage && bBottomVis && bTopVis);
- }
- }
- }
- }
- return false;
-}
-
SwSidebarWin* SwPostItMgr::GetNextPostIt( USHORT aDirection,
SwSidebarWin* aPostIt )
{
diff --git a/sw/source/ui/docvw/SidebarTxtControl.cxx b/sw/source/ui/docvw/SidebarTxtControl.cxx
index 61d4884157cf..829c79373a61 100644
--- a/sw/source/ui/docvw/SidebarTxtControl.cxx
+++ b/sw/source/ui/docvw/SidebarTxtControl.cxx
@@ -340,26 +340,32 @@ void SidebarTxtControl::Command( const CommandEvent& rCEvt )
}
else
{
- SfxPopupMenuManager* aMgr = mrDocView.GetViewFrame()->GetDispatcher()->Popup(0, this,&rCEvt.GetMousePosPixel());
- ((PopupMenu*)aMgr->GetSVMenu())->SetSelectHdl( LINK(this, SidebarTxtControl, Select) );
+ SfxPopupMenuManager* pMgr = mrDocView.GetViewFrame()->GetDispatcher()->Popup(0, this,&rCEvt.GetMousePosPixel());
+ ((PopupMenu*)pMgr->GetSVMenu())->SetSelectHdl( LINK(this, SidebarTxtControl, Select) );
{
- XubString aText = ((PopupMenu*)aMgr->GetSVMenu())->GetItemText( FN_DELETE_NOTE_AUTHOR );
+ XubString aText = ((PopupMenu*)pMgr->GetSVMenu())->GetItemText( FN_DELETE_NOTE_AUTHOR );
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, mrSidebarWin.GetAuthor());
aText = aRewriter.Apply(aText);
- ((PopupMenu*)aMgr->GetSVMenu())->SetItemText(FN_DELETE_NOTE_AUTHOR,aText);
+ ((PopupMenu*)pMgr->GetSVMenu())->SetItemText(FN_DELETE_NOTE_AUTHOR,aText);
}
+ Point aPos;
if (rCEvt.IsMouseEvent())
- ((PopupMenu*)aMgr->GetSVMenu())->Execute(this,rCEvt.GetMousePosPixel());
+ aPos = rCEvt.GetMousePosPixel();
else
{
const Size aSize = GetSizePixel();
- const Point aPos = Point( aSize.getWidth()/2, aSize.getHeight()/2 );
- ((PopupMenu*)aMgr->GetSVMenu())->Execute(this,aPos);
+ aPos = Point( aSize.getWidth()/2, aSize.getHeight()/2 );
}
- delete aMgr;
+
+ //!! call different Execute function to get rid of the new thesaurus sub menu
+ //!! pointer created in the call to Popup.
+ //!! Otherwise we would have a memory leak (see also #i107205#)
+ //((PopupMenu*)pMgr->GetSVMenu())->Execute( this, aPos );
+ pMgr->Execute( aPos, this );
+ delete pMgr;
}
}
else
diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx
index cce6db3a891b..cce6db3a891b 100644..100755
--- a/sw/source/ui/docvw/SidebarWin.cxx
+++ b/sw/source/ui/docvw/SidebarWin.cxx
diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx
index 763504c75db6..be201c32c24e 100644
--- a/sw/source/ui/docvw/edtwin2.cxx
+++ b/sw/source/ui/docvw/edtwin2.cxx
@@ -35,9 +35,7 @@
#include <stdio.h>
#endif
-#ifndef _HELP_HXX //autogen
#include <vcl/help.hxx>
-#endif
#include <svl/stritem.hxx>
#include <unotools/securityoptions.hxx>
#include <tools/urlobj.hxx>
@@ -46,24 +44,15 @@
#include <editeng/flditem.hxx>
#include <svl/urihelper.hxx>
#include <svx/svdotext.hxx>
-#ifndef _OUTLINER_HXX //autogen
-#define _EEITEMID_HXX
#include <editeng/outliner.hxx>
-#endif
#include <svl/itemiter.hxx>
#include <svx/svdview.hxx>
#include <svx/svdpagv.hxx>
#include <swmodule.hxx>
-#ifndef _MODCFG_HXX
#include <modcfg.hxx>
-#endif
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <edtwin.hxx>
#include <dpage.hxx>
#include <shellres.hxx>
@@ -80,12 +69,8 @@
#include <txttxmrk.hxx>
#include <uitool.hxx>
#include <viewopt.hxx>
-#ifndef _DOCVW_HRC
#include <docvw.hrc>
-#endif
-#ifndef _UTLUI_HRC
#include <utlui.hrc>
-#endif
#include <PostItMgr.hxx>
#include <fmtfld.hxx>
@@ -319,7 +304,8 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
{
USHORT nOldSubType = pFld->GetSubType();
((SwField*)pFld)->SetSubType(nsSwExtendedSubType::SUB_CMD);
- sTxt = pFld->Expand();
+ sTxt =
+ pFld->ExpandField(rSh.GetDoc()->IsClipBoard());
((SwField*)pFld)->SetSubType(nOldSubType);
}
break;
diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx
index 3499c8875093..95001f897702 100644
--- a/sw/source/ui/fldui/fldmgr.cxx
+++ b/sw/source/ui/fldui/fldmgr.cxx
@@ -1435,7 +1435,7 @@ void SwFldMgr::UpdateCurFld(ULONG nFormat,
}
else
{
- pTmpFld = pCurFld->Copy();
+ pTmpFld = pCurFld->CopyField();
bDelete = true;
}
diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx
index 39a6a98d764b..265a53dc6646 100644
--- a/sw/source/ui/fldui/fldpage.cxx
+++ b/sw/source/ui/fldui/fldpage.cxx
@@ -42,28 +42,16 @@
#include <fmtfld.hxx>
#include <viewopt.hxx>
#include <fldedt.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <swmodule.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <wrtsh.hxx>
#include <expfld.hxx>
-#ifndef _FLDTDLG_HXX
#include <fldtdlg.hxx>
-#endif
-#ifndef _FLDPAGE_HXX
#include <fldpage.hxx>
-#endif
#include <docufld.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
#include <sfx2/bindings.hxx>
using namespace ::com::sun::star;
@@ -218,7 +206,7 @@ BOOL SwFldPage::InsertFld(USHORT nTypeId, USHORT nSubType, const String& rPar1,
}
else // Feld aendern
{
- SwField * pTmpFld = m_pCurFld->Copy();
+ SwField *const pTmpFld = m_pCurFld->CopyField();
String sPar1(rPar1);
String sPar2(rPar2);
diff --git a/sw/source/ui/inc/SwSpellDialogChildWindow.hxx b/sw/source/ui/inc/SwSpellDialogChildWindow.hxx
index 3ab86b3469d7..dd3e7e2dce9b 100644
--- a/sw/source/ui/inc/SwSpellDialogChildWindow.hxx
+++ b/sw/source/ui/inc/SwSpellDialogChildWindow.hxx
@@ -48,8 +48,8 @@ class SwSpellDialogChildWindow
void LockFocusNotification(bool bLock);
protected:
- virtual svx::SpellPortions GetNextWrongSentence (void);
- virtual void ApplyChangedSentence(const svx::SpellPortions& rChanged);
+ virtual svx::SpellPortions GetNextWrongSentence(bool bRecheck);
+ virtual void ApplyChangedSentence(const svx::SpellPortions& rChanged, bool bRecheck);
virtual void AddAutoCorrection(const String& rOld, const String& rNew, LanguageType eLanguage);
virtual bool HasAutoCorrection();
virtual bool HasGrammarChecking();
diff --git a/sw/source/ui/inc/langhelper.hxx b/sw/source/ui/inc/langhelper.hxx
index 0d05c930284a..3ff795d83f56 100755
--- a/sw/source/ui/inc/langhelper.hxx
+++ b/sw/source/ui/inc/langhelper.hxx
@@ -31,31 +31,37 @@ class SwWrtShell;
class SwView;
class EditEngine;
class EditView;
+class OutlinerView;
class SfxItemSet;
struct ESelection;
namespace SwLangHelper
{
- extern USHORT GetLanguageStatus(OutlinerView* pOLV,SfxItemSet& rSet);
- extern bool SetLanguageStatus(OutlinerView* pOLV,SfxRequest &rReq,SwView &rView,SwWrtShell &rSh);
+ extern USHORT GetLanguageStatus( OutlinerView* pOLV, SfxItemSet& rSet );
+ extern bool SetLanguageStatus( OutlinerView* pOLV, SfxRequest &rReq, SwView &rView, SwWrtShell &rSh );
- extern void SetLanguage(SwWrtShell &rWrtSh, const String &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet);
- extern void SetLanguage(SwWrtShell &rWrtSh, EditEngine* pEditEngine,ESelection aSelection, const String &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet);
- extern void SetLanguage_None(SwWrtShell &rWrtSh, EditEngine* pEditEngine,ESelection aSelection, bool bIsForSelection, SfxItemSet &rCoreSet );
- extern void SetLanguage_None(SwWrtShell &rWrtSh,bool bIsForSelection, SfxItemSet &rCoreSet );
+ extern void SetLanguage( SwWrtShell &rWrtSh, const String &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet );
+// extern void SetLanguage( SwWrtShell &rWrtSh, EditEngine* pEditEngine, ESelection aSelection, const String &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet );
+ extern void SetLanguage( SwWrtShell &rWrtSh, OutlinerView* pOLV, ESelection aSelection, const String &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet );
+ extern void SetLanguage_None( SwWrtShell &rWrtSh, bool bIsForSelection, SfxItemSet &rCoreSet );
+// extern void SetLanguage_None( SwWrtShell &rWrtSh, EditEngine* pEditEngine, ESelection aSelection, bool bIsForSelection, SfxItemSet &rCoreSet );
+ extern void SetLanguage_None( SwWrtShell &rWrtSh, OutlinerView* pOLV, ESelection aSelection, bool bIsForSelection, SfxItemSet &rCoreSet );
+ extern void ResetLanguages( SwWrtShell &rWrtSh, bool bIsForSelection );
+// extern void ResetLanguages( SwWrtShell &rWrtSh, EditEngine* pEditEngine, ESelection aSelection, bool bIsForSelection );
+ extern void ResetLanguages( SwWrtShell &rWrtSh, OutlinerView* pOLV, ESelection aSelection, bool bIsForSelection );
// document
extern void SelectCurrentPara( SwWrtShell &rWrtSh );
// EditView
extern void SelectPara( EditView &rEditView, const ESelection &rCurSel );
- extern String GetTextForLanguageGuessing(EditEngine* rEditEngine, ESelection aDocSelection );
+ extern String GetTextForLanguageGuessing( EditEngine* rEditEngine, ESelection aDocSelection );
extern String GetTextForLanguageGuessing( SwWrtShell &rSh );
extern LanguageType GetLanguage( SfxItemSet aSet, USHORT nLangWhichId );
extern LanguageType GetLanguage( SwWrtShell &rSh, USHORT nLangWhichId );
- extern LanguageType GetCurrentLanguage(SfxItemSet aSet,USHORT nScriptType );
+ extern LanguageType GetCurrentLanguage( SfxItemSet aSet, USHORT nScriptType );
extern LanguageType GetCurrentLanguage( SwWrtShell &rSh );
}
diff --git a/sw/source/ui/inc/olmenu.hxx b/sw/source/ui/inc/olmenu.hxx
index 3bc0eb02d3b6..ef6a26e73f67 100644
--- a/sw/source/ui/inc/olmenu.hxx
+++ b/sw/source/ui/inc/olmenu.hxx
@@ -51,23 +51,22 @@ class SwSpellPopup : public PopupMenu
::com::sun::star::linguistic2::XSpellAlternatives > xSpellAlt;
::com::sun::star::uno::Sequence< rtl::OUString > aSuggestions;
- LanguageType nCheckedLanguage;
+ LanguageType nCheckedLanguage;
LanguageType nGuessLangWord;
LanguageType nGuessLangPara;
- USHORT nNumLanguageTextEntries;
- USHORT nNumLanguageParaEntries;
- USHORT nNumLanguageDocEntries;
std::map< sal_Int16, ::rtl::OUString > aLangTable_Text;
std::map< sal_Int16, ::rtl::OUString > aLangTable_Paragraph;
- std::map< sal_Int16, ::rtl::OUString > aLangTable_Document;
+// std::map< sal_Int16, ::rtl::OUString > aLangTable_Document;
bool bGrammarResults; // show grammar results? Or show spellcheck results?
Image aInfo16;
- USHORT fillLangPopupMenu( PopupMenu *pPopupMenu , USHORT Lang_Start, ::com::sun::star::uno::Sequence< ::rtl::OUString > aSeq,SwWrtShell* pWrtSh, USHORT nLangTable);
+ void fillLangPopupMenu( PopupMenu *pPopupMenu, USHORT nLangStart,
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > aSeq, SwWrtShell* pWrtSh,
+ std::map< sal_Int16, ::rtl::OUString > &rLangTable );
using PopupMenu::Execute;
diff --git a/sw/source/ui/inc/srcview.hxx b/sw/source/ui/inc/srcview.hxx
index 574696f1fd27..574696f1fd27 100755..100644
--- a/sw/source/ui/inc/srcview.hxx
+++ b/sw/source/ui/inc/srcview.hxx
diff --git a/sw/source/ui/inc/swdtflvr.hxx b/sw/source/ui/inc/swdtflvr.hxx
index 84b3309f70bc..a239f13f1ec2 100644
--- a/sw/source/ui/inc/swdtflvr.hxx
+++ b/sw/source/ui/inc/swdtflvr.hxx
@@ -26,12 +26,10 @@
************************************************************************/
#ifndef _SWDTFLVR_HXX
#define _SWDTFLVR_HXX
-#ifndef _TRANSFER_HXX
#include <sfx2/objsh.hxx>
#include <svtools/transfer.hxx>
-#endif
#include <vcl/graph.hxx>
#include <sfx2/lnkbase.hxx>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx
index 7cff88c897cc..d63149eb7c4f 100644
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -437,6 +437,12 @@ public:
virtual USHORT PrepareClose( BOOL bUI = TRUE, BOOL bForBrowsing = FALSE );
virtual void MarginChanged();
+ // replace word/selection with text from the thesaurus
+ // (this code has special handling for "in word" character)
+ void InsertThesaurusSynonym( const String &rSynonmText, const String &rLookUpText, bool bValidSelection );
+ bool IsValidSelectionForThesaurus() const;
+ String GetThesaurusLookUpText( bool bSelection ) const;
+
// Shell sofort wechseln -> fuer GetSelectionObject
void StopShellTimer();
@@ -574,7 +580,7 @@ public:
BOOL HasDrwObj(SdrObject *pSdrObj) const;
BOOL HasOnlyObj(SdrObject *pSdrObj, UINT32 eObjInventor) const;
BOOL BeginTextEdit( SdrObject* pObj, SdrPageView* pPV=NULL,
- Window* pWin=NULL, BOOL bIsNewObj=FALSE);
+ Window* pWin=NULL, bool bIsNewObj=false, bool bSetSelectionToStart=false );
void StateTabWin(SfxItemSet&);
@@ -599,6 +605,7 @@ public:
SwDocShell *GetDocShell();
inline const SwDocShell *GetDocShell() const;
inline FmFormShell *GetFormShell() { return pFormShell; }
+ inline const FmFormShell *GetFormShell() const { return pFormShell; }
//damit in DToren der SubShells ggf. pShell zurueckgesetzt werden kann
void ResetSubShell() { pShell = 0; }
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index 9ebfd8c8cf36..934cfc19e22b 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -28,85 +28,84 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <hintids.hxx>
+#include "SwRewriter.hxx"
+#include "chrdlg.hrc"
+#include "cmdid.h"
+#include "comcore.hrc"
+#include "crsskip.hxx"
+#include "doc.hxx"
+#include "docsh.hxx" //CheckSpellChanges
+#include "edtwin.hxx"
+#include "helpid.h"
+#include "hintids.hxx"
+#include "langhelper.hxx"
+#include "ndtxt.hxx"
+#include "olmenu.hrc"
+#include "olmenu.hxx"
+#include "swabstdlg.hxx"
+#include "swmodule.hxx"
+#include "swtypes.hxx"
+#include "swundo.hxx"
+#include "uitool.hxx"
+#include "undobj.hxx"
+#include "unomid.h"
+#include "view.hxx"
+#include "viewopt.hxx"
+#include "wrtsh.hxx"
+#include "wview.hxx"
+#include "swabstdlg.hxx"
+#include "chrdlg.hrc"
+
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_STRINGSDTOR
#include <svl/svstdarr.hxx>
#endif
-#include <unotools/lingucfg.hxx>
-#include <unotools/linguprops.hxx>
-#include <svtools/filter.hxx>
-#include <editeng/svxacorr.hxx>
-#include <sfx2/dispatch.hxx>
-#include <sfx2/imagemgr.hxx>
-#include <osl/file.hxx>
-#include <rtl/string.hxx>
+#include <comphelper/processfactory.hxx>
+#include <editeng/acorrcfg.hxx>
+#include <editeng/svxacorr.hxx>
+#include <editeng/langitem.hxx>
+#include <editeng/splwrap.hxx>
+#include <editeng/brshitem.hxx>
+#include <editeng/unolingu.hxx>
#include <i18npool/mslangid.hxx>
#include <linguistic/lngprops.hxx>
#include <linguistic/misc.hxx>
-#include <comphelper/processfactory.hxx>
-#include <editeng/unolingu.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/frame/XStorable.hpp>
-#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
-#include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
-#include <com/sun/star/linguistic2/SingleProofreadingError.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/container/XIndexAccess.hpp>
-#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 <osl/file.hxx>
+#include <rtl/string.hxx>
+#include <svtools/filter.hxx>
+#include <sfx2/dispatch.hxx>
+#include <sfx2/imagemgr.hxx>
+#include <sfx2/request.hxx>
+#include <sfx2/sfxdlg.hxx>
#include <svl/itemset.hxx>
-#include <editeng/langitem.hxx>
-#include <editeng/splwrap.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/settings.hxx>
-#include <unotools/lingucfg.hxx>
-#include <editeng/acorrcfg.hxx>
-#include <swmodule.hxx>
-#include <cmdid.h>
-#include <helpid.h>
-#include <swtypes.hxx>
-#include <wrtsh.hxx>
-#include <view.hxx>
-#include <docsh.hxx> //CheckSpellChanges
-#include <olmenu.hxx>
-#include <swundo.hxx>
-#include <crsskip.hxx>
-#include <ndtxt.hxx>
-#include <olmenu.hrc>
-#include <doc.hxx>
-
-// -> #111827#
-#include <SwRewriter.hxx>
-#include <comcore.hrc>
-#include <undobj.hxx>
-// <- #111827#
-
-#include <unomid.h>
#include <svl/languageoptions.hxx>
-#include <map>
-#include <svtools/langtab.hxx>
-#include <com/sun/star/document/XDocumentLanguages.hpp>
-#include <edtwin.hxx>
-#include <sfx2/sfxdlg.hxx>
-#include "swabstdlg.hxx"
-#include "chrdlg.hrc"
-#include <editeng/brshitem.hxx>
#include <svl/stritem.hxx>
-#include <viewopt.hxx>
-#include <uitool.hxx>
+#include <svtools/filter.hxx>
+#include <svtools/langtab.hxx>
+#include <svx/dlgutil.hxx>
+#include <unotools/lingucfg.hxx>
+#include <unotools/linguprops.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/settings.hxx>
+#include <vcl/svapp.hxx>
-#include <wview.hxx>
-#include <sfx2/request.hxx>
+#include <map>
-#include <vcl/msgbox.hxx>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/document/XDocumentLanguages.hpp>
+#include <com/sun/star/frame/XModuleManager.hpp>
+#include <com/sun/star/frame/XStorable.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/linguistic2/SingleProofreadingError.hpp>
+#include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
+#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
+#include <com/sun/star/uno/Any.hxx>
-#include <langhelper.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -214,63 +213,59 @@ inline bool lcl_checkScriptType( sal_Int16 nScriptType, LanguageType nLang )
return 0 != (nScriptType & SvtLanguageOptions::GetScriptTypeOfLanguage( nLang ));
}
-USHORT SwSpellPopup::fillLangPopupMenu(
+void SwSpellPopup::fillLangPopupMenu(
PopupMenu *pPopupMenu,
- USHORT Lang_Start,
- uno::Sequence< ::rtl::OUString > aSeq,
+ USHORT nLangItemIdStart,
+ uno::Sequence< OUString > aSeq,
SwWrtShell* pWrtSh,
- USHORT nLangTable )
+ std::map< sal_Int16, ::rtl::OUString > &rLangTable )
{
if (!pPopupMenu)
- return 0;
-
- //Reference< awt::XMenuExtended > m_xMenuExtended( m_xPopupMenu, UNO_QUERY );
- std::map< ::rtl::OUString, ::rtl::OUString > LangItems;
+ return;
SvtLanguageTable aLanguageTable;
- USHORT nItemId = Lang_Start;
- rtl::OUString curLang = aSeq[0];
- USHORT nScriptType = static_cast< sal_Int16 >(aSeq[1].toInt32());
- rtl::OUString keyboardLang = aSeq[2];
- rtl::OUString guessLang = aSeq[3];
-
- //1--add current language
- if(curLang!=OUString::createFromAscii(""))
- {
- LangItems[curLang]=curLang;
- }
- SvtLanguageTable aLangTable;
+ // set of languages to be displayed in the sub menus
+ std::set< OUString > aLangItems;
+
+ OUString aCurLang( aSeq[0] );
+ USHORT nScriptType = static_cast< sal_Int16 >(aSeq[1].toInt32());
+ OUString aKeyboardLang( aSeq[2] );
+ OUString aGuessedTextLang( aSeq[3] );
+
+ if (aCurLang != OUString() &&
+ LANGUAGE_DONTKNOW != aLanguageTable.GetType( aCurLang ))
+ aLangItems.insert( aCurLang );
+
//2--System
- const AllSettings& rAllSettings=Application::GetSettings();
+ const AllSettings& rAllSettings = Application::GetSettings();
LanguageType rSystemLanguage = rAllSettings.GetLanguage();
- if(rSystemLanguage!=LANGUAGE_DONTKNOW)
+ if (rSystemLanguage != LANGUAGE_DONTKNOW)
{
- if (lcl_checkScriptType(nScriptType,rSystemLanguage ))
- LangItems[OUString(aLangTable.GetString(rSystemLanguage))]=OUString(aLangTable.GetString(rSystemLanguage));
+ if (lcl_checkScriptType( nScriptType, rSystemLanguage ))
+ aLangItems.insert( aLanguageTable.GetString(rSystemLanguage) );
}
//3--UI
LanguageType rUILanguage = rAllSettings.GetUILanguage();
- if(rUILanguage!=LANGUAGE_DONTKNOW)
+ if (rUILanguage != LANGUAGE_DONTKNOW)
{
if (lcl_checkScriptType(nScriptType, rUILanguage ))
- LangItems[OUString(aLangTable.GetString(rUILanguage))]=OUString(aLangTable.GetString(rUILanguage));
+ aLangItems.insert( aLanguageTable.GetString(rUILanguage) );
}
//4--guessed language
- if(guessLang!=OUString::createFromAscii(""))
+ if (aGuessedTextLang.getLength() > 0)
{
- if (lcl_checkScriptType(nScriptType, aLanguageTable.GetType(guessLang)))
- LangItems[guessLang]=guessLang;
+ if (lcl_checkScriptType(nScriptType, aLanguageTable.GetType(aGuessedTextLang)))
+ aLangItems.insert( aGuessedTextLang );
}
-
//5--keyboard language
- if(keyboardLang!=OUString::createFromAscii(""))
+ if (aKeyboardLang.getLength() > 0)
{
- if (lcl_checkScriptType(nScriptType, aLanguageTable.GetType(keyboardLang)))
- LangItems[keyboardLang]=keyboardLang;
+ if (lcl_checkScriptType(nScriptType, aLanguageTable.GetType(aKeyboardLang)))
+ aLangItems.insert( aKeyboardLang );
}
//6--all languages used in current document
@@ -278,74 +273,57 @@ USHORT SwSpellPopup::fillLangPopupMenu(
uno::Reference< com::sun::star::frame::XController > xController( pWrtSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface()->getController(), uno::UNO_QUERY );
if ( xController.is() )
xModel = xController->getModel();
-
uno::Reference< document::XDocumentLanguages > xDocumentLanguages( xModel, uno::UNO_QUERY );
- /*the description of nScriptType
- LATIN : 1
- ASIAN : 2
- COMPLEX:4
- LATIN + ASIAN : 3
- LATIN + COMPLEX : 5
- ASIAN + COMPLEX : 6
- LATIN + ASIAN + COMPLEX : 7
+ /*the description of nScriptType flags
+ LATIN : 0x0001
+ ASIAN : 0x0002
+ COMPLEX: 0x0004
*/
-
- sal_Int16 nCount=7;
- if(xDocumentLanguages.is())
+ const sal_Int16 nMaxCount = 7;
+ if (xDocumentLanguages.is())
{
- uno::Sequence< lang::Locale > rLocales(xDocumentLanguages->getDocumentLanguages(nScriptType,nCount));
- if(rLocales.getLength()>0)
+ uno::Sequence< lang::Locale > rLocales( xDocumentLanguages->getDocumentLanguages( nScriptType, nMaxCount ) );
+ if (rLocales.getLength() > 0)
{
- for(USHORT i = 0; i<rLocales.getLength();++i)
+ for (USHORT i = 0; i < rLocales.getLength(); ++i)
{
- if (LangItems.size()==7)
+ if (aLangItems.size() == (size_t)nMaxCount)
break;
- const lang::Locale& rLocale=rLocales[i];
- if(lcl_checkScriptType(nScriptType, aLanguageTable.GetType(rLocale.Language)))
- LangItems[ rtl::OUString(rLocale.Language)]=OUString(rLocale.Language);
+ const lang::Locale& rLocale = rLocales[i];
+ if (lcl_checkScriptType( nScriptType, aLanguageTable.GetType( rLocale.Language )))
+ aLangItems.insert( rLocale.Language );
}
}
}
- bool bMultipleLanguages = (nLangTable != 0) || (curLang.compareToAscii( "*" ) == 0);
- bool bNothingSelected = true;
- MenuItemBits nMenuItemStyle = !bMultipleLanguages ? MIB_RADIOCHECK : 0;
- for (std::map< rtl::OUString, rtl::OUString >::const_iterator it = LangItems.begin(); it != LangItems.end(); ++it)
+
+ USHORT nItemId = nLangItemIdStart;
+ const OUString sAsterix(RTL_CONSTASCII_USTRINGPARAM("*")); // multiple languages in current selection
+ const OUString sEmpty; // 'no language found' from language guessing
+ std::set< OUString >::const_iterator it;
+ for (it = aLangItems.begin(); it != aLangItems.end(); ++it)
{
- rtl::OUString aEntryTxt( it->first );
- if (aEntryTxt != rtl::OUString( aLangTable.GetString( LANGUAGE_NONE ) )&&
- aEntryTxt != rtl::OUString::createFromAscii("*") &&
- aEntryTxt.getLength() > 0)
+ OUString aEntryTxt( *it );
+ if (aEntryTxt != OUString( aLanguageTable.GetString( LANGUAGE_NONE ) )&&
+ aEntryTxt != sAsterix &&
+ aEntryTxt != sEmpty)
{
- ++nItemId;
- if (nLangTable == 0) // language for selection
- aLangTable_Text[nItemId] = aEntryTxt;
- else if (nLangTable == 1) // language for paragraph
- aLangTable_Paragraph[nItemId] = aEntryTxt;
- else if (nLangTable == 2) // language for document
- aLangTable_Document[nItemId] = aEntryTxt;
-
- pPopupMenu->InsertItem( nItemId, aEntryTxt, nMenuItemStyle );
- if ((nLangTable == 0) && (aEntryTxt == curLang))
+ DBG_ASSERT( nLangItemIdStart <= nItemId && nItemId <= nLangItemIdStart + MN_MAX_NUM_LANG,
+ "nItemId outside of expected range!" );
+ pPopupMenu->InsertItem( nItemId, aEntryTxt, MIB_RADIOCHECK );
+ if (aEntryTxt == aCurLang)
{
//make a check mark for the current language
pPopupMenu->CheckItem( nItemId, TRUE );
- bNothingSelected = false;
}
+ rLangTable[ nItemId ] = aEntryTxt;
+ ++nItemId;
}
}
- //7--none
- nItemId++;
- pPopupMenu->InsertItem( nItemId, String(SW_RES( STR_LANGSTATUS_NONE )), nMenuItemStyle );
- if (bNothingSelected && !bMultipleLanguages)
- pPopupMenu->CheckItem( nItemId, TRUE );
-
- //More...
- nItemId++;
- pPopupMenu->InsertItem( nItemId, String(SW_RES( STR_LANGSTATUS_MORE )) );
-
- return nItemId - Lang_Start; // return number of inserted entries
+ pPopupMenu->InsertItem( nLangItemIdStart + MN_NONE_OFFSET, String(SW_RES( STR_LANGSTATUS_NONE )), MIB_RADIOCHECK );
+ pPopupMenu->InsertItem( nLangItemIdStart + MN_RESET_OFFSET, String(SW_RES( STR_RESET_TO_DEFAULT_LANGUAGE )), MIB_RADIOCHECK );
+ pPopupMenu->InsertItem( nLangItemIdStart + MN_MORE_OFFSET, String(SW_RES( STR_LANGSTATUS_MORE )), MIB_RADIOCHECK );
}
@@ -368,22 +346,22 @@ static Image lcl_GetImageFromPngUrl( const OUString &rFileUrl )
}
-::rtl::OUString RetrieveLabelFromCommand( const ::rtl::OUString& aCmdURL )
+OUString RetrieveLabelFromCommand( const OUString& aCmdURL )
{
- ::rtl::OUString aLabel;
+ OUString aLabel;
if ( aCmdURL.getLength() )
{
try
{
- uno::Reference< container::XNameAccess > xNameAccess( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.frame.UICommandDescription") ), uno::UNO_QUERY );
+ uno::Reference< container::XNameAccess > xNameAccess( ::comphelper::getProcessServiceFactory()->createInstance( OUString::createFromAscii("com.sun.star.frame.UICommandDescription") ), uno::UNO_QUERY );
if ( xNameAccess.is() )
{
uno::Reference< container::XNameAccess > xUICommandLabels;
- const ::rtl::OUString aModule( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) );
+ const OUString aModule( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.TextDocument" ) );
uno::Any a = xNameAccess->getByName( aModule );
uno::Reference< container::XNameAccess > xUICommands;
a >>= xUICommandLabels;
- rtl::OUString aStr;
+ OUString aStr;
uno::Sequence< beans::PropertyValue > aPropSeq;
a = xUICommandLabels->getByName( aCmdURL );
if ( a >>= aPropSeq )
@@ -448,25 +426,28 @@ bGrammarResults(false)
InsertSeparator(0);
bEnable = sal_True;
- for( sal_uInt16 i = 0, nPos = 1, nId = MN_AUTOCORR_START + 1;
- i < nStringCount; ++i, ++nPos, ++nId )
+ USHORT nAutoCorrItemId = MN_AUTOCORR_START;
+ USHORT nItemId = MN_SUGGESTION_START;
+ for (USHORT i = 0; i < nStringCount; ++i)
{
const String aEntry = aSuggestions[ i ];
- InsertItem( nPos, aEntry, 0, i );
- SetHelpId( nPos, HID_LINGU_REPLACE);
-
+ InsertItem( nItemId, aEntry, 0, i );
+ SetHelpId( nItemId, HID_LINGU_REPLACE);
if (aSuggestionImageUrl.getLength() > 0)
- SetItemImage( nPos, aImage );
+ SetItemImage( nItemId, aImage );
+
+ pMenu->InsertItem( nAutoCorrItemId, aEntry );
+ pMenu->SetHelpId( nAutoCorrItemId, HID_LINGU_AUTOCORR);
- pMenu->InsertItem( nId, aEntry );
- pMenu->SetHelpId( nPos, HID_LINGU_AUTOCORR);
+ ++nAutoCorrItemId;
+ ++nItemId;
}
}
OUString aIgnoreSelection( String( SW_RES( STR_IGNORE_SELECTION ) ) );
OUString aSpellingAndGrammar = RetrieveLabelFromCommand( C2U(".uno:SpellingAndGrammarDialog") );
- SetItemText( MN_SPELLING, aSpellingAndGrammar );
- USHORT nItemPos = GetItemPos( MN_IGNORE );
+ SetItemText( MN_SPELLING_DLG, aSpellingAndGrammar );
+ USHORT nItemPos = GetItemPos( MN_IGNORE_WORD );
InsertItem( MN_IGNORE_SELECTION, aIgnoreSelection, 0, nItemPos );
SetHelpId( MN_IGNORE_SELECTION, HID_LINGU_IGNORE_SELECTION);
@@ -489,11 +470,9 @@ bGrammarResults(false)
nGuessLangPara = nGuessLangWord;
}
- pMenu = GetPopupMenu(MN_INSERT);
-
- bEnable = FALSE; // enable MN_INSERT?
-
+ pMenu = GetPopupMenu(MN_ADD_TO_DIC);
pMenu->CreateAutoMnemonics();
+ bEnable = FALSE; // enable MN_ADD_TO_DIC?
uno::Reference< linguistic2::XDictionaryList > xDicList( SvxGetDictionaryList() );
if (xDicList.is())
{
@@ -508,6 +487,7 @@ bGrammarResults(false)
const uno::Reference< linguistic2::XDictionary > *pDic = aDics.getConstArray();
USHORT nDicCount = static_cast< USHORT >(aDics.getLength());
+ USHORT nItemId = MN_DICTIONARIES_START;
for( USHORT i = 0; i < nDicCount; i++ )
{
uno::Reference< linguistic2::XDictionary > xDicTmp( pDic[i], uno::UNO_QUERY );
@@ -523,8 +503,7 @@ bGrammarResults(false)
{
// the extra 1 is because of the (possible) external
// linguistic entry above
- USHORT nPos = MN_INSERT_START + i + 1;
- pMenu->InsertItem( nPos, xDicTmp->getName() );
+ pMenu->InsertItem( nItemId, xDicTmp->getName() );
bEnable = sal_True;
uno::Reference< lang::XServiceInfo > xSvcInfo( xDicTmp, uno::UNO_QUERY );
@@ -535,18 +514,20 @@ bGrammarResults(false)
if (aDictionaryImageUrl.getLength() > 0)
{
Image aImage( lcl_GetImageFromPngUrl( aDictionaryImageUrl ) );
- pMenu->SetItemImage( nPos, aImage );
+ pMenu->SetItemImage( nItemId, aImage );
}
}
+
+ ++nItemId;
}
}
}
- EnableItem( MN_INSERT, bEnable );
+ EnableItem( MN_ADD_TO_DIC, bEnable );
//ADD NEW LANGUAGE MENU ITEM
///////////////////////////////////////////////////////////////////////////
String aScriptTypesInUse( String::CreateFromInt32( pWrtSh->GetScriptType() ) );
- SvtLanguageTable aLangTable;
+ SvtLanguageTable aLanguageTable;
// get keyboard language
String aKeyboardLang;
@@ -554,39 +535,40 @@ bGrammarResults(false)
SwEditWin& rEditWin = pWrtSh->GetView().GetEditWin();
nLang = rEditWin.GetInputLanguage();
if (nLang != LANGUAGE_DONTKNOW && nLang != LANGUAGE_SYSTEM)
- aKeyboardLang = aLangTable.GetString( nLang );
+ aKeyboardLang = aLanguageTable.GetString( nLang );
// get the language that is in use
const String aMultipleLanguages = String::CreateFromAscii("*");
String aCurrentLang = aMultipleLanguages;
nLang = SwLangHelper::GetCurrentLanguage( *pWrtSh );
if (nLang != LANGUAGE_DONTKNOW)
- aCurrentLang = aLangTable.GetString( nLang );
+ aCurrentLang = aLanguageTable.GetString( nLang );
// build sequence for status value
- uno::Sequence< ::rtl::OUString > aSeq( 4 );
+ uno::Sequence< OUString > aSeq( 4 );
aSeq[0] = aCurrentLang;
aSeq[1] = aScriptTypesInUse;
aSeq[2] = aKeyboardLang;
- aSeq[3] = aLangTable.GetString(nGuessLangWord);
+ aSeq[3] = aLanguageTable.GetString(nGuessLangWord);
- pMenu = GetPopupMenu(MN_LANGUAGE_SELECTION);
- nNumLanguageTextEntries = fillLangPopupMenu( pMenu, MN_LANGUAGE_SELECTION_START, aSeq, pWrtSh, 0 );
- EnableItem( MN_LANGUAGE_SELECTION, true );
+ pMenu = GetPopupMenu(MN_SET_LANGUAGE_SELECTION);
+ fillLangPopupMenu( pMenu, MN_SET_LANGUAGE_SELECTION_START, aSeq, pWrtSh, aLangTable_Text );
+ EnableItem( MN_SET_LANGUAGE_SELECTION, true );
- pMenu = GetPopupMenu(MN_LANGUAGE_PARAGRAPH);
- nNumLanguageParaEntries = fillLangPopupMenu( pMenu, MN_LANGUAGE_PARAGRAPH_START, aSeq, pWrtSh, 1 );
- EnableItem( MN_LANGUAGE_PARAGRAPH, true );
+ pMenu = GetPopupMenu(MN_SET_LANGUAGE_PARAGRAPH);
+ fillLangPopupMenu( pMenu, MN_SET_LANGUAGE_PARAGRAPH_START, aSeq, pWrtSh, aLangTable_Paragraph );
+ EnableItem( MN_SET_LANGUAGE_PARAGRAPH, true );
/*
- pMenu = GetPopupMenu(MN_LANGUAGE_ALL_TEXT);
- nNumLanguageDocEntries = fillLangPopupMenu( pMenu, MN_LANGUAGE_ALL_TEXT_START, aSeq, pWrtSh, 2 );
- EnableItem( MN_LANGUAGE_ALL_TEXT, true );
+ pMenu = GetPopupMenu(MN_SET_LANGUAGE_ALL_TEXT);
+ fillLangPopupMenu( pMenu, MN_SET_LANGUAGE_ALL_TEXT_START, aSeq, pWrtSh, aLangTable_Document );
+ EnableItem( MN_SET_LANGUAGE_ALL_TEXT, true );
*/
uno::Reference< frame::XFrame > xFrame = pWrtSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface();
Image rImg = ::GetImage( xFrame,
- ::rtl::OUString::createFromAscii(".uno:SpellingAndGrammarDialog"), sal_False,
+ OUString::createFromAscii(".uno:SpellingAndGrammarDialog"), sal_False,
Application::GetSettings().GetStyleSettings().GetHighContrastMode() );
- SetItemImage( MN_SPELLING, rImg );
+ SetItemImage( MN_SPELLING_DLG, rImg );
+
//////////////////////////////////////////////////////////////////////////////////
RemoveDisabledEntries( TRUE, TRUE );
@@ -601,7 +583,7 @@ SwSpellPopup::SwSpellPopup(
SwWrtShell *pWrtSh,
const linguistic2::ProofreadingResult &rResult,
sal_Int32 nErrorInResult,
- const uno::Sequence< rtl::OUString > &rSuggestions,
+ const uno::Sequence< OUString > &rSuggestions,
const String &rParaText ) :
PopupMenu( SW_RES(MN_SPELL_POPUP) ),
pSh( pWrtSh ),
@@ -611,13 +593,11 @@ aInfo16( SW_RES(IMG_INFO_16) )
{
nCheckedLanguage = SvxLocaleToLanguage( rResult.aLocale );
- sal_Int16 nItemId = 1;
- sal_Int16 nPos = 0;
+ USHORT nPos = 0;
OUString aMessageText( rResult.aErrors[ nErrorInResult ].aShortComment );
InsertSeparator( nPos++ );
- InsertItem( nItemId, aMessageText, MIB_NOSELECT, nPos++ );
- SetItemImage( nItemId, aInfo16 );
- ++nItemId;
+ InsertItem( MN_SHORT_COMMENT, aMessageText, MIB_NOSELECT, nPos++ );
+ SetItemImage( MN_SHORT_COMMENT, aInfo16 );
CreateAutoMnemonics();
@@ -634,12 +614,12 @@ aInfo16( SW_RES(IMG_INFO_16) )
aImage = Image( lcl_GetImageFromPngUrl( aSuggestionImageUrl ) );
}
+ USHORT nItemId = MN_SUGGESTION_START;
for (sal_uInt16 i = 0; i < nStringCount; ++i)
{
const String aEntry = aSuggestions[ i ];
InsertItem( nItemId, aEntry, 0, nPos++ );
SetHelpId( nItemId, HID_LINGU_REPLACE );
-
if (aSuggestionImageUrl.getLength() > 0)
SetItemImage( nItemId, aImage );
@@ -650,8 +630,8 @@ aInfo16( SW_RES(IMG_INFO_16) )
OUString aIgnoreSelection( String( SW_RES( STR_IGNORE_SELECTION ) ) );
OUString aSpellingAndGrammar = RetrieveLabelFromCommand( C2U(".uno:SpellingAndGrammarDialog") );
- SetItemText( MN_SPELLING, aSpellingAndGrammar );
- USHORT nItemPos = GetItemPos( MN_IGNORE );
+ SetItemText( MN_SPELLING_DLG, aSpellingAndGrammar );
+ USHORT nItemPos = GetItemPos( MN_IGNORE_WORD );
InsertItem( MN_IGNORE_SELECTION, aIgnoreSelection, 0, nItemPos );
SetHelpId( MN_IGNORE_SELECTION, HID_LINGU_IGNORE_SELECTION);
@@ -674,13 +654,13 @@ aInfo16( SW_RES(IMG_INFO_16) )
nGuessLangPara = nGuessLangWord;
}
- EnableItem( MN_IGNORE, false );
- EnableItem( MN_INSERT, false );
+ EnableItem( MN_IGNORE_WORD, false );
+ EnableItem( MN_ADD_TO_DIC, false );
//ADD NEW LANGUAGE MENU ITEM
///////////////////////////////////////////////////////////////////////////
String aScriptTypesInUse( String::CreateFromInt32( pWrtSh->GetScriptType() ) );
- SvtLanguageTable aLangTable;
+ SvtLanguageTable aLanguageTable;
// get keyboard language
String aKeyboardLang;
@@ -688,39 +668,39 @@ aInfo16( SW_RES(IMG_INFO_16) )
SwEditWin& rEditWin = pWrtSh->GetView().GetEditWin();
nLang = rEditWin.GetInputLanguage();
if (nLang != LANGUAGE_DONTKNOW && nLang != LANGUAGE_SYSTEM)
- aKeyboardLang = aLangTable.GetString( nLang );
+ aKeyboardLang = aLanguageTable.GetString( nLang );
// get the language that is in use
const String aMultipleLanguages = String::CreateFromAscii("*");
String aCurrentLang = aMultipleLanguages;
nLang = SwLangHelper::GetCurrentLanguage( *pWrtSh );
if (nLang != LANGUAGE_DONTKNOW)
- aCurrentLang = aLangTable.GetString( nLang );
+ aCurrentLang = aLanguageTable.GetString( nLang );
// build sequence for status value
- uno::Sequence< ::rtl::OUString > aSeq( 4 );
+ uno::Sequence< OUString > aSeq( 4 );
aSeq[0] = aCurrentLang;
aSeq[1] = aScriptTypesInUse;
aSeq[2] = aKeyboardLang;
- aSeq[3] = aLangTable.GetString(nGuessLangWord);
+ aSeq[3] = aLanguageTable.GetString(nGuessLangWord);
- PopupMenu *pMenu = GetPopupMenu(MN_LANGUAGE_SELECTION);
- nNumLanguageTextEntries = fillLangPopupMenu( pMenu, MN_LANGUAGE_SELECTION_START, aSeq, pWrtSh, 0 );
- EnableItem( MN_LANGUAGE_SELECTION, true );
+ PopupMenu *pMenu = GetPopupMenu(MN_SET_LANGUAGE_SELECTION);
+ fillLangPopupMenu( pMenu, MN_SET_LANGUAGE_SELECTION_START, aSeq, pWrtSh, aLangTable_Text );
+ EnableItem( MN_SET_LANGUAGE_SELECTION, true );
- pMenu = GetPopupMenu(MN_LANGUAGE_PARAGRAPH);
- nNumLanguageParaEntries = fillLangPopupMenu( pMenu, MN_LANGUAGE_PARAGRAPH_START, aSeq, pWrtSh, 1 );
- EnableItem( MN_LANGUAGE_PARAGRAPH, true );
+ pMenu = GetPopupMenu(MN_SET_LANGUAGE_PARAGRAPH);
+ fillLangPopupMenu( pMenu, MN_SET_LANGUAGE_PARAGRAPH_START, aSeq, pWrtSh, aLangTable_Paragraph );
+ EnableItem( MN_SET_LANGUAGE_PARAGRAPH, true );
/*
- pMenu = GetPopupMenu(MN_LANGUAGE_ALL_TEXT);
- nNumLanguageDocEntries = fillLangPopupMenu( pMenu, MN_LANGUAGE_ALL_TEXT_START, aSeq, pWrtSh, 2 );
- EnableItem( MN_LANGUAGE_ALL_TEXT, true );
+ pMenu = GetPopupMenu(MN_SET_LANGUAGE_ALL_TEXT);
+ fillLangPopupMenu( pMenu, MN_SET_LANGUAGE_ALL_TEXT_START, aSeq, pWrtSh, aLangTable_Document );
+ EnableItem( MN_SET_LANGUAGE_ALL_TEXT, true );
*/
uno::Reference< frame::XFrame > xFrame = pWrtSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface();
Image rImg = ::GetImage( xFrame,
- ::rtl::OUString::createFromAscii(".uno:SpellingAndGrammarDialog"), sal_False,
+ OUString::createFromAscii(".uno:SpellingAndGrammarDialog"), sal_False,
Application::GetSettings().GetStyleSettings().GetHighContrastMode() );
- SetItemImage( MN_SPELLING, rImg );
+ SetItemImage( MN_SPELLING_DLG, rImg );
//////////////////////////////////////////////////////////////////////////////////
@@ -743,25 +723,23 @@ sal_uInt16 SwSpellPopup::Execute( const Rectangle& rWordPos, Window* pWin )
-----------------------------------------------------------------------*/
void SwSpellPopup::Execute( USHORT nId )
{
- if (bGrammarResults && nId == 1)
- return; // nothing to do since it is the error message (short comment)
+ if (nId == USHRT_MAX)
+ return;
- sal_Bool bAutoCorr = sal_False;
- if( nId > MN_AUTOCORR_START && nId < MN_LANGUAGE_SELECTION_START && nId != USHRT_MAX )
- {
- nId -= MN_AUTOCORR_START;
- bAutoCorr = sal_True;
- }
+ if (/*bGrammarResults && */nId == MN_SHORT_COMMENT)
+ return; // nothing to do since it is the error message (short comment)
- if( nId && nId != USHRT_MAX)
+ if ((MN_SUGGESTION_START <= nId && nId <= MN_SUGGESTION_END) ||
+ (MN_AUTOCORR_START <= nId && nId <= MN_AUTOCORR_END))
{
- int nAltIdx = bGrammarResults ? nId - 2 : nId - 1;
- if ( nAltIdx >= 0 && nAltIdx < aSuggestions.getLength() && (bGrammarResults || xSpellAlt.is()) )
+ sal_Int32 nAltIdx = (MN_SUGGESTION_START <= nId && nId <= MN_SUGGESTION_END) ?
+ nId - MN_SUGGESTION_START : nId - MN_AUTOCORR_START;
+ DBG_ASSERT( 0 <= nAltIdx && nAltIdx < aSuggestions.getLength(), "index out of range" );
+ if (0 <= nAltIdx && nAltIdx < aSuggestions.getLength() && (bGrammarResults || xSpellAlt.is()))
{
sal_Bool bOldIns = pSh->IsInsMode();
pSh->SetInsMode( sal_True );
- DBG_ASSERT( 0 <= nAltIdx && nAltIdx <= aSuggestions.getLength(), "index out of range");
String aTmp( aSuggestions[ nAltIdx ] );
String aOrig( bGrammarResults ? OUString() : xSpellAlt->getWord() );
@@ -780,40 +758,30 @@ void SwSpellPopup::Execute( USHORT nId )
aRewriter.AddRule(UNDO_ARG1, pSh->GetCrsrDescr());
aRewriter.AddRule(UNDO_ARG2, String(SW_RES(STR_YIELDS)));
- {
- String aTmpStr;
-
- aTmpStr += String(SW_RES(STR_START_QUOTE));
- aTmpStr += aTmp;
- aTmpStr += String(SW_RES(STR_END_QUOTE));
- aRewriter.AddRule(UNDO_ARG3, aTmpStr);
- }
+ String aTmpStr( SW_RES(STR_START_QUOTE) );
+ aTmpStr += aTmp;
+ aTmpStr += String(SW_RES(STR_END_QUOTE));
+ aRewriter.AddRule(UNDO_ARG3, aTmpStr);
pSh->StartUndo(UNDO_UI_REPLACE, &aRewriter);
pSh->StartAction();
pSh->DelLeft();
pSh->Insert( aTmp );
+
/* #102505# EndAction/EndUndo moved down since insertion
of temporary auto correction is now undoable two and
must reside in the same undo group.*/
-
// nur aufnehmen, wenn es NICHT schon in der Autokorrektur vorhanden ist
SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
String aOrigWord( bGrammarResults ? OUString() : xSpellAlt->getWord() ) ;
- String aNewWord;
- if( nId )
- aNewWord = aSuggestions[ nAltIdx ];
- else
- aNewWord = aOrigWord;
+ String aNewWord( aSuggestions[ nAltIdx ] );
SvxPrepareAutoCorrect( aOrigWord, aNewWord );
- if( bAutoCorr )
- {
+ if (MN_AUTOCORR_START <= nId && nId <= MN_AUTOCORR_END)
pACorr->PutText( aOrigWord, aNewWord, nCheckedLanguage );
- }
/* #102505# EndAction/EndUndo moved down since insertion
of temporary auto correction is now undoable two and
@@ -823,180 +791,140 @@ void SwSpellPopup::Execute( USHORT nId )
pSh->SetInsMode( bOldIns );
}
- else
+ }
+ else if (nId == MN_SPELLING_DLG)
+ {
+ if (bGrammarResults)
+ {
+ SvtLinguConfig().SetProperty( A2OU( UPN_IS_GRAMMAR_INTERACTIVE ), uno::makeAny( sal_True ));
+ }
+ pSh->Left(CRSR_SKIP_CHARS, FALSE, 1, FALSE );
{
- if (nId < MN_LANGUAGE_SELECTION_START)
+ uno::Reference<linguistic2::XDictionaryList> xDictionaryList( SvxGetDictionaryList() );
+ SvxDicListChgClamp aClamp( xDictionaryList );
+ pSh->GetView().GetViewFrame()->GetDispatcher()->
+ Execute( FN_SPELL_GRAMMAR_DIALOG, SFX_CALLMODE_ASYNCHRON );
+ }
+ }
+ else if (nId == MN_IGNORE_SELECTION)
+ {
+ SwPaM *pPaM = pSh->GetCrsr();
+ if (pPaM)
+ pSh->IgnoreGrammarErrorAt( *pPaM );
+ }
+ else if (nId == MN_IGNORE_WORD)
+ {
+ uno::Reference< linguistic2::XDictionary > xDictionary( SvxGetIgnoreAllList(), uno::UNO_QUERY );
+ linguistic::AddEntryToDic( xDictionary,
+ xSpellAlt->getWord(), sal_False, aEmptyStr, LANGUAGE_NONE );
+ }
+ else if (MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END)
+ {
+ OUString aWord( xSpellAlt->getWord() );
+ USHORT nDicIdx = nId - MN_DICTIONARIES_START;
+ DBG_ASSERT( nDicIdx < aDics.getLength(), "dictionary index out of range" );
+
+ if (nDicIdx < aDics.getLength())
{
- switch( nId )
+ uno::Reference< linguistic2::XDictionary > xDic = aDics.getConstArray()[nDicIdx];
+ INT16 nAddRes = linguistic::AddEntryToDic( xDic, aWord, FALSE, aEmptyStr, LANGUAGE_NONE );
+ // save modified user-dictionary if it is persistent
+ uno::Reference< frame::XStorable > xSavDic( xDic, uno::UNO_QUERY );
+ if (xSavDic.is())
+ xSavDic->store();
+
+ if (DIC_ERR_NONE != nAddRes
+ && !xDic->getEntry( aWord ).is())
{
- case MN_SPELLING:
- {
- if (bGrammarResults)
- {
- SvtLinguConfig().SetProperty( A2OU( UPN_IS_GRAMMAR_INTERACTIVE ), uno::makeAny( sal_True ));
- }
- pSh->Left(CRSR_SKIP_CHARS, FALSE, 1, FALSE );
- {
- uno::Reference<linguistic2::XDictionaryList> xDictionaryList( SvxGetDictionaryList() );
- SvxDicListChgClamp aClamp( xDictionaryList );
- pSh->GetView().GetViewFrame()->GetDispatcher()->
- Execute( FN_SPELL_GRAMMAR_DIALOG, SFX_CALLMODE_ASYNCHRON );
- }
- }
- break;
- case MN_IGNORE_SELECTION :
- {
- SwPaM *pPaM = pSh->GetCrsr();
- if (pPaM)
- pSh->IgnoreGrammarErrorAt( *pPaM );
- }
- break;
- case MN_IGNORE :
- {
- uno::Reference< linguistic2::XDictionary > xDictionary( SvxGetIgnoreAllList(), uno::UNO_QUERY );
- linguistic::AddEntryToDic(
- xDictionary,
- xSpellAlt->getWord(), sal_False,
- aEmptyStr, LANGUAGE_NONE );
- }
- break;
- case MN_INSERT:
- DBG_ERROR("geht noch nicht!");
- break;
- case MN_LANGUAGE_WORD:
- case MN_LANGUAGE_PARA:
- {
- pSh->StartAction();
-
- if( MN_LANGUAGE_PARA == nId )
- {
- if( !pSh->IsSttPara() )
- pSh->MovePara( fnParaCurr, fnParaStart );
- pSh->SwapPam();
- if( !pSh->IsEndPara() )
- pSh->MovePara( fnParaCurr, fnParaEnd );
- }
-
- LanguageType nLangToUse = (MN_LANGUAGE_PARA == nId) ? nGuessLangPara : nGuessLangWord;
- sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( nLangToUse );
- USHORT nResId = 0;
- switch (nScriptType)
- {
- case SCRIPTTYPE_COMPLEX : nResId = RES_CHRATR_CTL_LANGUAGE; break;
- case SCRIPTTYPE_ASIAN : nResId = RES_CHRATR_CJK_LANGUAGE; break;
- default /*SCRIPTTYPE_LATIN*/: nResId = RES_CHRATR_LANGUAGE; break;
- }
- SfxItemSet aSet(pSh->GetAttrPool(), nResId, nResId );
- aSet.Put( SvxLanguageItem( nLangToUse, nResId ) );
- pSh->SetAttr( aSet );
-
- pSh->EndAction();
- }
- break;
- default:
- if(nId >= MN_INSERT_START )
- {
- OUString aWord( xSpellAlt->getWord() );
- INT32 nDicIdx = nId - MN_INSERT_START - 1;
- DBG_ASSERT( nDicIdx < aDics.getLength(),
- "dictionary index out of range" );
- uno::Reference< linguistic2::XDictionary > xDic =
- aDics.getConstArray()[nDicIdx];
- INT16 nAddRes = linguistic::AddEntryToDic( xDic,
- aWord, FALSE, aEmptyStr, LANGUAGE_NONE );
- // save modified user-dictionary if it is persistent
- uno::Reference< frame::XStorable > xSavDic( xDic, uno::UNO_QUERY );
- if (xSavDic.is())
- xSavDic->store();
-
- if (DIC_ERR_NONE != nAddRes
- && !xDic->getEntry( aWord ).is())
- {
- SvxDicError(
- &pSh->GetView().GetViewFrame()->GetWindow(),
- nAddRes );
- }
- }
+ SvxDicError(
+ &pSh->GetView().GetViewFrame()->GetWindow(),
+ nAddRes );
}
}
- else
- {
- SfxItemSet aCoreSet( pSh->GetView().GetPool(),
- RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE,
- RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE,
- RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_LANGUAGE,
- 0 );
- String aNewLangTxt;
-
-// pSh->StartAction();
+ }
+ else
+ {
+ // Set language for selection or for paragraph...
- if (nId >= MN_LANGUAGE_SELECTION_START && nId < MN_LANGUAGE_SELECTION_START + nNumLanguageTextEntries - 1)
- {
- //Set language for current selection
- aNewLangTxt=aLangTable_Text[nId];
- SwLangHelper::SetLanguage( *pSh, aNewLangTxt, true, aCoreSet );
- }
- else if (nId == MN_LANGUAGE_SELECTION_START + nNumLanguageTextEntries - 1)
- {
- //Set Language_None for current selection
- SwLangHelper::SetLanguage_None( *pSh, true, aCoreSet );
- }
- else if (nId == MN_LANGUAGE_SELECTION_START + nNumLanguageTextEntries)
- {
- //Open Format/Character Dialog
- lcl_CharDialog( *pSh, true, nId, 0, 0 );
- }
- else if (nId >= MN_LANGUAGE_PARAGRAPH_START && nId < MN_LANGUAGE_PARAGRAPH_START + nNumLanguageParaEntries - 1)
- {
- //Set language for current paragraph
- aNewLangTxt=aLangTable_Paragraph[nId];
- pSh->Push(); // save cursor
- SwLangHelper::SelectCurrentPara( *pSh );
- SwLangHelper::SetLanguage( *pSh, aNewLangTxt, true, aCoreSet );
- pSh->Pop( FALSE ); // restore cursor
- }
- else if (nId == MN_LANGUAGE_PARAGRAPH_START + nNumLanguageParaEntries - 1)
- {
- //Set Language_None for current paragraph
- pSh->Push(); // save cursor
- SwLangHelper::SelectCurrentPara( *pSh );
- SwLangHelper::SetLanguage_None( *pSh, true, aCoreSet );
- pSh->Pop( FALSE ); // restore cursor
- }
- else if (nId == MN_LANGUAGE_PARAGRAPH_START + nNumLanguageParaEntries)
- {
- pSh->Push(); // save cursor
- SwLangHelper::SelectCurrentPara( *pSh );
- //Open Format/Character Dialog
- lcl_CharDialog( *pSh, true, nId, 0, 0 );
- pSh->Pop( FALSE ); // restore cursor
- }
- else if (nId >= MN_LANGUAGE_ALL_TEXT_START && nId < MN_LANGUAGE_ALL_TEXT_START + nNumLanguageDocEntries - 1)
- {
- //Set selected language as the default language
- aNewLangTxt=aLangTable_Document[nId];
- SwLangHelper::SetLanguage( *pSh, aNewLangTxt, false, aCoreSet );
- }
- else if (nId == MN_LANGUAGE_ALL_TEXT_START + nNumLanguageDocEntries - 1)
- {
- //Set Language_None as the default language
- SwLangHelper::SetLanguage_None( *pSh, false, aCoreSet );
- }
- else if (nId == MN_LANGUAGE_ALL_TEXT_START + nNumLanguageDocEntries)
- {
- // open the dialog "Tools/Options/Language Settings - Language"
- SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- if (pFact)
- {
- VclAbstractDialog* pDlg = pFact->CreateVclDialog( pSh->GetView().GetWindow(), SID_LANGUAGE_OPTIONS );
- pDlg->Execute();
- delete pDlg;
- }
- }
+ SfxItemSet aCoreSet( pSh->GetView().GetPool(),
+ RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE,
+ RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE,
+ RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_LANGUAGE,
+ 0 );
+ String aNewLangTxt;
-// pSh->EndAction();
+ if (MN_SET_LANGUAGE_SELECTION_START <= nId && nId <= MN_SET_LANGUAGE_SELECTION_END)
+ {
+ //Set language for current selection
+ aNewLangTxt = aLangTable_Text[nId];
+ SwLangHelper::SetLanguage( *pSh, aNewLangTxt, true, aCoreSet );
+ }
+ else if (nId == MN_SET_SELECTION_NONE)
+ {
+ //Set Language_None for current selection
+ SwLangHelper::SetLanguage_None( *pSh, true, aCoreSet );
+ }
+ else if (nId == MN_SET_SELECTION_RESET)
+ {
+ //reset languages for current selection
+ SwLangHelper::ResetLanguages( *pSh, true );
+ }
+ else if (nId == MN_SET_SELECTION_MORE)
+ {
+ //Open Format/Character Dialog
+ lcl_CharDialog( *pSh, true, nId, 0, 0 );
+ }
+ else if (MN_SET_LANGUAGE_PARAGRAPH_START <= nId && nId <= MN_SET_LANGUAGE_PARAGRAPH_END)
+ {
+ //Set language for current paragraph
+ aNewLangTxt = aLangTable_Paragraph[nId];
+ pSh->Push(); // save cursor
+ SwLangHelper::SelectCurrentPara( *pSh );
+ SwLangHelper::SetLanguage( *pSh, aNewLangTxt, true, aCoreSet );
+ pSh->Pop( FALSE ); // restore cursor
+ }
+ else if (nId == MN_SET_PARA_NONE)
+ {
+ //Set Language_None for current paragraph
+ pSh->Push(); // save cursor
+ SwLangHelper::SelectCurrentPara( *pSh );
+ SwLangHelper::SetLanguage_None( *pSh, true, aCoreSet );
+ pSh->Pop( FALSE ); // restore cursor
+ }
+ else if (nId == MN_SET_PARA_RESET)
+ {
+ //reset languages for current paragraph
+ pSh->Push(); // save cursor
+ SwLangHelper::SelectCurrentPara( *pSh );
+ SwLangHelper::ResetLanguages( *pSh, true );
+ pSh->Pop( FALSE ); // restore cursor
+ }
+ else if (nId == MN_SET_PARA_MORE)
+ {
+ pSh->Push(); // save cursor
+ SwLangHelper::SelectCurrentPara( *pSh );
+ //Open Format/Character Dialog
+ lcl_CharDialog( *pSh, true, nId, 0, 0 );
+ pSh->Pop( FALSE ); // restore cursor
+ }
+#if 0
+ else if (nId == MN_SET_LANGUAGE_ALL_TEXT_START + nNumLanguageDocEntries - 1)
+ {
+ //Set Language_None as the default language
+ SwLangHelper::SetLanguage_None( *pSh, false, aCoreSet );
+ }
+ else if (nId == MN_SET_LANGUAGE_ALL_TEXT_START + nNumLanguageDocEntries)
+ {
+ // open the dialog "Tools/Options/Language Settings - Language"
+ SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
+ if (pFact)
+ {
+ VclAbstractDialog* pDlg = pFact->CreateVclDialog( pSh->GetView().GetWindow(), SID_LANGUAGE_OPTIONS );
+ pDlg->Execute();
+ delete pDlg;
}
}
+#endif
}
pSh->EnterStdMode();
diff --git a/sw/source/ui/lingu/olmenu.hrc b/sw/source/ui/lingu/olmenu.hrc
index 11e7b03d440b..887f8a2ad3af 100644
--- a/sw/source/ui/lingu/olmenu.hrc
+++ b/sw/source/ui/lingu/olmenu.hrc
@@ -30,35 +30,65 @@
#include "rcid.hrc"
-#define MN_SPELL_POPUP (RC_LINGU_BEGIN + 1)
-#define STR_SPELL_OK (RC_LINGU_BEGIN + 2)
-#define STR_HYP_OK (RC_LINGU_BEGIN + 3)
-#define STR_WORD (RC_LINGU_BEGIN + 4)
-#define STR_PARAGRAPH (RC_LINGU_BEGIN + 5)
-#define STR_LANGSTATUS_NONE (RC_LINGU_BEGIN + 6)
-#define STR_LANGSTATUS_MORE (RC_LINGU_BEGIN + 7)
-#define STR_IGNORE_SELECTION (RC_LINGU_BEGIN + 8)
+#define MN_SPELL_POPUP (RC_LINGU_BEGIN + 1)
+#define STR_SPELL_OK (RC_LINGU_BEGIN + 2)
+#define STR_HYP_OK (RC_LINGU_BEGIN + 3)
+#define STR_WORD (RC_LINGU_BEGIN + 4)
+#define STR_PARAGRAPH (RC_LINGU_BEGIN + 5)
+#define STR_LANGSTATUS_NONE (RC_LINGU_BEGIN + 6)
+#define STR_LANGSTATUS_MORE (RC_LINGU_BEGIN + 7)
+#define STR_IGNORE_SELECTION (RC_LINGU_BEGIN + 8)
+#define STR_RESET_TO_DEFAULT_LANGUAGE (RC_LINGU_BEGIN + 9)
-#define IMG_INFO_16 (RC_LINGU_BEGIN + 8)
+#define IMG_INFO_16 (RC_LINGU_BEGIN + 100)
//! Don't change these values. You may break context menu modifying extensions!
-#define MN_SPELLING 100
-#define MN_IGNORE_SELECTION 101
-#define MN_IGNORE 102
-#define MN_INSERT 103
-#define MN_AUTOCORR 104
-#define MN_LANGUAGE_WORD 105
-#define MN_LANGUAGE_PARA 106
-#define MN_LANGUAGE_SELECTION 107
-#define MN_LANGUAGE_PARAGRAPH 108
-#define MN_LANGUAGE_ALL_TEXT 109
-
-#define MN_INSERT_START 500
-#define MN_AUTOCORR_START 900
-
-#define MN_LANGUAGE_SELECTION_START 1170
-#define MN_LANGUAGE_PARAGRAPH_START 1270
-#define MN_LANGUAGE_ALL_TEXT_START 1370
+#define MN_SPELLING_DLG 200
+#define MN_IGNORE_SELECTION 201
+#define MN_IGNORE_WORD 202
+#define MN_ADD_TO_DIC 203
+#define MN_AUTOCORR 204
+#define MN_SET_LANGUAGE_SELECTION 205
+#define MN_SET_LANGUAGE_PARAGRAPH 206
+#define MN_SET_LANGUAGE_ALL_TEXT 207
+#define MN_SHORT_COMMENT 208
+
+// id range for dictionaries sub menu
+#define MN_DICTIONARIES_START 300
+#define MN_DICTIONARIES_END (MN_DICTIONARIES_START + 99)
+
+// id range for suggestions from spell and grammar checker
+#define MN_SUGGESTION_START 500
+#define MN_SUGGESTION_END (MN_SUGGESTION_START + MN_MAX_NUM_LANG)
+
+// id range for auto correction sub menu entries
+#define MN_AUTOCORR_START 700
+#define MN_AUTOCORR_END (MN_AUTOCORR_START + MN_MAX_NUM_LANG)
+
+// max number of language entries sub menus
+#define MN_MAX_NUM_LANG 99
+
+#define MN_NONE_OFFSET (MN_MAX_NUM_LANG + 1)
+#define MN_RESET_OFFSET (MN_MAX_NUM_LANG + 2)
+#define MN_MORE_OFFSET (MN_MAX_NUM_LANG + 3)
+
+// id range for 'set language for selection' sub menu entries
+#define MN_SET_LANGUAGE_SELECTION_START 900
+#define MN_SET_LANGUAGE_SELECTION_END (MN_SET_LANGUAGE_SELECTION_START + MN_MAX_NUM_LANG)
+#define MN_SET_SELECTION_NONE (MN_SET_LANGUAGE_SELECTION_START + MN_NONE_OFFSET)
+#define MN_SET_SELECTION_RESET (MN_SET_LANGUAGE_SELECTION_START + MN_RESET_OFFSET)
+#define MN_SET_SELECTION_MORE (MN_SET_LANGUAGE_SELECTION_START + MN_MORE_OFFSET)
+
+// id range for 'set language for paragraph' sub menu entries
+#define MN_SET_LANGUAGE_PARAGRAPH_START 1100
+#define MN_SET_LANGUAGE_PARAGRAPH_END (MN_SET_LANGUAGE_PARAGRAPH_START + MN_MAX_NUM_LANG)
+#define MN_SET_PARA_NONE (MN_SET_LANGUAGE_PARAGRAPH_START + MN_NONE_OFFSET)
+#define MN_SET_PARA_RESET (MN_SET_LANGUAGE_PARAGRAPH_START + MN_RESET_OFFSET)
+#define MN_SET_PARA_MORE (MN_SET_LANGUAGE_PARAGRAPH_START + MN_MORE_OFFSET)
+
+// id range for 'set language for all text' sub menu entries
+#define MN_SET_LANGUAGE_ALL_TEXT_START 1300
+#define MN_SET_LANGUAGE_ALL_TEXT_END (MN_SET_LANGUAGE_ALL_TEXT_START + MN_MAX_NUM_LANG)
#endif
diff --git a/sw/source/ui/lingu/olmenu.src b/sw/source/ui/lingu/olmenu.src
index 487215c2bff6..b8d9124d2e52 100644
--- a/sw/source/ui/lingu/olmenu.src
+++ b/sw/source/ui/lingu/olmenu.src
@@ -38,13 +38,13 @@ Menu MN_SPELL_POPUP
{
MenuItem
{
- Identifier = MN_IGNORE ;
+ Identifier = MN_IGNORE_WORD ;
HelpID = HID_LINGU_IGNORE_WORD ;
Text [ en-US ] = "Ignore All" ;
};
MenuItem
{
- Identifier = MN_INSERT ;
+ Identifier = MN_ADD_TO_DIC ;
HelpID = HID_LINGU_ADD_WORD ;
SubMenu = Menu
{
@@ -62,14 +62,14 @@ Menu MN_SPELL_POPUP
};
MenuItem
{
- Identifier = MN_SPELLING ;
+ Identifier = MN_SPELLING_DLG ;
HelpID = HID_LINGU_SPELLING_DLG ;
Text [ en-US ] = "~Spellcheck..." ;
};
SEPARATOR
MenuItem
{
- Identifier = MN_LANGUAGE_SELECTION ;
+ Identifier = MN_SET_LANGUAGE_SELECTION ;
SubMenu = Menu
{
};
@@ -77,7 +77,7 @@ Menu MN_SPELL_POPUP
};
MenuItem
{
- Identifier = MN_LANGUAGE_PARAGRAPH ;
+ Identifier = MN_SET_LANGUAGE_PARAGRAPH ;
SubMenu = Menu
{
};
@@ -86,7 +86,7 @@ Menu MN_SPELL_POPUP
/*
MenuItem
{
- Identifier = MN_LANGUAGE_ALL_TEXT ;
+ Identifier = MN_SET_LANGUAGE_ALL_TEXT ;
SubMenu = Menu
{
};
@@ -115,6 +115,11 @@ String STR_LANGSTATUS_NONE
{
Text [ en-US ] = "None (Do not check spelling)" ;
};
+String STR_RESET_TO_DEFAULT_LANGUAGE
+{
+ Text [ en-US ] = "Reset to Default Language" ;
+ Text [ x-comment ] = " ";
+};
String STR_LANGSTATUS_MORE
{
Text [ en-US ] = "More..." ;
diff --git a/sw/source/ui/ribbar/makefile.mk b/sw/source/ui/ribbar/makefile.mk
index 72acc793070a..2405d4b16d9f 100644
--- a/sw/source/ui/ribbar/makefile.mk
+++ b/sw/source/ui/ribbar/makefile.mk
@@ -45,6 +45,11 @@ SRC1FILES = \
tblctrl.src \
workctrl.src
+EXCEPTIONSFILES = \
+ $(SLO)$/tblctrl.obj \
+ $(SLO)$/tbxanchr.obj \
+ $(SLO)$/workctrl.obj
+
SLOFILES = \
$(SLO)$/inputwin.obj \
$(SLO)$/tbxanchr.obj \
diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx
index 52c4d10c3f02..e795c123d3a2 100755
--- a/sw/source/ui/shells/annotsh.cxx
+++ b/sw/source/ui/shells/annotsh.cxx
@@ -27,13 +27,17 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
-#include <tools/shl.hxx>
#include <com/sun/star/i18n/TransliterationModules.hpp>
+#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
#include <com/sun/star/i18n/TextConversionOption.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
+
+#include <tools/shl.hxx>
+#include <i18npool/mslangid.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/bindings.hxx>
@@ -117,8 +121,8 @@
#include <docsh.hxx>
#include <svl/undo.hxx>
-#include "swabstdlg.hxx" //CHINA001
-#include "chrdlg.hrc" //CHINA001
+#include "swabstdlg.hxx"
+#include "chrdlg.hrc"
#include "misc.hrc"
#include <app.hrc>
@@ -1138,7 +1142,17 @@ void SwAnnotationShell::ExecLingu(SfxRequest &rReq)
bRestoreSelection = SwLangHelper::SetLanguageStatus(pOLV,rReq,rView,rSh);
break;
}
- case FN_THESAURUS_DLG:
+ case SID_THES:
+ {
+ String aReplaceText;
+ SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES, sal_False );
+ if (pItem2)
+ aReplaceText = pItem2->GetValue();
+ if (aReplaceText.Len() > 0)
+ ReplaceTextWithSynonym( pOLV->GetEditView(), aReplaceText );
+ break;
+ }
+ case SID_THESAURUS:
{
pOLV->StartThesaurus();
break;
@@ -1246,8 +1260,25 @@ void SwAnnotationShell::GetLinguState(SfxItemSet &rSet)
SwLangHelper::GetLanguageStatus(pOLV,rSet);
break;
}
+
+ case SID_THES:
+ {
+ String aStatusVal;
+ LanguageType nLang = LANGUAGE_NONE;
+ bool bIsLookUpWord = GetStatusValueForThesaurusFromContext( aStatusVal, nLang, pOLV->GetEditView() );
+ rSet.Put( SfxStringItem( SID_THES, aStatusVal ) );
+
+ // disable "Thesaurus" context menu entry if there is nothing to look up
+ uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() );
+ lang::Locale aLocale( SvxCreateLocale( nLang ) );
+ if (!bIsLookUpWord ||
+ !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale ))
+ rSet.DisableItem( SID_THES );
+ break;
+ }
+
// disable "Thesaurus" if the language is not supported
- case FN_THESAURUS_DLG:
+ case SID_THESAURUS:
{
const SfxPoolItem &rItem = rView.GetWrtShell().GetDoc()->GetDefault(
GetWhichOfScript( RES_CHRATR_LANGUAGE,
@@ -1257,7 +1288,7 @@ void SwAnnotationShell::GetLinguState(SfxItemSet &rSet)
uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() );
if (!xThes.is() || nLang == LANGUAGE_NONE ||
!xThes->hasLocale( SvxCreateLocale( nLang ) ))
- rSet.DisableItem( FN_THESAURUS_DLG );
+ rSet.DisableItem( SID_THESAURUS );
}
break;
case SID_HANGUL_HANJA_CONVERSION:
@@ -1295,6 +1326,15 @@ void SwAnnotationShell::ExecTransliteration(SfxRequest &rReq)
switch( rReq.GetSlot() )
{
+ case SID_TRANSLITERATE_SENTENCE_CASE:
+ nMode = TransliterationModulesExtra::SENTENCE_CASE;
+ break;
+ case SID_TRANSLITERATE_TITLE_CASE:
+ nMode = TransliterationModulesExtra::TITLE_CASE;
+ break;
+ case SID_TRANSLITERATE_TOGGLE_CASE:
+ nMode = TransliterationModulesExtra::TOGGLE_CASE;
+ break;
case SID_TRANSLITERATE_UPPER:
nMode = TransliterationModules_LOWERCASE_UPPERCASE;
break;
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index 0cee102729a7..0500b4a88310 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -703,8 +703,9 @@ void SwBaseShell::Execute(SfxRequest &rReq)
rSh.EndSelect();
}
BOOL bRet = rSh.MoveFldType(pFldType, nSlot == FN_GOTO_NEXT_MARK);
- if (bRet)
- rSh.ClickToField(*rSh.GetCurFld());
+ SwField* pCurField = bRet ? rSh.GetCurFld() : 0;
+ if (pCurField)
+ rSh.ClickToField(*pCurField);
rReq.SetReturnValue(SfxBoolItem( nSlot, bRet));
}
}
diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx
index 94d49720a50c..c95ad7e64c1c 100644
--- a/sw/source/ui/shells/drwtxtex.cxx
+++ b/sw/source/ui/shells/drwtxtex.cxx
@@ -27,8 +27,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <hintids.hxx>
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+
+#include <comphelper/processfactory.hxx>
+#include <i18npool/mslangid.hxx>
+#include <sfx2/bindings.hxx>
+#include <sfx2/dispatch.hxx>
+#include <sfx2/request.hxx>
#include <tools/shl.hxx>
#include <svx/svdview.hxx>
#include <editeng/spltitem.hxx>
@@ -37,9 +43,7 @@
#include <editeng/widwitem.hxx>
#include <editeng/kernitem.hxx>
#include <editeng/escpitem.hxx>
-#ifndef _SVX_PARAITEM_HXX //autogen
#include <editeng/lspcitem.hxx>
-#endif
#include <editeng/adjitem.hxx>
#include <editeng/crsditem.hxx>
#include <editeng/shdditem.hxx>
@@ -49,9 +53,7 @@
#include <editeng/fhgtitem.hxx>
#include <editeng/colritem.hxx>
#include <editeng/wghtitem.hxx>
-#ifndef _SVX_CNTRITEM_HXX //autogen
#include <editeng/cntritem.hxx>
-#endif
#include <editeng/postitem.hxx>
#include <editeng/frmdiritem.hxx>
#include <svx/svdoutl.hxx>
@@ -59,6 +61,8 @@
#include <svl/whiter.hxx>
#include <svl/cjkoptions.hxx>
#include <svl/ctloptions.hxx>
+#include <svtools/langtab.hxx>
+#include <svl/languageoptions.hxx>
#include <sfx2/bindings.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/dispatch.hxx>
@@ -67,48 +71,66 @@
#include <editeng/editstat.hxx>
#include <svx/hlnkitem.hxx>
#include <svx/htmlmode.hxx>
+#include <svl/languageoptions.hxx>
+#include <svl/slstitm.hxx>
#include <editeng/langitem.hxx>
+#include <svtools/langtab.hxx>
#include <editeng/unolingu.hxx>
#include <editeng/scripttypeitem.hxx>
#include <editeng/writingmodeitem.hxx>
+#include <editeng/eeitem.hxx>
+#include <editeng/editeng.hxx>
+#include <editeng/editdata.hxx>
+#include <editeng/outliner.hxx>
+#include <vcl/window.hxx>
+#include <editeng/editview.hxx>
+#include <vcl/outdev.hxx>
+#include <editeng/hyznitem.hxx>
+#include <editeng/kernitem.hxx>
+#include <editeng/langitem.hxx>
+#include <editeng/lspcitem.hxx>
+#include <editeng/orphitem.hxx>
+#include <editeng/outliner.hxx>
+#include <editeng/postitem.hxx>
+#include <editeng/scripttypeitem.hxx>
+#include <editeng/shdditem.hxx>
+#include <editeng/spltitem.hxx>
+#include <svx/svdoutl.hxx>
+#include <svx/svdview.hxx>
+#include <editeng/udlnitem.hxx>
+#include <editeng/unolingu.hxx>
+#include <editeng/wghtitem.hxx>
+#include <editeng/widwitem.hxx>
+#include <editeng/writingmodeitem.hxx>
+#include <tools/shl.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/outdev.hxx>
+#include <vcl/window.hxx>
+
+#include <cmdid.h>
#include <doc.hxx>
-#include <wview.hxx>
-#include <viewopt.hxx>
-#include <wrtsh.hxx>
-#include <uitool.hxx>
+#include <docstat.hxx>
+#include <drwtxtsh.hxx>
+#include <edtwin.hxx>
+#include <globals.hrc>
+#include <hintids.hxx>
+#include <initui.hxx> // fuer SpellPointer
+#include <langhelper.hxx>
#include <pardlg.hxx>
+#include <shells.hrc>
+#include <string.h>
#include <swdtflvr.hxx>
-#include <drwtxtsh.hxx>
#include <swmodule.hxx>
-#include <initui.hxx> // fuer SpellPointer
-#include <edtwin.hxx>
#include <swwait.hxx>
-#include <docstat.hxx>
-
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#include <uitool.hxx>
+#include <viewopt.hxx>
+#include <wrtsh.hxx>
+#include <wview.hxx>
-#include <cmdid.h>
-#include <globals.hrc>
-#include <shells.hrc>
#include "swabstdlg.hxx"
#include "chrdlg.hrc"
#include "misc.hrc"
-//modified on Jul. 30th
-#include <svl/languageoptions.hxx>
-#include <editeng/langitem.hxx>
-#include <svtools/langtab.hxx>
-#include <svl/slstitm.hxx>
-#include <string.h>
-
-#include <editeng/eeitem.hxx>
-#include <editeng/editeng.hxx>
-#include <editeng/editdata.hxx>
-#include <editeng/outliner.hxx>
-#include <vcl/window.hxx>
-#include <editeng/editview.hxx>
-#include <vcl/outdev.hxx>
#include <langhelper.hxx>
@@ -148,6 +170,18 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
bRestoreSelection = SwLangHelper::SetLanguageStatus(pOLV,rReq,GetView(),rSh);
break;
}
+
+ case SID_THES:
+ {
+ String aReplaceText;
+ SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES, sal_False );
+ if (pItem2)
+ aReplaceText = pItem2->GetValue();
+ if (aReplaceText.Len() > 0)
+ ReplaceTextWithSynonym( pOLV->GetEditView(), aReplaceText );
+ break;
+ }
+
case SID_ATTR_CHAR_FONT:
case SID_ATTR_CHAR_FONTHEIGHT:
case SID_ATTR_CHAR_WEIGHT:
@@ -569,7 +603,27 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet)
nSlotId = SwLangHelper::GetLanguageStatus(pOLV,rSet);;
break;
}
- case SID_ATTR_PARA_ADJUST_LEFT: eAdjust = SVX_ADJUST_LEFT; goto ASK_ADJUST;
+
+ case SID_THES:
+ {
+ String aStatusVal;
+ LanguageType nLang = LANGUAGE_NONE;
+ bool bIsLookUpWord = GetStatusValueForThesaurusFromContext( aStatusVal, nLang, pOLV->GetEditView() );
+ rSet.Put( SfxStringItem( SID_THES, aStatusVal ) );
+
+ // disable "Thesaurus" context menu entry if there is nothing to look up
+ uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() );
+ lang::Locale aLocale( SvxCreateLocale( nLang ) );
+ if (!bIsLookUpWord ||
+ !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale ))
+ rSet.DisableItem( SID_THES );
+
+ //! avoid puting the same item as SfxBoolItem at the end of this function
+ nSlotId = 0;
+ break;
+ }
+
+ case SID_ATTR_PARA_ADJUST_LEFT: eAdjust = SVX_ADJUST_LEFT; goto ASK_ADJUST;
case SID_ATTR_PARA_ADJUST_RIGHT: eAdjust = SVX_ADJUST_RIGHT; goto ASK_ADJUST;
case SID_ATTR_PARA_ADJUST_CENTER: eAdjust = SVX_ADJUST_CENTER; goto ASK_ADJUST;
case SID_ATTR_PARA_ADJUST_BLOCK: eAdjust = SVX_ADJUST_BLOCK; goto ASK_ADJUST;
@@ -620,19 +674,17 @@ ASK_ESCAPE:
}
break;
- case FN_THESAURUS_DLG:
+ case SID_THESAURUS:
{
// disable "Thesaurus" if the language is not supported
const SfxPoolItem &rItem = GetShell().GetDoc()->GetDefault(
GetWhichOfScript( RES_CHRATR_LANGUAGE,
GetI18NScriptTypeOfLanguage( (USHORT)GetAppLanguage())) );
- LanguageType nLang = ((const SvxLanguageItem &)
- rItem).GetLanguage();
- //
+ LanguageType nLang = ((const SvxLanguageItem &) rItem).GetLanguage();
+
uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() );
- if (!xThes.is() || nLang == LANGUAGE_NONE ||
- !xThes->hasLocale( SvxCreateLocale( nLang ) ))
- rSet.DisableItem( FN_THESAURUS_DLG );
+ if (!xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( SvxCreateLocale( nLang ) ))
+ rSet.DisableItem( SID_THESAURUS );
nSlotId = 0;
}
break;
diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx
index 4b8e2c65c5fc..78a9b05ce70b 100644
--- a/sw/source/ui/shells/drwtxtsh.cxx
+++ b/sw/source/ui/shells/drwtxtsh.cxx
@@ -52,6 +52,7 @@
#include <editeng/editstat.hxx>
#include <svx/svdoutl.hxx>
#include <com/sun/star/i18n/TransliterationModules.hpp>
+#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
#include <com/sun/star/i18n/TextConversionOption.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
@@ -392,7 +393,7 @@ void SwDrawTextShell::ExecDrawLingu(SfxRequest &rReq)
{
switch(rReq.GetSlot())
{
- case FN_THESAURUS_DLG:
+ case SID_THESAURUS:
pOLV->StartThesaurus();
break;
@@ -717,6 +718,15 @@ void SwDrawTextShell::ExecTransliteration( SfxRequest & rReq )
switch( rReq.GetSlot() )
{
+ case SID_TRANSLITERATE_SENTENCE_CASE:
+ nMode = TransliterationModulesExtra::SENTENCE_CASE;
+ break;
+ case SID_TRANSLITERATE_TITLE_CASE:
+ nMode = TransliterationModulesExtra::TITLE_CASE;
+ break;
+ case SID_TRANSLITERATE_TOGGLE_CASE:
+ nMode = TransliterationModulesExtra::TOGGLE_CASE;
+ break;
case SID_TRANSLITERATE_UPPER:
nMode = TransliterationModules_LOWERCASE_UPPERCASE;
break;
diff --git a/sw/source/ui/shells/langhelper.cxx b/sw/source/ui/shells/langhelper.cxx
index 3a0fe1421a0c..37d5e1ed5d69 100755..100644
--- a/sw/source/ui/shells/langhelper.cxx
+++ b/sw/source/ui/shells/langhelper.cxx
@@ -66,7 +66,8 @@ using namespace ::com::sun::star;
namespace SwLangHelper
{
- USHORT GetLanguageStatus(OutlinerView* pOLV,SfxItemSet& rSet)
+
+ USHORT GetLanguageStatus( OutlinerView* pOLV, SfxItemSet& rSet )
{
ESelection aSelection = pOLV->GetSelection();
EditView& rEditView=pOLV->GetEditView();
@@ -110,7 +111,7 @@ namespace SwLangHelper
return 0;
}
- bool SetLanguageStatus(OutlinerView* pOLV,SfxRequest &rReq,SwView &rView,SwWrtShell &rSh)
+ bool SetLanguageStatus( OutlinerView* pOLV, SfxRequest &rReq, SwView &rView, SwWrtShell &rSh )
{
bool bRestoreSelection = false;
SfxItemSet aEditAttr(pOLV->GetAttribs());
@@ -130,126 +131,132 @@ namespace SwLangHelper
//!! SwTextShell got destroyed meanwhile.)
SfxViewFrame *pViewFrame = rView.GetViewFrame();
- if (aNewLangTxt.EqualsAscii( "*" ))
+ if (aNewLangTxt.EqualsAscii( "*" ))
+ {
+ // open the dialog "Tools/Options/Language Settings - Language"
+ SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
+ if (pFact)
{
- // open the dialog "Tools/Options/Language Settings - Language"
- SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- if (pFact)
- {
- VclAbstractDialog* pDlg = pFact->CreateVclDialog( rView.GetWindow(), SID_LANGUAGE_OPTIONS );
- pDlg->Execute();
- delete pDlg;
- }
+ VclAbstractDialog* pDlg = pFact->CreateVclDialog( rView.GetWindow(), SID_LANGUAGE_OPTIONS );
+ pDlg->Execute();
+ delete pDlg;
}
- else
+ }
+ else
+ {
+ // setting the new language...
+ if (aNewLangTxt.Len() > 0)
{
- // setting the new language...
- if (aNewLangTxt.Len() > 0)
+ const String aSelectionLangPrefix( String::CreateFromAscii("Current_") );
+ const String aParagraphLangPrefix( String::CreateFromAscii("Paragraph_") );
+ const String aDocumentLangPrefix( String::CreateFromAscii("Default_") );
+ const String aStrNone( String::CreateFromAscii("LANGUAGE_NONE") );
+ const String aStrResetLangs( String::CreateFromAscii("RESET_LANGUAGES") );
+
+ xub_StrLen nPos = 0;
+ bool bForSelection = true;
+ bool bForParagraph = false;
+ if (STRING_NOTFOUND != (nPos = aNewLangTxt.Search( aSelectionLangPrefix, 0 )))
{
- const String aSelectionLangPrefix( String::CreateFromAscii("Current_") );
- const String aParagraphLangPrefix( String::CreateFromAscii("Paragraph_") );
- const String aDocumentLangPrefix( String::CreateFromAscii("Default_") );
- const String aStrNone( String::CreateFromAscii("LANGUAGE_NONE") );
-
- xub_StrLen nPos = 0;
- bool bForSelection = true;
- bool bForParagraph = false;
- if (STRING_NOTFOUND != (nPos = aNewLangTxt.Search( aSelectionLangPrefix, 0 )))
- {
- // ... for the current selection
- aNewLangTxt = aNewLangTxt.Erase( nPos, aSelectionLangPrefix.Len() );
- bForSelection = true;
- }
- else if (STRING_NOTFOUND != (nPos = aNewLangTxt.Search( aParagraphLangPrefix , 0 )))
- {
- // ... for the current paragraph language
- aNewLangTxt = aNewLangTxt.Erase( nPos, aParagraphLangPrefix.Len() );
- bForSelection = true;
- bForParagraph = true;
- }
- else if (STRING_NOTFOUND != (nPos = aNewLangTxt.Search( aDocumentLangPrefix , 0 )))
- {
- // ... as default document language
- aNewLangTxt = aNewLangTxt.Erase( nPos, aDocumentLangPrefix.Len() );
- bForSelection = false;
- }
+ // ... for the current selection
+ aNewLangTxt = aNewLangTxt.Erase( nPos, aSelectionLangPrefix.Len() );
+ bForSelection = true;
+ }
+ else if (STRING_NOTFOUND != (nPos = aNewLangTxt.Search( aParagraphLangPrefix , 0 )))
+ {
+ // ... for the current paragraph language
+ aNewLangTxt = aNewLangTxt.Erase( nPos, aParagraphLangPrefix.Len() );
+ bForSelection = true;
+ bForParagraph = true;
+ }
+ else if (STRING_NOTFOUND != (nPos = aNewLangTxt.Search( aDocumentLangPrefix , 0 )))
+ {
+ // ... as default document language
+ aNewLangTxt = aNewLangTxt.Erase( nPos, aDocumentLangPrefix.Len() );
+ bForSelection = false;
+ }
- if (bForParagraph)
- {
- bRestoreSelection = true;
- SwLangHelper::SelectPara( rEditView, aSelection );
- aSelection = pOLV->GetSelection();
- }
- if (!bForSelection) // document language to be changed...
- {
- rSh.StartAction();
- rSh.LockView( TRUE );
- rSh.Push();
+ if (bForParagraph)
+ {
+ bRestoreSelection = true;
+ SwLangHelper::SelectPara( rEditView, aSelection );
+ aSelection = pOLV->GetSelection();
+ }
+ if (!bForSelection) // document language to be changed...
+ {
+ rSh.StartAction();
+ rSh.LockView( TRUE );
+ rSh.Push();
- // prepare to apply new language to all text in document
- rSh.SelAll();
- rSh.ExtendedSelectAll();
- }
+ // prepare to apply new language to all text in document
+ rSh.SelAll();
+ rSh.ExtendedSelectAll();
+ }
+
+ if (aNewLangTxt == aStrNone)
+ SwLangHelper::SetLanguage_None( rSh, pOLV, aSelection, bForSelection, aEditAttr );
+ else if (aNewLangTxt == aStrResetLangs)
+ SwLangHelper::ResetLanguages( rSh, pOLV, aSelection, bForSelection );
+ else
+ SwLangHelper::SetLanguage( rSh, pOLV, aSelection, aNewLangTxt, bForSelection, aEditAttr );
- if (aNewLangTxt != aStrNone)
- SwLangHelper::SetLanguage( rSh, pEditEngine, aSelection, aNewLangTxt, bForSelection, aEditAttr );
+ // ugly hack, as it seems that EditView/EditEngine does not update their spellchecking marks
+ // when setting a new language attribute
+ if (bForSelection)
+ {
+ const SwViewOption* pVOpt = rView.GetWrtShellPtr()->GetViewOptions();
+ ULONG nCntrl = pEditEngine->GetControlWord();
+ // turn off
+ if (!pVOpt->IsOnlineSpell())
+ nCntrl &= ~EE_CNTRL_ONLINESPELLING;
else
- SwLangHelper::SetLanguage_None( rSh, pEditEngine, aSelection, bForSelection, aEditAttr );
+ nCntrl &= ~EE_CNTRL_ONLINESPELLING;
+ pEditEngine->SetControlWord(nCntrl);
- // ugly hack, as it seems that EditView/EditEngine does not update their spellchecking marks
- // when setting a new language attribute
- if (bForSelection)
- {
- const SwViewOption* pVOpt = rView.GetWrtShellPtr()->GetViewOptions();
- ULONG nCntrl = pEditEngine->GetControlWord();
- // turn off
- if (!pVOpt->IsOnlineSpell())
- nCntrl &= ~EE_CNTRL_ONLINESPELLING;
- else
- nCntrl &= ~EE_CNTRL_ONLINESPELLING;
- pEditEngine->SetControlWord(nCntrl);
-
- //turn back on
- if (pVOpt->IsOnlineSpell())
- nCntrl |= EE_CNTRL_ONLINESPELLING;
- else
- nCntrl &= ~EE_CNTRL_ONLINESPELLING;
- pEditEngine->SetControlWord(nCntrl);
-
- pEditEngine->CompleteOnlineSpelling();
- rEditView.Invalidate();
- }
+ //turn back on
+ if (pVOpt->IsOnlineSpell())
+ nCntrl |= EE_CNTRL_ONLINESPELLING;
+ else
+ nCntrl &= ~EE_CNTRL_ONLINESPELLING;
+ pEditEngine->SetControlWord(nCntrl);
- if (!bForSelection)
- {
- // need to release view and restore selection...
- rSh.Pop( FALSE );
- rSh.LockView( FALSE );
- rSh.EndAction();
- }
+ pEditEngine->CompleteOnlineSpelling();
+ rEditView.Invalidate();
+ }
+
+ if (!bForSelection)
+ {
+ // need to release view and restore selection...
+ rSh.Pop( FALSE );
+ rSh.LockView( FALSE );
+ rSh.EndAction();
}
}
+ }
- // invalidate slot to get the new language displayed
- pViewFrame->GetBindings().Invalidate( rReq.GetSlot() );
+ // invalidate slot to get the new language displayed
+ pViewFrame->GetBindings().Invalidate( rReq.GetSlot() );
- rReq.Done();
- return bRestoreSelection;
+ rReq.Done();
+ return bRestoreSelection;
}
- void SetLanguage(SwWrtShell &rWrtSh, const String &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet)
+ void SetLanguage( SwWrtShell &rWrtSh, const String &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet )
{
- SetLanguage(rWrtSh,0,ESelection(),rLangText,bIsForSelection,rCoreSet);
+ SetLanguage( rWrtSh, 0 , ESelection(), rLangText, bIsForSelection, rCoreSet );
}
- void SetLanguage(SwWrtShell &rWrtSh, EditEngine* pEditEngine,ESelection aSelection, const String &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet)
+ void SetLanguage( SwWrtShell &rWrtSh, OutlinerView* pOLV, ESelection aSelection, const String &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet )
{
const LanguageType nLang = SvtLanguageTable().GetType( rLangText );
if (nLang != LANGUAGE_DONTKNOW)
{
USHORT nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( nLang );
+ EditEngine* pEditEngine = pOLV ? pOLV->GetEditView().GetEditEngine() : NULL;
+ DBG_ASSERT( !pOLV || pEditEngine, "OutlinerView without EditEngine???" );
+
//get ScriptType
USHORT nLangWhichId = 0;
bool bIsSingleScriptType = true;
@@ -264,6 +271,9 @@ namespace SwLangHelper
}
if (bIsSingleScriptType)
{
+ // change language for selection or paragraph
+ // (for paragraph is handled by previosuly having set the selection to the
+ // whole paragraph)
if (bIsForSelection)
{
// apply language to current selection
@@ -279,7 +289,7 @@ namespace SwLangHelper
rWrtSh.SetAttr( rCoreSet );
}
}
- else // change document language
+ else // change language for all text
{
// set document default language
switch (nLangWhichId)
@@ -300,12 +310,12 @@ namespace SwLangHelper
}
}
- void SetLanguage_None(SwWrtShell &rWrtSh,bool bIsForSelection, SfxItemSet &rCoreSet )
+ void SetLanguage_None( SwWrtShell &rWrtSh, bool bIsForSelection, SfxItemSet &rCoreSet )
{
- SetLanguage_None(rWrtSh,0,ESelection(),bIsForSelection,rCoreSet);
+ SetLanguage_None( rWrtSh,0,ESelection(),bIsForSelection,rCoreSet );
}
- void SetLanguage_None(SwWrtShell &rWrtSh, EditEngine* pEditEngine,ESelection aSelection, bool bIsForSelection, SfxItemSet &rCoreSet )
+ void SetLanguage_None( SwWrtShell &rWrtSh, OutlinerView* pOLV, ESelection aSelection, bool bIsForSelection, SfxItemSet &rCoreSet )
{
// EditEngine IDs
const USHORT aLangWhichId_EE[3] =
@@ -325,7 +335,12 @@ namespace SwLangHelper
if (bIsForSelection)
{
- // apply language to current selection
+ // change language for selection or paragraph
+ // (for paragraph is handled by previosuly having set the selection to the
+ // whole paragraph)
+
+ EditEngine* pEditEngine = pOLV ? pOLV->GetEditView().GetEditEngine() : NULL;
+ DBG_ASSERT( !pOLV || pEditEngine, "OutlinerView without EditEngine???" );
if (pEditEngine)
{
for (sal_uInt16 i = 0; i < 3; ++i)
@@ -340,7 +355,7 @@ namespace SwLangHelper
rWrtSh.SetAttr( rCoreSet );
}
}
- else // change document language
+ else // change language for all text
{
SvUShortsSort aAttribs;
for (sal_uInt16 i = 0; i < 3; ++i)
@@ -355,6 +370,39 @@ namespace SwLangHelper
}
}
+ void ResetLanguages( SwWrtShell &rWrtSh, bool bIsForSelection )
+ {
+ ResetLanguages( rWrtSh, 0 , ESelection(), bIsForSelection );
+ }
+
+ void ResetLanguages( SwWrtShell &rWrtSh, OutlinerView* pOLV, ESelection aSelection, bool bIsForSelection )
+ {
+ (void) bIsForSelection;
+ (void) aSelection;
+
+ // reset language for current selection.
+ // The selection should already have been expanded to the whole paragraph or
+ // to all text in the document if those are the ranges where to reset
+ // the language attributes
+
+ if (pOLV)
+ {
+ EditView &rEditView = pOLV->GetEditView();
+ rEditView.RemoveAttribs( true, EE_CHAR_LANGUAGE );
+ rEditView.RemoveAttribs( true, EE_CHAR_LANGUAGE_CJK );
+ rEditView.RemoveAttribs( true, EE_CHAR_LANGUAGE_CTL );
+ }
+ else
+ {
+ SvUShortsSort aAttribs;
+ aAttribs.Insert( RES_CHRATR_LANGUAGE );
+ aAttribs.Insert( RES_CHRATR_CJK_LANGUAGE );
+ aAttribs.Insert( RES_CHRATR_CTL_LANGUAGE );
+ rWrtSh.ResetAttr( &aAttribs );
+ }
+ }
+
+
/// @returns : the language for the selected text that is set for the
/// specified attribute (script type).
/// If there are more than one languages used LANGUAGE_DONTKNOW will be returned.
@@ -450,7 +498,7 @@ namespace SwLangHelper
/// 'In use' means the language(s) matching the script type(s) of the
/// selected text. Or in other words, the language a spell checker would use.
/// If there is more than one language LANGUAGE_DONTKNOW will be returned.
- LanguageType GetCurrentLanguage(SfxItemSet aSet,USHORT nScriptType )
+ LanguageType GetCurrentLanguage( SfxItemSet aSet, USHORT nScriptType )
{
//set language attribute to use according to the script type
USHORT nLangWhichId = 0;
@@ -517,7 +565,7 @@ namespace SwLangHelper
return aText;
}
- String GetTextForLanguageGuessing(EditEngine* rEditEngine, ESelection aDocSelection )
+ String GetTextForLanguageGuessing( EditEngine* rEditEngine, ESelection aDocSelection )
{
// string for guessing language
String aText;
diff --git a/sw/source/ui/shells/makefile.mk b/sw/source/ui/shells/makefile.mk
index e9a03a5a41cc..dce62a2c9336 100644
--- a/sw/source/ui/shells/makefile.mk
+++ b/sw/source/ui/shells/makefile.mk
@@ -83,6 +83,7 @@ EXCEPTIONSFILES = \
$(SLO)$/drwtxtsh.obj \
$(SLO)$/frmsh.obj \
$(SLO)$/drwtxtex.obj \
+ $(SLO)$/slotadd.obj \
$(SLO)$/textsh1.obj
# --- Tagets -------------------------------------------------------
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index c2308b9def0a..0de14dc3dacb 100644
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -62,7 +62,8 @@
#include <svx/htmlmode.hxx>
#include <svx/pfiledlg.hxx>
#include <svtools/htmlcfg.hxx>
-#include <com/sun/star/i18n/TransliterationModules.hdl>
+#include <com/sun/star/i18n/TransliterationModules.hpp>
+#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
#include <sot/clsids.hxx>
#include <editeng/acorrcfg.hxx>
@@ -1027,6 +1028,15 @@ void SwTextShell::ExecTransliteration( SfxRequest & rReq )
switch( rReq.GetSlot() )
{
+ case SID_TRANSLITERATE_SENTENCE_CASE:
+ nMode = TransliterationModulesExtra::SENTENCE_CASE;
+ break;
+ case SID_TRANSLITERATE_TITLE_CASE:
+ nMode = TransliterationModulesExtra::TITLE_CASE;
+ break;
+ case SID_TRANSLITERATE_TOGGLE_CASE:
+ nMode = TransliterationModulesExtra::TOGGLE_CASE;
+ break;
case SID_TRANSLITERATE_UPPER:
nMode = TransliterationModules_LOWERCASE_UPPERCASE;
break;
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index b7aa72acfb2c..e7d7ef613f2b 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -27,7 +27,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
+#include <com/sun/star/i18n/WordType.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+
#include <comphelper/processfactory.hxx>
#include <svx/dialogs.hrc>
#include <hintids.hxx>
@@ -338,6 +341,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
const String aParagraphLangPrefix( String::CreateFromAscii("Paragraph_") );
const String aDocumentLangPrefix( String::CreateFromAscii("Default_") );
const String aStrNone( String::CreateFromAscii("LANGUAGE_NONE") );
+ const String aStrResetLangs( String::CreateFromAscii("RESET_LANGUAGES") );
SfxItemSet aCoreSet( GetPool(),
RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE,
@@ -376,10 +380,12 @@ void SwTextShell::Execute(SfxRequest &rReq)
rWrtSh.SelAll();
rWrtSh.ExtendedSelectAll();
}
- if (aNewLangTxt != aStrNone)
- SwLangHelper::SetLanguage( rWrtSh, aNewLangTxt, bForSelection, aCoreSet );
- else
+ if (aNewLangTxt == aStrNone)
SwLangHelper::SetLanguage_None( rWrtSh, bForSelection, aCoreSet );
+ else if (aNewLangTxt == aStrResetLangs)
+ SwLangHelper::ResetLanguages( rWrtSh, bForSelection );
+ else
+ SwLangHelper::SetLanguage( rWrtSh, aNewLangTxt, bForSelection, aCoreSet );
}
// restore selection...
@@ -396,6 +402,23 @@ void SwTextShell::Execute(SfxRequest &rReq)
break;
}
+ case SID_THES:
+ {
+ // replace word/selection with text from selected sub menu entry
+ String aReplaceText;
+ SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES , sal_False );
+ if (pItem2)
+ aReplaceText = pItem2->GetValue();
+ if (aReplaceText.Len() > 0)
+ {
+ SwView &rView2 = rWrtSh.GetView();
+ const bool bSelection = rWrtSh.HasSelection();
+ const String aLookUpText = rView2.GetThesaurusLookUpText( bSelection );
+ rView2.InsertThesaurusSynonym( aReplaceText, aLookUpText, bSelection );
+ }
+ }
+ break;
+
case SID_CHARMAP:
{
InsertSymbol( rReq );
@@ -1375,6 +1398,38 @@ void SwTextShell::GetState( SfxItemSet &rSet )
}
break;
+ case SID_THES:
+ {
+ // is there a valid selection to get text from?
+ String aText;
+ sal_Bool bValid = !rSh.HasSelection() ||
+ (rSh.IsSelOnePara() && !rSh.IsMultiSelection());
+ // prevent context menu from showing when cursor is not in or at the end of a word
+ // (GetCurWord will return the next word if there is none at the current position...)
+ const sal_Int16 nWordType = ::i18n::WordType::DICTIONARY_WORD;
+ bool bWord = rSh.IsInWord( nWordType ) || rSh.IsStartWord( nWordType ) || rSh.IsEndWord( nWordType );
+ if (bValid && bWord)
+ aText = rSh.HasSelection()? rSh.GetSelTxt() : rSh.GetCurWord();
+
+ LanguageType nLang = rSh.GetCurLang();
+ lang::Locale aLocale = SvxCreateLocale( nLang );
+ String aLangText( MsLangId::convertLanguageToIsoString( nLang ) );
+
+ // set word and locale to look up as status value
+ String aStatusVal( aText );
+ aStatusVal.AppendAscii( "#" );
+ aStatusVal += aLangText;
+
+ rSet.Put( SfxStringItem( SID_THES, aStatusVal ) );
+
+ // disable "Thesaurus" context menu entry if there is nothing to look up
+ uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() );
+ if (aText.Len() == 0 ||
+ !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale ))
+ rSet.DisableItem( SID_THES );
+ }
+ break;
+
case FN_NUMBER_NEWSTART :
if(!rSh.GetCurNumRule())
rSet.DisableItem(nWhich);
diff --git a/sw/source/ui/shells/txtcrsr.cxx b/sw/source/ui/shells/txtcrsr.cxx
index 8a72bb606e59..69f82ebf902d 100644
--- a/sw/source/ui/shells/txtcrsr.cxx
+++ b/sw/source/ui/shells/txtcrsr.cxx
@@ -47,6 +47,8 @@
#include <num.hxx>
#include <edtwin.hxx>
#include <crsskip.hxx>
+#include <doc.hxx>
+#include <docsh.hxx>
#ifndef _CMDID_H
#include <cmdid.h>
@@ -56,6 +58,10 @@
#include <globals.hrc>
#endif
+#include <svx/svdouno.hxx>
+#include <svx/fmshell.hxx>
+#include <svx/sdrobjectfilter.hxx>
+
using namespace ::com::sun::star;
void SwTextShell::ExecBasicMove(SfxRequest &rReq)
@@ -246,6 +252,36 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq)
BOOL bSetRetVal = TRUE, bRet = TRUE;
switch ( nSlot )
{
+ case SID_FM_TOGGLECONTROLFOCUS:
+ {
+ const SwDoc* pDoc = rSh.GetDoc();
+ const SwDocShell* pDocShell = pDoc ? pDoc->GetDocShell() : NULL;
+ const SwView* pView = pDocShell ? pDocShell->GetView() : NULL;
+ const FmFormShell* pFormShell = pView ? pView->GetFormShell() : NULL;
+ SdrView* pDrawView = pView ? pView->GetDrawView() : NULL;
+ Window* pWindow = pView ? pView->GetWrtShell().GetWin() : NULL;
+
+ OSL_ENSURE( pFormShell && pDrawView && pWindow, "SwXTextView::ExecMoveMisc: no chance!" );
+ if ( !pFormShell || !pDrawView || !pWindow )
+ break;
+
+ ::std::auto_ptr< ::svx::ISdrObjectFilter > pFilter( pFormShell->CreateFocusableControlFilter(
+ *pDrawView, *pWindow ) );
+ if ( !pFilter.get() )
+ break;
+
+ const SdrObject* pNearestControl = rSh.GetBestObject( TRUE, GOTOOBJ_DRAW_CONTROL, FALSE, pFilter.get() );
+ if ( !pNearestControl )
+ break;
+
+ const SdrUnoObj* pUnoObject = dynamic_cast< const SdrUnoObj* >( pNearestControl );
+ OSL_ENSURE( pUnoObject, "SwTextShell::ExecMoveMisc: GetBestObject returned nonsense!" );
+ if ( !pUnoObject )
+ break;
+
+ pFormShell->ToggleControlFocus( *pUnoObject, *pDrawView, *pWindow );
+ }
+ break;
case FN_CNTNT_TO_NEXT_FRAME:
bRet = rSh.GotoObj(TRUE, GOTOOBJ_GOTO_ANY);
if(bRet)
diff --git a/sw/source/ui/uiview/makefile.mk b/sw/source/ui/uiview/makefile.mk
index d06bb58a7dab..337ee85da580 100644
--- a/sw/source/ui/uiview/makefile.mk
+++ b/sw/source/ui/uiview/makefile.mk
@@ -49,8 +49,13 @@ EXCEPTIONSFILES= \
$(SLO)$/swcli.obj \
$(SLO)$/uivwimp.obj \
$(SLO)$/view.obj \
+ $(SLO)$/view0.obj \
+ $(SLO)$/view1.obj \
$(SLO)$/view2.obj \
+ $(SLO)$/viewdraw.obj \
+ $(SLO)$/viewport.obj \
$(SLO)$/viewprt.obj \
+ $(SLO)$/viewsrch.obj \
$(SLO)$/viewling.obj \
$(SLO)$/viewmdi.obj \
diff --git a/sw/source/ui/uiview/view.src b/sw/source/ui/uiview/view.src
index 7c47fe6ef208..9cf4f910f183 100644
--- a/sw/source/ui/uiview/view.src
+++ b/sw/source/ui/uiview/view.src
@@ -299,8 +299,8 @@ ToolBox RID_TOOLS_TOOLBOX
};
ToolBoxItem
{
- Identifier = FN_THESAURUS_DLG;
- HelpID = FN_THESAURUS_DLG;
+ Identifier = SID_THESAURUS;
+ HelpID = SID_THESAURUS;
Hide = TRUE;
};
ToolBoxItem
diff --git a/sw/source/ui/uiview/viewdraw.cxx b/sw/source/ui/uiview/viewdraw.cxx
index 7e35ca0049df..abae753c1b56 100644
--- a/sw/source/ui/uiview/viewdraw.cxx
+++ b/sw/source/ui/uiview/viewdraw.cxx
@@ -520,7 +520,8 @@ sal_Bool SwView::EnterDrawTextMode(const Point& aDocPos)
/******************************************************************************
* Beschreibung: DrawTextEditMode einschalten
******************************************************************************/
-sal_Bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, Window* pWin, sal_Bool bIsNewObj)
+sal_Bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, Window* pWin,
+ bool bIsNewObj, bool bSetSelectionToStart)
{
SwWrtShell *pSh = &GetWrtShell();
SdrView *pSdrView = pSh->GetDrawView();
@@ -606,7 +607,11 @@ sal_Bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, Window* pWin,
Color aBackground(pSh->GetShapeBackgrd());
pView->SetBackgroundColor(aBackground);
}
+
+ // editing should start at the end of text, spell checking at the beginning ...
ESelection aNewSelection(EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND, EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND);
+ if (bSetSelectionToStart)
+ aNewSelection = ESelection();
pView->SetSelection(aNewSelection);
}
diff --git a/sw/source/ui/uiview/viewling.cxx b/sw/source/ui/uiview/viewling.cxx
index 04414b5d83db..b3f73f7c38e4 100644..100755
--- a/sw/source/ui/uiview/viewling.cxx
+++ b/sw/source/ui/uiview/viewling.cxx
@@ -120,7 +120,7 @@ void SwView::ExecLingu(SfxRequest &rReq)
{
switch(rReq.GetSlot())
{
- case FN_THESAURUS_DLG:
+ case SID_THESAURUS:
StartThesaurus();
rReq.Ignore();
break;
@@ -252,64 +252,31 @@ void SwView::StartTextConversion(
// do not do text conversion if it is active elsewhere
if (GetWrtShell().HasConvIter())
{
-// MessBox( 0, WB_OK, String( SW_RES( STR_SPELL_TITLE ) ),
-// String( SW_RES( STR_MULT_INTERACT_SPELL_WARN ) ) ).Execute();
return;
}
-/*
- SfxErrorContext aContext( ERRCTX_SVX_LINGU_SPELLING, aEmptyStr, pEditWin,
- RID_SVXERRCTX, DIALOG_MGR() );
- Reference< XSpellChecker1 > xSpell = ::GetSpellChecker();
- if(!xSpell.is())
- { // keine Arme keine Kekse
- ErrorHandler::HandleError( ERRCODE_SVX_LINGU_LINGUNOTEXISTS );
- return;
- }
-*/
SpellKontext(sal_True);
- SwViewOption* pVOpt = (SwViewOption*)pWrtShell->GetViewOptions();
- sal_Bool bOldIdle = pVOpt->IsIdle();
+ const SwViewOption* pVOpt = pWrtShell->GetViewOptions();
+ const sal_Bool bOldIdle = pVOpt->IsIdle();
pVOpt->SetIdle( sal_False );
sal_Bool bOldIns = pWrtShell->IsInsMode();
pWrtShell->SetInsMode( sal_True );
+ sal_Bool bSelection = ((SwCrsrShell*)pWrtShell)->HasSelection() ||
+ pWrtShell->GetCrsr() != pWrtShell->GetCrsr()->GetNext();
- {
- sal_Bool bSelection = ((SwCrsrShell*)pWrtShell)->HasSelection() ||
- pWrtShell->GetCrsr() != pWrtShell->GetCrsr()->GetNext();
-
-// sal_Bool bIsSpellSpecial = sal_True;
-
- sal_Bool bStart = bSelection || pWrtShell->IsStartOfDoc();
- sal_Bool bOther = !bSelection && !(pWrtShell->GetFrmType(0,sal_True) & FRMTYPE_BODY);
+ sal_Bool bStart = bSelection || pWrtShell->IsStartOfDoc();
+ sal_Bool bOther = !bSelection && !(pWrtShell->GetFrmType(0,sal_True) & FRMTYPE_BODY);
-/*
- if( bOther && !bIsSpellSpecial )
- // kein Sonderbereich eingeschaltet
- {
- // Ich will auch in Sonderbereichen trennen
- QueryBox aBox( &GetEditWin(), SW_RES( DLG_SPECIAL_FORCED ) );
- if( aBox.Execute() == RET_YES && xProp.is())
- {
- sal_Bool bTrue = sal_True;
- Any aTmp(&bTrue, ::getBooleanCppuType());
- xProp->setPropertyValue( C2U(UPN_IS_SPELL_SPECIAL), aTmp );
- }
- else
- return; // Nein Es wird nicht gespellt
- }
-*/
- {
- const uno::Reference< lang::XMultiServiceFactory > xMgr(
- comphelper::getProcessServiceFactory() );
- SwHHCWrapper aWrap( this, xMgr, nSourceLang, nTargetLang, pTargetFont,
- nOptions, bIsInteractive,
- bStart, bOther, bSelection );
- aWrap.Convert();
- }
+ {
+ const uno::Reference< lang::XMultiServiceFactory > xMgr(
+ comphelper::getProcessServiceFactory() );
+ SwHHCWrapper aWrap( this, xMgr, nSourceLang, nTargetLang, pTargetFont,
+ nOptions, bIsInteractive,
+ bStart, bOther, bSelection );
+ aWrap.Convert();
}
pWrtShell->SetInsMode( bOldIns );
@@ -557,16 +524,77 @@ void SwView::HyphenateDocument()
}
/*--------------------------------------------------------------------
+ --------------------------------------------------------------------*/
+
+bool SwView::IsValidSelectionForThesaurus() const
+{
+ // must not be a multi-selection, and if it is a selection it needs
+ // to be within a single paragraph
+
+ const bool bMultiSel = pWrtShell->GetCrsr() != pWrtShell->GetCrsr()->GetNext();
+ const sal_Bool bSelection = ((SwCrsrShell*)pWrtShell)->HasSelection();
+ return !bMultiSel && (!bSelection || pWrtShell->IsSelOnePara() );
+}
+
+
+String SwView::GetThesaurusLookUpText( bool bSelection ) const
+{
+ return bSelection ? pWrtShell->GetSelTxt() : pWrtShell->GetCurWord();
+}
+
+
+void SwView::InsertThesaurusSynonym( const String &rSynonmText, const String &rLookUpText, bool bSelection )
+{
+ sal_Bool bOldIns = pWrtShell->IsInsMode();
+ pWrtShell->SetInsMode( sal_True );
+
+ pWrtShell->StartAllAction();
+ pWrtShell->StartUndo(UNDO_DELETE);
+
+ if( !bSelection )
+ {
+ if(pWrtShell->IsEndWrd())
+ pWrtShell->Left(CRSR_SKIP_CELLS, FALSE, 1, FALSE );
+
+ pWrtShell->SelWrd();
+
+ // make sure the selection build later from the
+ // data below does not include footnotes and other
+ // "in word" character to the left and right in order
+ // to preserve those. Therefore count those "in words"
+ // in order to modify the selection accordingly.
+ const sal_Unicode* pChar = rLookUpText.GetBuffer();
+ xub_StrLen nLeft = 0;
+ while (pChar && *pChar++ == CH_TXTATR_INWORD)
+ ++nLeft;
+ pChar = rLookUpText.Len() ? rLookUpText.GetBuffer() + rLookUpText.Len() - 1 : 0;
+ xub_StrLen nRight = 0;
+ while (pChar && *pChar-- == CH_TXTATR_INWORD)
+ ++nRight;
+
+ // adjust existing selection
+ SwPaM *pCrsr = pWrtShell->GetCrsr();
+ pCrsr->GetPoint()->nContent/*.nIndex*/ -= nRight;
+ pCrsr->GetMark()->nContent/*.nIndex*/ += nLeft;
+ }
+
+ pWrtShell->Insert( rSynonmText );
+
+ pWrtShell->EndUndo(UNDO_DELETE);
+ pWrtShell->EndAllAction();
+
+ pWrtShell->SetInsMode( bOldIns );
+}
+
+
+/*--------------------------------------------------------------------
Beschreibung: Thesaurus starten
--------------------------------------------------------------------*/
void SwView::StartThesaurus()
{
- if( pWrtShell->GetCrsr() != pWrtShell->GetCrsr()->GetNext() )
- return;
- sal_Bool bSelection = ((SwCrsrShell*)pWrtShell)->HasSelection();
- if( bSelection && !pWrtShell->IsSelOnePara() )
+ if (!IsValidSelectionForThesaurus())
return;
SfxErrorContext aContext( ERRCTX_SVX_LINGU_THESAURUS, aEmptyStr, pEditWin,
@@ -589,114 +617,32 @@ void SwView::StartThesaurus()
sal_Bool bOldIdle = pVOpt->IsIdle();
pVOpt->SetIdle( sal_False );
-#ifdef TL_NEVER
-//!!! hier mu� noch was getan werden... (Umsetzung der Funktionalitaet)
- // ErrorLink setzen, alten merken
- Link aOldLnk = pSpell->ChgErrorLink(LINK(this, SwView, SpellError));
-#endif
-
-
// get initial LookUp text
- String aTmp = bSelection ?
- pWrtShell->GetSelTxt() : pWrtShell->GetCurWord();
+ const sal_Bool bSelection = ((SwCrsrShell*)pWrtShell)->HasSelection();
+ String aTmp = GetThesaurusLookUpText( bSelection );
Reference< XThesaurus > xThes( ::GetThesaurus() );
AbstractThesaurusDialog *pDlg = NULL;
if ( !xThes.is() || !xThes->hasLocale( SvxCreateLocale( eLang ) ) )
- {
SpellError( &eLang );
- }
else
{
// create dialog
{ //Scope for SwWait-Object
SwWait aWait( *GetDocShell(), sal_True );
+ // load library with dialog only on demand ...
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- pDlg = pFact->CreateThesaurusDialog( &GetEditWin(),
- xThes, aTmp, eLang );
- }
-
- {
- // Hier wird der Thesaurus-Dialog im Applikationsfenster zentriert,
- // und zwar oberhalb oder unterhalb der Cursorposition, je nachdem,
- // wo mehr Platz ist.
-
- // Current Word:
- SwRect aRect( pWrtShell->GetCharRect() );
- Point aTopPos = aRect.Pos();
- Point aBtmPos( aTopPos.X(), aRect.Bottom() );
- aTopPos = GetEditWin().LogicToPixel( aTopPos );
- aTopPos = GetEditWin().OutputToScreenPixel( aTopPos );
- aBtmPos = GetEditWin().LogicToPixel( aBtmPos );
- aBtmPos = GetEditWin().OutputToScreenPixel( aBtmPos );
- // ::frame::Desktop:
- Rectangle aRct = GetEditWin().GetDesktopRectPixel();
- Point aWinTop( aRct.TopLeft() );
- Point aWinBtm( aRct.BottomRight() );
- if ( aTopPos.Y() - aWinTop.Y() > aWinBtm.Y() - aBtmPos.Y() )
- aWinBtm.Y() = aTopPos.Y();
- else
- aWinTop.Y() = aBtmPos.Y();
-
- Size aSz = pDlg->GetWindow()->GetSizePixel();
- if ( aWinBtm.Y() - aWinTop.Y() > aSz.Height() )
- {
- aWinTop.X() = ( aWinTop.X() + aWinBtm.X() - aSz.Width() ) / 2;
- aWinTop.Y() = ( aWinTop.Y() + aWinBtm.Y() - aSz.Height() ) / 2;
- pDlg->GetWindow()->SetPosPixel( aWinTop );
- }
+ pDlg = pFact->CreateThesaurusDialog( &GetEditWin(), xThes, aTmp, eLang );
}
if ( pDlg->Execute()== RET_OK )
- {
- sal_Bool bOldIns = pWrtShell->IsInsMode();
- pWrtShell->SetInsMode( sal_True );
-
- pWrtShell->StartAllAction();
- pWrtShell->StartUndo(UNDO_DELETE);
-
- if( !bSelection )
- {
- if(pWrtShell->IsEndWrd())
- pWrtShell->Left(CRSR_SKIP_CELLS, FALSE, 1, FALSE );
-
- pWrtShell->SelWrd();
-
- // make sure the selection build later from the
- // data below does not include footnotes and other
- // "in word" character to the left and right in order
- // to preserve those. Therefore count those "in words"
- // in order to modify the selection accordingly.
- const sal_Unicode* pChar = aTmp.GetBuffer();
- xub_StrLen nLeft = 0;
- while (pChar && *pChar++ == CH_TXTATR_INWORD)
- ++nLeft;
- pChar = aTmp.Len() ? aTmp.GetBuffer() + aTmp.Len() - 1 : 0;
- xub_StrLen nRight = 0;
- while (pChar && *pChar-- == CH_TXTATR_INWORD)
- ++nRight;
-
- // adjust existing selection
- SwPaM *pCrsr = pWrtShell->GetCrsr();
- pCrsr->GetPoint()->nContent/*.nIndex*/ -= nRight;
- pCrsr->GetMark()->nContent/*.nIndex*/ += nLeft;
- }
-
- pWrtShell->Insert( pDlg->GetWord() );
-
- pWrtShell->EndUndo(UNDO_DELETE);
- pWrtShell->EndAllAction();
-
- pWrtShell->SetInsMode( bOldIns );
-
- }
+ InsertThesaurusSynonym( pDlg->GetWord(), aTmp, bSelection );
}
delete pDlg;
pVOpt->SetIdle( bOldIdle );
-
}
/*--------------------------------------------------------------------
diff --git a/sw/source/ui/uiview/viewstat.cxx b/sw/source/ui/uiview/viewstat.cxx
index 23415b630252..f23b73f5dfad 100644
--- a/sw/source/ui/uiview/viewstat.cxx
+++ b/sw/source/ui/uiview/viewstat.cxx
@@ -303,7 +303,7 @@ void SwView::GetState(SfxItemSet &rSet)
rSet.DisableItem( nWhich );
}
break;
- case FN_THESAURUS_DLG:
+ case SID_THESAURUS:
{
SwWrtShell &rSh = GetWrtShell();
if (2 <= rSh.GetCrsrCnt()) // multi selection?
diff --git a/sw/source/ui/uno/makefile.mk b/sw/source/ui/uno/makefile.mk
index 32210b2162d6..0023fd52f55c 100644
--- a/sw/source/ui/uno/makefile.mk
+++ b/sw/source/ui/uno/makefile.mk
@@ -59,8 +59,7 @@ SLO1FILES = \
$(SLO)$/SwXFilterOptions.obj\
$(SLO)$/RefreshListenerContainer.obj \
$(SLO)$/unomodule.obj \
- $(SLO)$/unodoc.obj \
- $(SLO)$/warnpassword.obj
+ $(SLO)$/unodoc.obj
SLO2FILES = \
$(SLO)$/swdetect.obj \
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index a4167da88748..0579d180a04c 100755..100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -114,6 +114,8 @@
#include <drawdoc.hxx>
#include <SwStyleNameMapper.hxx>
#include <osl/file.hxx>
+#include <comphelper/storagehelper.hxx>
+
// --> FME 2004-06-08 #i12836# enhanced pdf export
#include <EnhancedPDFExportHelper.hxx>
@@ -3152,16 +3154,13 @@ uno::Reference< util::XCloneable > SwXTextDocument::createClone( ) throw (uno::
if(!IsValid())
throw RuntimeException();
//create a new document - hidden - copy the storage and return it
- SwDoc* pCopyDoc = pDocShell->GetDoc()->CreateCopy();
- SfxObjectShell* pShell = new SwDocShell( pCopyDoc, SFX_CREATE_MODE_STANDARD );
- pShell->DoInitNew();
-
- uno::Reference< embed::XStorage > xSourceStorage = getDocumentStorage();
+ SfxObjectShell* pShell = pDocShell->GetDoc()->CreateCopy(false);
uno::Reference< frame::XModel > xNewModel = pShell->GetModel();
- //copy this storage
+ uno::Reference< embed::XStorage > xNewStorage = ::comphelper::OStorageHelper::GetTemporaryStorage( );
+ uno::Sequence< beans::PropertyValue > aTempMediaDescriptor;
+ storeToStorage( xNewStorage, aTempMediaDescriptor );
uno::Reference< document::XStorageBasedDocument > xStorageDoc( xNewModel, uno::UNO_QUERY );
- uno::Reference< embed::XStorage > xNewStorage = xStorageDoc->getDocumentStorage();
- xSourceStorage->copyToStorage( xNewStorage );
+ xStorageDoc->loadFromStorage( xNewStorage, aTempMediaDescriptor );
return uno::Reference< util::XCloneable >( xNewModel, UNO_QUERY );
}
/* -----------------------------20.06.00 09:54--------------------------------
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
index 0504fb1107ad..1f1fc9149e34 100644
--- a/sw/source/ui/uno/unotxvw.cxx
+++ b/sw/source/ui/uno/unotxvw.cxx
@@ -710,7 +710,7 @@ uno::Reference< form::runtime::XFormController > SAL_CALL SwXTextView::getFormCo
FmFormShell* pFormShell = pView2 ? pView2->GetFormShell() : NULL;
SdrView* pDrawView = pView2 ? pView2->GetDrawView() : NULL;
Window* pWindow = pView2 ? pView2->GetWrtShell().GetWin() : NULL;
- DBG_ASSERT( pFormShell && pDrawView && pWindow, "SwXTextView::GetControl: how could I?" );
+ DBG_ASSERT( pFormShell && pDrawView && pWindow, "SwXTextView::getFormController: how could I?" );
uno::Reference< form::runtime::XFormController > xController;
if ( pFormShell && pDrawView && pWindow )
diff --git a/sw/source/ui/uno/warnpassword.cxx b/sw/source/ui/uno/warnpassword.cxx
deleted file mode 100644
index cd121226a5f1..000000000000
--- a/sw/source/ui/uno/warnpassword.cxx
+++ /dev/null
@@ -1,86 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-+ ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sw.hxx"
-// ============================================================================
-#include "warnpassword.hxx"
-#include <com/sun/star/task/XInteractionHandler.hpp>
-#include <svl/itemset.hxx>
-#include <sfx2/docfile.hxx>
-#include <sfx2/sfxsids.hrc>
-#include <ucbhelper/simpleinteractionrequest.hxx>
-#include <com/sun/star/ucb/InteractiveAppException.hpp>
-#include <svx/svxerr.hxx>
-
-using ::rtl::OUString;
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::ucb;
-using namespace ::com::sun::star::task;
-
-bool SwWarnPassword::WarningOnPassword( SfxMedium& rMedium )
-{
- bool bReturn = true;
- uno::Reference< task::XInteractionHandler > xHandler( rMedium.GetInteractionHandler());
- if( xHandler.is() )
- {
-
- OUString empty;
- uno::Any xException( makeAny(InteractiveAppException(empty,
- uno::Reference <XInterface> (),
- InteractionClassification_QUERY,
- ERRCODE_SVX_EXPORT_FILTER_CRYPT)));
-
- uno::Reference< ucbhelper::SimpleInteractionRequest > xRequest
- = new ucbhelper::SimpleInteractionRequest(
- xException,
- ucbhelper::CONTINUATION_APPROVE
- | ucbhelper::CONTINUATION_DISAPPROVE );
-
- xHandler->handle( xRequest.get() );
-
- const sal_Int32 nResp = xRequest->getResponse();
-
- switch ( nResp )
- {
- case ucbhelper::CONTINUATION_UNKNOWN:
- break;
-
- case ucbhelper::CONTINUATION_APPROVE:
- // Continue
- break;
-
- case ucbhelper::CONTINUATION_DISAPPROVE:
- bReturn = false;
- break;
- }
- }
- return bReturn;
-}
-
diff --git a/sw/source/ui/utlui/makefile.mk b/sw/source/ui/utlui/makefile.mk
index 7f2aa91c0e11..cded61eee357 100644
--- a/sw/source/ui/utlui/makefile.mk
+++ b/sw/source/ui/utlui/makefile.mk
@@ -51,15 +51,15 @@ SRC1FILES = \
EXCEPTIONSFILES= \
$(SLO)$/bookctrl.obj \
+ $(SLO)$/glbltree.obj \
$(SLO)$/navipi.obj \
$(SLO)$/unotools.obj \
+ $(SLO)$/content.obj \
$(SLO)$/swrenamexnameddlg.obj
SLOFILES = $(EXCEPTIONSFILES) \
$(SLO)$/condedit.obj \
- $(SLO)$/content.obj \
$(SLO)$/gloslst.obj \
- $(SLO)$/glbltree.obj \
$(SLO)$/initui.obj \
$(SLO)$/navicfg.obj \
$(SLO)$/numfmtlb.obj \
diff --git a/sw/source/ui/web/web.src b/sw/source/ui/web/web.src
index 1aa7fc03b4c6..3d24d885dfa8 100644
--- a/sw/source/ui/web/web.src
+++ b/sw/source/ui/web/web.src
@@ -138,8 +138,8 @@ ToolBox RID_WEBTOOLS_TOOLBOX
};
ToolBoxItem
{
- Identifier = FN_THESAURUS_DLG;
- HelpID = FN_THESAURUS_DLG;
+ Identifier = SID_THESAURUS;
+ HelpID = SID_THESAURUS;
Hide = TRUE;
};
ToolBoxItem
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index c7cb89bf5e61..04f87e877aa5 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -1387,7 +1387,20 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum)
// <--
if ( ( nTxtNodeIndent + nWidthOfTabs ) != 0 )
{
- const SwTwips nIndentChange = nTxtNodeIndent + nWidthOfTabs;
+ // --> OD 2010-05-05 #i111172#
+ // If text node is already inside a list, assure that the indents
+ // are the same. Thus, adjust the indent change value by subtracting
+ // indents of to be applied list style.
+ SwTwips nIndentChange = nTxtNodeIndent + nWidthOfTabs;
+ if ( pTxtNode->GetNumRule() )
+ {
+ const SwNumFmt aFmt( aNumRule.Get( 0 ) );
+ if ( aFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
+ {
+ nIndentChange -= aFmt.GetIndentAt() + aFmt.GetFirstLineIndent();
+ }
+ }
+ // <--
aNumRule.ChangeIndent( nIndentChange );
}
}
diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml
index 7fb8db664b59..c3bef67c8c12 100644
--- a/sw/uiconfig/sglobal/menubar/menubar.xml
+++ b/sw/uiconfig/sglobal/menubar/menubar.xml
@@ -217,12 +217,15 @@
<menu:menuseparator/>
<menu:menu menu:id=".uno:TransliterateMenu">
<menu:menupopup>
- <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToLower"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToKatakana"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToSentenceCase"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToLower"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToTitleCase"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToToggleCase"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToKatakana"/>
</menu:menupopup>
</menu:menu>
<menu:menuitem menu:id=".uno:RubyDialog"/>
diff --git a/sw/uiconfig/sglobal/toolbar/extrusionobjectbar.xml b/sw/uiconfig/sglobal/toolbar/extrusionobjectbar.xml
index 1f212226cf52..148849db6ee7 100644
--- a/sw/uiconfig/sglobal/toolbar/extrusionobjectbar.xml
+++ b/sw/uiconfig/sglobal/toolbar/extrusionobjectbar.xml
@@ -8,9 +8,9 @@
<toolbar:toolbaritem xlink:href=".uno:ExtrusionTiltLeft" toolbar:helpid="10963"/>
<toolbar:toolbaritem xlink:href=".uno:ExtrusionTiltRight" toolbar:helpid="10964"/>
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionDepthFloater" toolbar:helpid="10965"/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionDirectionFloater" toolbar:helpid="10966"/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionLightingFloater" toolbar:helpid="10967"/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionSurfaceFloater" toolbar:helpid="10968"/>
- <toolbar:toolbaritem xlink:href=".uno:Extrusion3DColor" toolbar:helpid="10969"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionDepthFloater" toolbar:helpid="10965" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionDirectionFloater" toolbar:helpid="10966" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionLightingFloater" toolbar:helpid="10967" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionSurfaceFloater" toolbar:helpid="10968" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:Extrusion3DColor" toolbar:helpid="10969" toolbar:style="dropdownonly"/>
</toolbar:toolbar> \ No newline at end of file
diff --git a/sw/uiconfig/sglobal/toolbar/findbar.xml b/sw/uiconfig/sglobal/toolbar/findbar.xml
new file mode 100644
index 000000000000..9ef9d8a1a78f
--- /dev/null
+++ b/sw/uiconfig/sglobal/toolbar/findbar.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:FindText" toolbar:helpid="helpid:100105" />
+ <toolbar:toolbaritem xlink:href=".uno:DownSearch" toolbar:helpid="helpid:100105" />
+ <toolbar:toolbaritem xlink:href=".uno:UpSearch" toolbar:helpid="helpid:100105" />
+ <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:text="Find &amp; Replace" toolbar:visible="false" toolbar:helpid="helpid:100105"/>
+</toolbar:toolbar>
diff --git a/sw/uiconfig/sglobal/toolbar/fontworkobjectbar.xml b/sw/uiconfig/sglobal/toolbar/fontworkobjectbar.xml
index 3ac334e0e920..32de621477dc 100644
--- a/sw/uiconfig/sglobal/toolbar/fontworkobjectbar.xml
+++ b/sw/uiconfig/sglobal/toolbar/fontworkobjectbar.xml
@@ -3,9 +3,9 @@
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
<toolbar:toolbaritem xlink:href=".uno:FontworkGalleryFloater" toolbar:helpid="helpid:10977" />
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:FontworkShapeType" toolbar:helpid="helpid:10978" toolbar:style="radio dropdown" />
+ <toolbar:toolbaritem xlink:href=".uno:FontworkShapeType" toolbar:helpid="helpid:10978" toolbar:style="dropdownonly"/>
<toolbar:toolbaritem xlink:href=".uno:FontworkSameLetterHeights" toolbar:helpid="helpid:10979" />
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:FontworkAlignmentFloater" toolbar:helpid="helpid:10981" toolbar:style="dropdown" />
- <toolbar:toolbaritem xlink:href=".uno:FontworkCharacterSpacingFloater" toolbar:helpid="helpid:10982" toolbar:style="dropdown" />
+ <toolbar:toolbaritem xlink:href=".uno:FontworkAlignmentFloater" toolbar:helpid="helpid:10981" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:FontworkCharacterSpacingFloater" toolbar:helpid="helpid:10982" toolbar:style="dropdownonly"/>
</toolbar:toolbar> \ No newline at end of file
diff --git a/sw/uiconfig/sweb/menubar/menubar.xml b/sw/uiconfig/sweb/menubar/menubar.xml
index 308406bfdffa..4b482e373d3f 100644
--- a/sw/uiconfig/sweb/menubar/menubar.xml
+++ b/sw/uiconfig/sweb/menubar/menubar.xml
@@ -165,12 +165,15 @@
<menu:menuseparator/>
<menu:menu menu:id=".uno:TransliterateMenu">
<menu:menupopup>
- <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToLower"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToKatakana"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToSentenceCase"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToLower"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToTitleCase"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToToggleCase"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToKatakana"/>
</menu:menupopup>
</menu:menu>
<menu:menuitem menu:id=".uno:FormatColumns"/>
diff --git a/sw/uiconfig/sweb/toolbar/extrusionobjectbar.xml b/sw/uiconfig/sweb/toolbar/extrusionobjectbar.xml
index 1f212226cf52..148849db6ee7 100644
--- a/sw/uiconfig/sweb/toolbar/extrusionobjectbar.xml
+++ b/sw/uiconfig/sweb/toolbar/extrusionobjectbar.xml
@@ -8,9 +8,9 @@
<toolbar:toolbaritem xlink:href=".uno:ExtrusionTiltLeft" toolbar:helpid="10963"/>
<toolbar:toolbaritem xlink:href=".uno:ExtrusionTiltRight" toolbar:helpid="10964"/>
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionDepthFloater" toolbar:helpid="10965"/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionDirectionFloater" toolbar:helpid="10966"/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionLightingFloater" toolbar:helpid="10967"/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionSurfaceFloater" toolbar:helpid="10968"/>
- <toolbar:toolbaritem xlink:href=".uno:Extrusion3DColor" toolbar:helpid="10969"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionDepthFloater" toolbar:helpid="10965" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionDirectionFloater" toolbar:helpid="10966" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionLightingFloater" toolbar:helpid="10967" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionSurfaceFloater" toolbar:helpid="10968" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:Extrusion3DColor" toolbar:helpid="10969" toolbar:style="dropdownonly"/>
</toolbar:toolbar> \ No newline at end of file
diff --git a/sw/uiconfig/sweb/toolbar/findbar.xml b/sw/uiconfig/sweb/toolbar/findbar.xml
new file mode 100644
index 000000000000..9ef9d8a1a78f
--- /dev/null
+++ b/sw/uiconfig/sweb/toolbar/findbar.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:FindText" toolbar:helpid="helpid:100105" />
+ <toolbar:toolbaritem xlink:href=".uno:DownSearch" toolbar:helpid="helpid:100105" />
+ <toolbar:toolbaritem xlink:href=".uno:UpSearch" toolbar:helpid="helpid:100105" />
+ <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:text="Find &amp; Replace" toolbar:visible="false" toolbar:helpid="helpid:100105"/>
+</toolbar:toolbar>
diff --git a/sw/uiconfig/sweb/toolbar/fontworkobjectbar.xml b/sw/uiconfig/sweb/toolbar/fontworkobjectbar.xml
index 850943e5486b..a6d5c8d4f6f9 100644
--- a/sw/uiconfig/sweb/toolbar/fontworkobjectbar.xml
+++ b/sw/uiconfig/sweb/toolbar/fontworkobjectbar.xml
@@ -3,9 +3,9 @@
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
<toolbar:toolbaritem xlink:href=".uno:FontworkGalleryFloater" toolbar:helpid="helpid:10977" />
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:FontworkShapeType" toolbar:helpid="helpid:10978" toolbar:style="radio dropdown" />
+ <toolbar:toolbaritem xlink:href=".uno:FontworkShapeType" toolbar:helpid="helpid:10978" toolbar:style="dropdownonly" />
<toolbar:toolbaritem xlink:href=".uno:FontworkSameLetterHeights" toolbar:helpid="helpid:10979" />
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:FontworkAlignmentFloater" toolbar:helpid="helpid:10981" />
- <toolbar:toolbaritem xlink:href=".uno:FontworkCharacterSpacingFloater" toolbar:helpid="helpid:10982" />
+ <toolbar:toolbaritem xlink:href=".uno:FontworkAlignmentFloater" toolbar:helpid="helpid:10981" toolbar:style="dropdownonly" />
+ <toolbar:toolbaritem xlink:href=".uno:FontworkCharacterSpacingFloater" toolbar:helpid="helpid:10982" toolbar:style="dropdownonly" />
</toolbar:toolbar>
diff --git a/sw/uiconfig/swform/menubar/menubar.xml b/sw/uiconfig/swform/menubar/menubar.xml
index 726b8905eadb..69b65cfd3e59 100644
--- a/sw/uiconfig/swform/menubar/menubar.xml
+++ b/sw/uiconfig/swform/menubar/menubar.xml
@@ -217,12 +217,15 @@
<menu:menuseparator/>
<menu:menu menu:id=".uno:TransliterateMenu">
<menu:menupopup>
- <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToLower"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToKatakana"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToSentenceCase"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToLower"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToTitleCase"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToToggleCase"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToKatakana"/>
</menu:menupopup>
</menu:menu>
<menu:menuitem menu:id=".uno:RubyDialog"/>
diff --git a/sw/uiconfig/swform/toolbar/extrusionobjectbar.xml b/sw/uiconfig/swform/toolbar/extrusionobjectbar.xml
index 1f212226cf52..148849db6ee7 100644
--- a/sw/uiconfig/swform/toolbar/extrusionobjectbar.xml
+++ b/sw/uiconfig/swform/toolbar/extrusionobjectbar.xml
@@ -8,9 +8,9 @@
<toolbar:toolbaritem xlink:href=".uno:ExtrusionTiltLeft" toolbar:helpid="10963"/>
<toolbar:toolbaritem xlink:href=".uno:ExtrusionTiltRight" toolbar:helpid="10964"/>
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionDepthFloater" toolbar:helpid="10965"/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionDirectionFloater" toolbar:helpid="10966"/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionLightingFloater" toolbar:helpid="10967"/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionSurfaceFloater" toolbar:helpid="10968"/>
- <toolbar:toolbaritem xlink:href=".uno:Extrusion3DColor" toolbar:helpid="10969"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionDepthFloater" toolbar:helpid="10965" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionDirectionFloater" toolbar:helpid="10966" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionLightingFloater" toolbar:helpid="10967" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionSurfaceFloater" toolbar:helpid="10968" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:Extrusion3DColor" toolbar:helpid="10969" toolbar:style="dropdownonly"/>
</toolbar:toolbar> \ No newline at end of file
diff --git a/sw/uiconfig/swform/toolbar/fontworkobjectbar.xml b/sw/uiconfig/swform/toolbar/fontworkobjectbar.xml
index 3ac334e0e920..5219a1e235e9 100644
--- a/sw/uiconfig/swform/toolbar/fontworkobjectbar.xml
+++ b/sw/uiconfig/swform/toolbar/fontworkobjectbar.xml
@@ -3,9 +3,9 @@
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
<toolbar:toolbaritem xlink:href=".uno:FontworkGalleryFloater" toolbar:helpid="helpid:10977" />
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:FontworkShapeType" toolbar:helpid="helpid:10978" toolbar:style="radio dropdown" />
+ <toolbar:toolbaritem xlink:href=".uno:FontworkShapeType" toolbar:helpid="helpid:10978" toolbar:style="dropdownonly" />
<toolbar:toolbaritem xlink:href=".uno:FontworkSameLetterHeights" toolbar:helpid="helpid:10979" />
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:FontworkAlignmentFloater" toolbar:helpid="helpid:10981" toolbar:style="dropdown" />
- <toolbar:toolbaritem xlink:href=".uno:FontworkCharacterSpacingFloater" toolbar:helpid="helpid:10982" toolbar:style="dropdown" />
+ <toolbar:toolbaritem xlink:href=".uno:FontworkAlignmentFloater" toolbar:helpid="helpid:10981" toolbar:style="dropdownonly" />
+ <toolbar:toolbaritem xlink:href=".uno:FontworkCharacterSpacingFloater" toolbar:helpid="helpid:10982" toolbar:style="dropdownonly" />
</toolbar:toolbar> \ No newline at end of file
diff --git a/sw/uiconfig/swreport/menubar/menubar.xml b/sw/uiconfig/swreport/menubar/menubar.xml
index 726b8905eadb..69b65cfd3e59 100644
--- a/sw/uiconfig/swreport/menubar/menubar.xml
+++ b/sw/uiconfig/swreport/menubar/menubar.xml
@@ -217,12 +217,15 @@
<menu:menuseparator/>
<menu:menu menu:id=".uno:TransliterateMenu">
<menu:menupopup>
- <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToLower"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToKatakana"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToSentenceCase"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToLower"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToTitleCase"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToToggleCase"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToKatakana"/>
</menu:menupopup>
</menu:menu>
<menu:menuitem menu:id=".uno:RubyDialog"/>
diff --git a/sw/uiconfig/swreport/toolbar/extrusionobjectbar.xml b/sw/uiconfig/swreport/toolbar/extrusionobjectbar.xml
index 1f212226cf52..148849db6ee7 100644
--- a/sw/uiconfig/swreport/toolbar/extrusionobjectbar.xml
+++ b/sw/uiconfig/swreport/toolbar/extrusionobjectbar.xml
@@ -8,9 +8,9 @@
<toolbar:toolbaritem xlink:href=".uno:ExtrusionTiltLeft" toolbar:helpid="10963"/>
<toolbar:toolbaritem xlink:href=".uno:ExtrusionTiltRight" toolbar:helpid="10964"/>
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionDepthFloater" toolbar:helpid="10965"/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionDirectionFloater" toolbar:helpid="10966"/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionLightingFloater" toolbar:helpid="10967"/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionSurfaceFloater" toolbar:helpid="10968"/>
- <toolbar:toolbaritem xlink:href=".uno:Extrusion3DColor" toolbar:helpid="10969"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionDepthFloater" toolbar:helpid="10965" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionDirectionFloater" toolbar:helpid="10966" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionLightingFloater" toolbar:helpid="10967" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionSurfaceFloater" toolbar:helpid="10968" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:Extrusion3DColor" toolbar:helpid="10969" toolbar:style="dropdownonly"/>
</toolbar:toolbar> \ No newline at end of file
diff --git a/sw/uiconfig/swreport/toolbar/fontworkobjectbar.xml b/sw/uiconfig/swreport/toolbar/fontworkobjectbar.xml
index 3ac334e0e920..5219a1e235e9 100644
--- a/sw/uiconfig/swreport/toolbar/fontworkobjectbar.xml
+++ b/sw/uiconfig/swreport/toolbar/fontworkobjectbar.xml
@@ -3,9 +3,9 @@
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
<toolbar:toolbaritem xlink:href=".uno:FontworkGalleryFloater" toolbar:helpid="helpid:10977" />
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:FontworkShapeType" toolbar:helpid="helpid:10978" toolbar:style="radio dropdown" />
+ <toolbar:toolbaritem xlink:href=".uno:FontworkShapeType" toolbar:helpid="helpid:10978" toolbar:style="dropdownonly" />
<toolbar:toolbaritem xlink:href=".uno:FontworkSameLetterHeights" toolbar:helpid="helpid:10979" />
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:FontworkAlignmentFloater" toolbar:helpid="helpid:10981" toolbar:style="dropdown" />
- <toolbar:toolbaritem xlink:href=".uno:FontworkCharacterSpacingFloater" toolbar:helpid="helpid:10982" toolbar:style="dropdown" />
+ <toolbar:toolbaritem xlink:href=".uno:FontworkAlignmentFloater" toolbar:helpid="helpid:10981" toolbar:style="dropdownonly" />
+ <toolbar:toolbaritem xlink:href=".uno:FontworkCharacterSpacingFloater" toolbar:helpid="helpid:10982" toolbar:style="dropdownonly" />
</toolbar:toolbar> \ No newline at end of file
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index 9634079ddeb2..fb10ca615b50 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -220,12 +220,15 @@
<menu:menuseparator/>
<menu:menu menu:id=".uno:TransliterateMenu">
<menu:menupopup>
- <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToLower"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToKatakana"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToSentenceCase"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToLower"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToTitleCase"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToToggleCase"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToKatakana"/>
</menu:menupopup>
</menu:menu>
<menu:menuitem menu:id=".uno:RubyDialog"/>
diff --git a/sw/uiconfig/swriter/toolbar/extrusionobjectbar.xml b/sw/uiconfig/swriter/toolbar/extrusionobjectbar.xml
index 1f212226cf52..148849db6ee7 100644
--- a/sw/uiconfig/swriter/toolbar/extrusionobjectbar.xml
+++ b/sw/uiconfig/swriter/toolbar/extrusionobjectbar.xml
@@ -8,9 +8,9 @@
<toolbar:toolbaritem xlink:href=".uno:ExtrusionTiltLeft" toolbar:helpid="10963"/>
<toolbar:toolbaritem xlink:href=".uno:ExtrusionTiltRight" toolbar:helpid="10964"/>
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionDepthFloater" toolbar:helpid="10965"/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionDirectionFloater" toolbar:helpid="10966"/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionLightingFloater" toolbar:helpid="10967"/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionSurfaceFloater" toolbar:helpid="10968"/>
- <toolbar:toolbaritem xlink:href=".uno:Extrusion3DColor" toolbar:helpid="10969"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionDepthFloater" toolbar:helpid="10965" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionDirectionFloater" toolbar:helpid="10966" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionLightingFloater" toolbar:helpid="10967" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionSurfaceFloater" toolbar:helpid="10968" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:Extrusion3DColor" toolbar:helpid="10969" toolbar:style="dropdownonly"/>
</toolbar:toolbar> \ No newline at end of file
diff --git a/sw/uiconfig/swriter/toolbar/findbar.xml b/sw/uiconfig/swriter/toolbar/findbar.xml
new file mode 100644
index 000000000000..9ef9d8a1a78f
--- /dev/null
+++ b/sw/uiconfig/swriter/toolbar/findbar.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:FindText" toolbar:helpid="helpid:100105" />
+ <toolbar:toolbaritem xlink:href=".uno:DownSearch" toolbar:helpid="helpid:100105" />
+ <toolbar:toolbaritem xlink:href=".uno:UpSearch" toolbar:helpid="helpid:100105" />
+ <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:text="Find &amp; Replace" toolbar:visible="false" toolbar:helpid="helpid:100105"/>
+</toolbar:toolbar>
diff --git a/sw/uiconfig/swriter/toolbar/fontworkobjectbar.xml b/sw/uiconfig/swriter/toolbar/fontworkobjectbar.xml
index 3ac334e0e920..5219a1e235e9 100644
--- a/sw/uiconfig/swriter/toolbar/fontworkobjectbar.xml
+++ b/sw/uiconfig/swriter/toolbar/fontworkobjectbar.xml
@@ -3,9 +3,9 @@
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
<toolbar:toolbaritem xlink:href=".uno:FontworkGalleryFloater" toolbar:helpid="helpid:10977" />
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:FontworkShapeType" toolbar:helpid="helpid:10978" toolbar:style="radio dropdown" />
+ <toolbar:toolbaritem xlink:href=".uno:FontworkShapeType" toolbar:helpid="helpid:10978" toolbar:style="dropdownonly" />
<toolbar:toolbaritem xlink:href=".uno:FontworkSameLetterHeights" toolbar:helpid="helpid:10979" />
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:FontworkAlignmentFloater" toolbar:helpid="helpid:10981" toolbar:style="dropdown" />
- <toolbar:toolbaritem xlink:href=".uno:FontworkCharacterSpacingFloater" toolbar:helpid="helpid:10982" toolbar:style="dropdown" />
+ <toolbar:toolbaritem xlink:href=".uno:FontworkAlignmentFloater" toolbar:helpid="helpid:10981" toolbar:style="dropdownonly" />
+ <toolbar:toolbaritem xlink:href=".uno:FontworkCharacterSpacingFloater" toolbar:helpid="helpid:10982" toolbar:style="dropdownonly" />
</toolbar:toolbar> \ No newline at end of file
diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml
index 89ab81e790cf..ae0df22748fe 100644
--- a/sw/uiconfig/swxform/menubar/menubar.xml
+++ b/sw/uiconfig/swxform/menubar/menubar.xml
@@ -218,12 +218,15 @@
<menu:menuseparator/>
<menu:menu menu:id=".uno:TransliterateMenu">
<menu:menupopup>
- <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToLower"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/>
- <menu:menuitem menu:id=".uno:ChangeCaseToKatakana"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToSentenceCase"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToLower"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToUpper"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToTitleCase"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToToggleCase"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToHalfWidth"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToFullWidth"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToHiragana"/>
+ <menu:menuitem menu:id=".uno:ChangeCaseToKatakana"/>
</menu:menupopup>
</menu:menu>
<menu:menuitem menu:id=".uno:RubyDialog"/>
diff --git a/sw/uiconfig/swxform/toolbar/extrusionobjectbar.xml b/sw/uiconfig/swxform/toolbar/extrusionobjectbar.xml
index 1f212226cf52..148849db6ee7 100644
--- a/sw/uiconfig/swxform/toolbar/extrusionobjectbar.xml
+++ b/sw/uiconfig/swxform/toolbar/extrusionobjectbar.xml
@@ -8,9 +8,9 @@
<toolbar:toolbaritem xlink:href=".uno:ExtrusionTiltLeft" toolbar:helpid="10963"/>
<toolbar:toolbaritem xlink:href=".uno:ExtrusionTiltRight" toolbar:helpid="10964"/>
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionDepthFloater" toolbar:helpid="10965"/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionDirectionFloater" toolbar:helpid="10966"/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionLightingFloater" toolbar:helpid="10967"/>
- <toolbar:toolbaritem xlink:href=".uno:ExtrusionSurfaceFloater" toolbar:helpid="10968"/>
- <toolbar:toolbaritem xlink:href=".uno:Extrusion3DColor" toolbar:helpid="10969"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionDepthFloater" toolbar:helpid="10965" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionDirectionFloater" toolbar:helpid="10966" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionLightingFloater" toolbar:helpid="10967" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtrusionSurfaceFloater" toolbar:helpid="10968" toolbar:style="dropdownonly"/>
+ <toolbar:toolbaritem xlink:href=".uno:Extrusion3DColor" toolbar:helpid="10969" toolbar:style="dropdownonly"/>
</toolbar:toolbar> \ No newline at end of file
diff --git a/sw/uiconfig/swxform/toolbar/findbar.xml b/sw/uiconfig/swxform/toolbar/findbar.xml
new file mode 100644
index 000000000000..9ef9d8a1a78f
--- /dev/null
+++ b/sw/uiconfig/swxform/toolbar/findbar.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:FindText" toolbar:helpid="helpid:100105" />
+ <toolbar:toolbaritem xlink:href=".uno:DownSearch" toolbar:helpid="helpid:100105" />
+ <toolbar:toolbaritem xlink:href=".uno:UpSearch" toolbar:helpid="helpid:100105" />
+ <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:text="Find &amp; Replace" toolbar:visible="false" toolbar:helpid="helpid:100105"/>
+</toolbar:toolbar>
diff --git a/sw/uiconfig/swxform/toolbar/fontworkobjectbar.xml b/sw/uiconfig/swxform/toolbar/fontworkobjectbar.xml
index 3ac334e0e920..5219a1e235e9 100644
--- a/sw/uiconfig/swxform/toolbar/fontworkobjectbar.xml
+++ b/sw/uiconfig/swxform/toolbar/fontworkobjectbar.xml
@@ -3,9 +3,9 @@
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
<toolbar:toolbaritem xlink:href=".uno:FontworkGalleryFloater" toolbar:helpid="helpid:10977" />
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:FontworkShapeType" toolbar:helpid="helpid:10978" toolbar:style="radio dropdown" />
+ <toolbar:toolbaritem xlink:href=".uno:FontworkShapeType" toolbar:helpid="helpid:10978" toolbar:style="dropdownonly" />
<toolbar:toolbaritem xlink:href=".uno:FontworkSameLetterHeights" toolbar:helpid="helpid:10979" />
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:FontworkAlignmentFloater" toolbar:helpid="helpid:10981" toolbar:style="dropdown" />
- <toolbar:toolbaritem xlink:href=".uno:FontworkCharacterSpacingFloater" toolbar:helpid="helpid:10982" toolbar:style="dropdown" />
+ <toolbar:toolbaritem xlink:href=".uno:FontworkAlignmentFloater" toolbar:helpid="helpid:10981" toolbar:style="dropdownonly" />
+ <toolbar:toolbaritem xlink:href=".uno:FontworkCharacterSpacingFloater" toolbar:helpid="helpid:10982" toolbar:style="dropdownonly" />
</toolbar:toolbar> \ No newline at end of file