[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 2 commits - sw/inc sw/Library_sw.mk sw/sdi sw/source
Oliver-Rainer Wittmann
orw at apache.org
Mon Nov 18 04:08:49 PST 2013
sw/Library_sw.mk | 1
sw/inc/IDocumentContentOperations.hxx | 132 +++---
sw/inc/crsrsh.hxx | 43 +-
sw/inc/doc.hxx | 18
sw/inc/editsh.hxx | 7
sw/inc/expfld.hxx | 40 +-
sw/inc/fldbas.hxx | 7
sw/inc/fmtfld.hxx | 30 -
sw/inc/hintids.hxx | 12
sw/inc/ndtxt.hxx | 102 +----
sw/inc/txatbase.hxx | 22 -
sw/inc/txtfld.hxx | 75 ++-
sw/inc/txtrfmrk.hxx | 1
sw/inc/txttxmrk.hxx | 1
sw/inc/viscrs.hxx | 20 -
sw/sdi/_textsh.sdi | 15
sw/sdi/_viewsh.sdi | 12
sw/source/core/access/accportions.cxx | 1
sw/source/core/bastyp/init.cxx | 6
sw/source/core/crsr/callnk.cxx | 2
sw/source/core/crsr/crsrsh.cxx | 38 -
sw/source/core/crsr/crstrvl.cxx | 439 ++++++++++++++--------
sw/source/core/crsr/findattr.cxx | 4
sw/source/core/crsr/findtxt.cxx | 30 -
sw/source/core/crsr/overlayrangesoutline.cxx | 117 +++++
sw/source/core/crsr/overlayrangesoutline.hxx | 70 +++
sw/source/core/crsr/swcrsr.cxx | 117 ++++-
sw/source/core/crsr/viscrs.cxx | 133 +++++-
sw/source/core/doc/dbgoutsw.cxx | 4
sw/source/core/doc/doc.cxx | 31 -
sw/source/core/doc/docedt.cxx | 4
sw/source/core/doc/docfld.cxx | 26 -
sw/source/core/doc/docfmt.cxx | 58 +-
sw/source/core/doc/docnum.cxx | 28 -
sw/source/core/doc/docredln.cxx | 4
sw/source/core/doc/docruby.cxx | 4
sw/source/core/doc/doctxm.cxx | 6
sw/source/core/doc/visiturl.cxx | 2
sw/source/core/docnode/nodes.cxx | 16
sw/source/core/edit/acorrect.cxx | 2
sw/source/core/edit/edatmisc.cxx | 4
sw/source/core/edit/edattr.cxx | 30 -
sw/source/core/edit/edfld.cxx | 100 +----
sw/source/core/edit/edfldexp.cxx | 1
sw/source/core/edit/editsh.cxx | 4
sw/source/core/edit/edlingu.cxx | 6
sw/source/core/edit/ednumber.cxx | 14
sw/source/core/edit/edtox.cxx | 4
sw/source/core/fields/expfld.cxx | 409 +++++++++++---------
sw/source/core/fields/fldbas.cxx | 29 +
sw/source/core/fields/reffld.cxx | 28 -
sw/source/core/frmedt/fefly1.cxx | 78 ++-
sw/source/core/inc/docfld.hxx | 5
sw/source/core/inc/rolbck.hxx | 11
sw/source/core/inc/rootfrm.hxx | 5
sw/source/core/inc/swfont.hxx | 27 -
sw/source/core/inc/txttypes.hxx | 1
sw/source/core/layout/flycnt.cxx | 24 -
sw/source/core/layout/laycache.cxx | 4
sw/source/core/layout/trvlfrm.cxx | 4
sw/source/core/text/atrhndl.hxx | 2
sw/source/core/text/atrstck.cxx | 21 -
sw/source/core/text/inftxt.cxx | 58 +-
sw/source/core/text/itrform2.cxx | 26 -
sw/source/core/text/porfld.cxx | 13
sw/source/core/text/porfld.hxx | 4
sw/source/core/text/porlay.cxx | 4
sw/source/core/text/pormulti.cxx | 36 -
sw/source/core/text/portxt.cxx | 118 +++++
sw/source/core/text/portxt.hxx | 18
sw/source/core/text/txtfld.cxx | 20 -
sw/source/core/text/txtfrm.cxx | 10
sw/source/core/tox/tox.cxx | 2
sw/source/core/tox/txmsrt.cxx | 14
sw/source/core/txtnode/atrfld.cxx | 294 +++++++++-----
sw/source/core/txtnode/ndhints.cxx | 18
sw/source/core/txtnode/ndtxt.cxx | 535 +++++++++++----------------
sw/source/core/txtnode/swfont.cxx | 3
sw/source/core/txtnode/thints.cxx | 244 +++++++++---
sw/source/core/txtnode/txatbase.cxx | 1
sw/source/core/txtnode/txatritr.cxx | 8
sw/source/core/txtnode/txtedt.cxx | 39 +
sw/source/core/undo/SwUndoField.cxx | 8
sw/source/core/undo/rolbck.cxx | 24 -
sw/source/core/undo/unsect.cxx | 7
sw/source/core/undo/untbl.cxx | 5
sw/source/core/undo/untblk.cxx | 2
sw/source/core/unocore/unocrsrhelper.cxx | 387 +++++++++----------
sw/source/core/unocore/unodraw.cxx | 3
sw/source/core/unocore/unofield.cxx | 25 -
sw/source/core/unocore/unoframe.cxx | 25 -
sw/source/core/unocore/unoidx.cxx | 12
sw/source/core/unocore/unoportenum.cxx | 64 ++-
sw/source/core/unocore/unorefmk.cxx | 20 -
sw/source/core/view/vprint.cxx | 17
sw/source/filter/ascii/ascatr.cxx | 52 +-
sw/source/filter/ascii/parasc.cxx | 4
sw/source/filter/html/css1atr.cxx | 2
sw/source/filter/html/htmlatr.cxx | 14
sw/source/filter/html/swhtml.cxx | 5
sw/source/filter/html/wrthtml.cxx | 2
sw/source/filter/rtf/rtffly.cxx | 2
sw/source/filter/ww1/fltshell.cxx | 19
sw/source/filter/ww1/w1filter.cxx | 4
sw/source/filter/ww8/attributeoutputbase.hxx | 2
sw/source/filter/ww8/wrtw8esh.cxx | 3
sw/source/filter/ww8/wrtw8nds.cxx | 23 -
sw/source/filter/ww8/ww8atr.cxx | 25 -
sw/source/filter/ww8/ww8par.cxx | 23 -
sw/source/filter/ww8/ww8par3.cxx | 156 ++++---
sw/source/filter/ww8/ww8par5.cxx | 8
sw/source/ui/app/applab.cxx | 2
sw/source/ui/app/docst.cxx | 4
sw/source/ui/docvw/SidebarTxtControl.hxx | 2
sw/source/ui/docvw/edtdd.cxx | 4
sw/source/ui/docvw/edtwin.cxx | 71 ++-
sw/source/ui/docvw/edtwin2.cxx | 224 ++++-------
sw/source/ui/envelp/envfmt.cxx | 2
sw/source/ui/fldui/fldedt.cxx | 38 -
sw/source/ui/fldui/fldmgr.cxx | 12
sw/source/ui/inc/wrtsh.hxx | 5
sw/source/ui/lingu/hhcwrp.cxx | 6
sw/source/ui/misc/insfnote.cxx | 2
sw/source/ui/shells/annotsh.cxx | 36 -
sw/source/ui/shells/basesh.cxx | 72 ++-
sw/source/ui/shells/drwtxtex.cxx | 44 +-
sw/source/ui/shells/frmsh.cxx | 10
sw/source/ui/shells/grfsh.cxx | 25 -
sw/source/ui/shells/langhelper.cxx | 6
sw/source/ui/shells/listsh.cxx | 7
sw/source/ui/shells/tabsh.cxx | 7
sw/source/ui/shells/textfld.cxx | 148 +++++--
sw/source/ui/shells/textidx.cxx | 11
sw/source/ui/shells/textsh.cxx | 164 +++++---
sw/source/ui/shells/textsh1.cxx | 159 ++++----
sw/source/ui/shells/txtattr.cxx | 22 -
sw/source/ui/uiview/formatclipboard.cxx | 4
sw/source/ui/uiview/view.cxx | 17
sw/source/ui/uiview/view2.cxx | 2
sw/source/ui/uiview/viewmdi.cxx | 28 -
sw/source/ui/uiview/viewsrch.cxx | 2
sw/source/ui/uiview/viewstat.cxx | 83 ++--
sw/source/ui/uiview/viewtab.cxx | 10
sw/source/ui/wrtsh/delete.cxx | 2
sw/source/ui/wrtsh/wrtsh1.cxx | 57 --
sw/source/ui/wrtsh/wrtsh2.cxx | 14
146 files changed, 3621 insertions(+), 2580 deletions(-)
New commits:
commit be646a0b763e1688fbd4bc6cee0d3df79b90820b
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date: Mon Nov 18 11:54:00 2013 +0000
33737: remove accicently added svn property 'svn:executable' at new source files
diff --git a/sw/source/core/crsr/overlayrangesoutline.cxx b/sw/source/core/crsr/overlayrangesoutline.cxx
old mode 100755
new mode 100644
diff --git a/sw/source/core/crsr/overlayrangesoutline.hxx b/sw/source/core/crsr/overlayrangesoutline.hxx
old mode 100755
new mode 100644
commit c2afeb1c3f11e8f420b59f3786eb8626c99ff595
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date: Mon Nov 18 11:29:24 2013 +0000
33737: enable in-place editing of Input Fields
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index 0bdfe45..8adedd7 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -151,6 +151,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
sw/source/core/crsr/trvltbl \
sw/source/core/crsr/unocrsr \
sw/source/core/crsr/viscrs \
+ sw/source/core/crsr/overlayrangesoutline \
sw/source/core/doc/SwStyleNameMapper \
sw/source/core/doc/acmplwrd \
sw/source/core/doc/dbgoutsw \
diff --git a/sw/inc/IDocumentContentOperations.hxx b/sw/inc/IDocumentContentOperations.hxx
index 82fdb9c..e82b3f8 100644
--- a/sw/inc/IDocumentContentOperations.hxx
+++ b/sw/inc/IDocumentContentOperations.hxx
@@ -21,36 +21,37 @@
- #ifndef IDOCUMENTCONTENTOPERATIONS_HXX_INCLUDED
- #define IDOCUMENTCONTENTOPERATIONS_HXX_INCLUDED
-
- #ifndef _SAL_TYPES_H_
- #include <sal/types.h>
- #endif
-
- class SwPaM;
- struct SwPosition;
- class SwNode;
- class SwNodeRange;
- class String;
- class Graphic;
- class SfxItemSet;
- class SfxPoolItem;
- class GraphicObject;
- class SdrObject;
- class SwFrmFmt;
- class SwDrawFrmFmt;
- class SwFlyFrmFmt;
- class SwNodeIndex;
-
- namespace utl { class TransliterationWrapper; }
- namespace svt { class EmbeddedObjectRef; }
-
- /** Text operation/manipulation interface
- */
- class IDocumentContentOperations
- {
- public:
+#ifndef IDOCUMENTCONTENTOPERATIONS_HXX_INCLUDED
+#define IDOCUMENTCONTENTOPERATIONS_HXX_INCLUDED
+
+#ifndef _SAL_TYPES_H_
+#include <sal/types.h>
+#endif
+
+class SwPaM;
+struct SwPosition;
+class SwNode;
+class SwNodeRange;
+class String;
+class Graphic;
+class SfxItemSet;
+class SfxPoolItem;
+class GraphicObject;
+class SdrObject;
+class SwFrmFmt;
+class SwDrawFrmFmt;
+class SwFlyFrmFmt;
+class SwNodeIndex;
+class SwFmtFld;
+
+namespace utl { class TransliterationWrapper; }
+namespace svt { class EmbeddedObjectRef; }
+
+/** Text operation/manipulation interface
+*/
+class IDocumentContentOperations
+{
+public:
enum SwMoveFlags
{
DOC_MOVEDEFAULT = 0x00,
@@ -68,9 +69,9 @@
, INS_FORCEHINTEXPAND = 0x04 // expand all hints at insert position
};
- public:
+public:
/** Kopieren eines Bereiches im oder in ein anderes Dokument !
- Die Position kann auch im Bereich liegen !!
+ Die Position kann auch im Bereich liegen !!
*/
virtual bool CopyRange(SwPaM&, SwPosition&, const bool bCopyAll ) const = 0;
@@ -88,12 +89,12 @@
/** complete delete of a given PaM
- OD 2009-08-20 #i100466#
- Add optional parameter <bForceJoinNext>, default value <false>
- Needed for hiding of deletion redlines
+ OD 2009-08-20 #i100466#
+ Add optional parameter <bForceJoinNext>, default value <false>
+ Needed for hiding of deletion redlines
*/
virtual bool DeleteAndJoin( SwPaM&,
- const bool bForceJoinNext = false ) = 0;
+ const bool bForceJoinNext = false ) = 0;
/** verschieben eines Bereiches
*/
@@ -114,7 +115,7 @@
/** Insert string into existing text node at position rRg.Point().
*/
virtual bool InsertString(const SwPaM &rRg, const String&,
- const enum InsertFlags nInsertMode = INS_EMPTYEXPAND ) = 0;
+ const enum InsertFlags nInsertMode = INS_EMPTYEXPAND ) = 0;
/** change text to Upper/Lower/Hiragana/Katagana/...
*/
@@ -123,29 +124,29 @@
/** Einfuegen einer Grafik, Formel. Die XXXX werden kopiert.
*/
virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const String& rGrfName, const String& rFltName, const Graphic* pGraphic,
- const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet, SwFrmFmt*) = 0;
+ const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet, SwFrmFmt*) = 0;
/**
*/
virtual SwFlyFrmFmt* Insert(const SwPaM& rRg, const GraphicObject& rGrfObj, const SfxItemSet* pFlyAttrSet,
- const SfxItemSet* pGrfAttrSet, SwFrmFmt*) = 0;
+ const SfxItemSet* pGrfAttrSet, SwFrmFmt*) = 0;
/** austauschen einer Grafik (mit Undo)
*/
virtual void ReRead(SwPaM&, const String& rGrfName, const String& rFltName, const Graphic* pGraphic, const GraphicObject* pGrfObj) = 0;
/** Einfuegen eines DrawObjectes. Das Object muss bereits im DrawModel
- angemeldet sein.
+ angemeldet sein.
*/
virtual SwDrawFrmFmt* Insert(const SwPaM &rRg, SdrObject& rDrawObj, const SfxItemSet* pFlyAttrSet, SwFrmFmt*) = 0;
/** Einfuegen von OLE-Objecten.
*/
virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj, const SfxItemSet* pFlyAttrSet,
- const SfxItemSet* pGrfAttrSet, SwFrmFmt*) = 0;
+ const SfxItemSet* pGrfAttrSet, SwFrmFmt*) = 0;
virtual SwFlyFrmFmt* InsertOLE(const SwPaM &rRg, const String& rObjName, sal_Int64 nAspect, const SfxItemSet* pFlyAttrSet,
- const SfxItemSet* pGrfAttrSet, SwFrmFmt*) = 0;
+ const SfxItemSet* pGrfAttrSet, SwFrmFmt*) = 0;
/** Aufspalten eines Nodes an rPos (nur fuer den TxtNode implementiert)
*/
@@ -156,45 +157,48 @@
virtual bool AppendTxtNode(SwPosition& rPos) = 0;
/** Ersetz einen selektierten Bereich in einem TextNode mit dem
- String. Ist fuers Suchen&Ersetzen gedacht.
- bRegExpRplc - ersetze Tabs (\\t) und setze den gefundenen String
- ein ( nicht \& )
- z.B.: Fnd: "zzz", Repl: "xx\t\\t..&..\&"
- --> "xx\t<Tab>..zzz..&"
+ String. Ist fuers Suchen&Ersetzen gedacht.
+ bRegExpRplc - ersetze Tabs (\\t) und setze den gefundenen String
+ ein ( nicht \& )
+ z.B.: Fnd: "zzz", Repl: "xx\t\\t..&..\&"
+ --> "xx\t<Tab>..zzz..&"
*/
virtual bool ReplaceRange(SwPaM& rPam, const String& rNewStr,
- const bool bRegExReplace) = 0;
+ const bool bRegExReplace) = 0;
/** Einfuegen eines Attributs. Erstreckt sich rRg ueber
- mehrere Nodes, wird das Attribut aufgespaltet, sofern
- dieses Sinn macht. Nodes, in denen dieses Attribut keinen
- Sinn macht, werden ignoriert. In vollstaendig in der
- Selektion eingeschlossenen Nodes wird das Attribut zu
- harter Formatierung, in den anderen (Text-)Nodes wird das
- Attribut in das Attributearray eingefuegt. Bei einem
- Zeichenattribut wird ein "leerer" Hint eingefuegt,
- wenn keine Selektion
- vorliegt; andernfalls wird das Attribut als harte
- Formatierung dem durch rRg.Start() bezeichneten Node
- hinzugefuegt. Wenn das Attribut nicht eingefuegt werden
- konnte, liefert die Methode sal_False.
+ mehrere Nodes, wird das Attribut aufgespaltet, sofern
+ dieses Sinn macht. Nodes, in denen dieses Attribut keinen
+ Sinn macht, werden ignoriert. In vollstaendig in der
+ Selektion eingeschlossenen Nodes wird das Attribut zu
+ harter Formatierung, in den anderen (Text-)Nodes wird das
+ Attribut in das Attributearray eingefuegt. Bei einem
+ Zeichenattribut wird ein "leerer" Hint eingefuegt,
+ wenn keine Selektion
+ vorliegt; andernfalls wird das Attribut als harte
+ Formatierung dem durch rRg.Start() bezeichneten Node
+ hinzugefuegt. Wenn das Attribut nicht eingefuegt werden
+ konnte, liefert die Methode sal_False.
*/
//Modify here for #119405, by chengjh, 2012-08-16
//Add a para for the char attribute exp...
- virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem&,
- const sal_uInt16 nFlags,bool bExpandCharToPara=false) = 0;
+ virtual bool InsertPoolItem(
+ const SwPaM &rRg,
+ const SfxPoolItem&,
+ const sal_uInt16 nFlags,
+ const bool bExpandCharToPara=false ) = 0;
//End
/**
*/
virtual bool InsertItemSet (const SwPaM &rRg, const SfxItemSet&,
- const sal_uInt16 nFlags) = 0;
+ const sal_uInt16 nFlags) = 0;
/** Removes any leading white space from the paragraph
*/
virtual void RemoveLeadingWhiteSpace(const SwPosition & rPos ) = 0;
- protected:
+protected:
virtual ~IDocumentContentOperations() {};
};
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index e5d684b..0b8bc74 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -71,10 +71,9 @@ class SwCellFrms;
class SwTOXMark;
class SwRedline;
class IBlockCursor;
-class SwCntntNode; // #i23726#
-// --> OD 2008-06-19 #i90516#
+class SwCntntNode;
class SwPostItField;
-// <--
+class SwTxtFld;
struct SwPosition;
namespace com { namespace sun { namespace star { namespace util {
@@ -220,10 +219,8 @@ private:
sal_uInt16 nBasicActionCnt; // Actions, die vom Basic geklammert wurden
CrsrMoveState eMvState; // Status fuers Crsr-Travelling - GetCrsrOfst
- // --> OD 2008-04-02 #refactorlists#
String sMarkedListId;
int nMarkedListLevel;
- // <--
sal_Bool bHasFocus : 1; // Shell ist in einem Window "aktiv"
sal_Bool bSVCrsrVis : 1; // SV-Cursor Un-/Sichtbar
@@ -251,9 +248,9 @@ private:
// OD 11.02.2003 #100556# - flag to allow/avoid execution of marcos (default: true)
bool mbMacroExecAllowed : 1;
- SW_DLLPRIVATE void UpdateCrsr( sal_uInt16 eFlags
- =SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE,
- sal_Bool bIdleEnd = sal_False );
+ SW_DLLPRIVATE void UpdateCrsr(
+ sal_uInt16 eFlags = SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE,
+ sal_Bool bIdleEnd = sal_False );
SW_DLLPRIVATE void _ParkPams( SwPaM* pDelRg, SwShellCrsr** ppDelRing );
@@ -734,12 +731,27 @@ public:
inline void UnSetVisCrsr();
// springe zum nachsten/vorherigen Feld des entsprechenden Types
- sal_Bool MoveFldType( const SwFieldType* pFldType, sal_Bool bNext,
- sal_uInt16 nSubType = USHRT_MAX,
- sal_uInt16 nResType = USHRT_MAX );
+ sal_Bool MoveFldType(
+ const SwFieldType* pFldType,
+ const bool bNext,
+ const sal_uInt16 nResType = USHRT_MAX,
+ const bool bAddSetExpressionFldsToInputFlds = true );
// springe genau zu diesem Feld
sal_Bool GotoFld( const SwFmtFld& rFld );
+ SwTxtFld* GetTxtFldAtPos(
+ const SwPosition* pPos,
+ const bool bIncludeInputFldAtStart ) const;
+ SwField* GetFieldAtCrsr(
+ const SwPaM* pCrsr,
+ const bool bIncludeInputFldAtStart ) const;
+ SwField* GetCurFld( const bool bIncludeInputFldAtStart = false ) const;
+ bool CrsrInsideInputFld() const;
+ bool PosInsideInputFld( const SwPosition& rPos ) const;
+ bool DocPtInsideInputFld( const Point& rDocPt ) const;
+ xub_StrLen StartOfInputFldAtPos( const SwPosition& rPos ) const;
+ xub_StrLen EndOfInputFldAtPos( const SwPosition& rPos ) const;
+
// returne die Anzahl der Cursor im Ring (Flag besagt ob man nur
// aufgepspannte haben will - sprich etwas selektiert ist (Basic))
sal_uInt16 GetCrsrCnt( sal_Bool bAll = sal_True ) const;
@@ -829,15 +841,14 @@ public:
sal_Bool GotoINetAttr( const SwTxtINetFmt& rAttr );
const SwFmtINetFmt* FindINetAttr( const String& rName ) const;
+ sal_Bool SelectTxt( const xub_StrLen nStart,
+ const xub_StrLen nEnd );
+
sal_Bool CheckTblBoxCntnt( const SwPosition* pPos = 0 );
void SaveTblBoxCntnt( const SwPosition* pPos = 0 );
void ClearTblBoxCntnt();
sal_Bool EndAllTblBoxEdit();
- // wird gerufen, wenn eine Tabellenselektion im UpdateCrsr erzeugt wird,
- // ohne das die UI davon etaws weiss
- virtual void NewCoreSelection();
-
void SetSelTblCells( sal_Bool bFlag ) { bSelTblCells = bFlag; }
sal_Bool IsSelTblCells() const { return bSelTblCells; }
@@ -892,8 +903,6 @@ public:
@return the textual description of the current selection
*/
String GetCrsrDescr() const;
-
- SwRect GetRectOfCurrentChar();
};
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 82d5a55..46b3334 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -867,13 +867,13 @@ public:
@param rPos position to search at
@return pointer to field at the given position or NULL in case no field is found
*/
- static SwField* GetField(const SwPosition& rPos);
+ static SwField* GetFieldAtPos(const SwPosition& rPos);
/** Returns the field at a certain position.
@param rPos position to search at
@return pointer to field at the given position or NULL in case no field is found
*/
- static SwTxtFld* GetTxtFld(const SwPosition& rPos);
+ static SwTxtFld* GetTxtFldAtPos(const SwPosition& rPos);
/** IDocumentContentOperations
*/
@@ -881,12 +881,10 @@ public:
virtual void DeleteSection(SwNode* pNode);
virtual bool DeleteRange(SwPaM&);
virtual bool DelFullPara(SwPaM&);
- // --> OD 2009-08-20 #i100466#
// Add optional parameter <bForceJoinNext>, default value <false>
// Needed for hiding of deletion redlines
virtual bool DeleteAndJoin( SwPaM&,
const bool bForceJoinNext = false );
- // <--
virtual bool MoveRange(SwPaM&, SwPosition&, SwMoveFlags);
virtual bool MoveNodeRange(SwNodeRange&, SwNodeIndex&, SwMoveFlags);
virtual bool MoveAndJoin(SwPaM&, SwPosition&, SwMoveFlags);
@@ -900,11 +898,13 @@ public:
virtual SwDrawFrmFmt* Insert(const SwPaM &rRg, SdrObject& rDrawObj, const SfxItemSet* pFlyAttrSet, SwFrmFmt*);
virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj, const SfxItemSet* pFlyAttrSet,
const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
- //Modify here for #119405, by chengjh, 2012-08-16
- //Add a para for the char attribute exp...
- virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem&,
- const SetAttrMode nFlags,bool bExpandCharToPara=false);
- //End
+
+ virtual bool InsertPoolItem(
+ const SwPaM &rRg,
+ const SfxPoolItem&,
+ const SetAttrMode nFlags,
+ const bool bExpandCharToPara=false);
+
virtual bool InsertItemSet (const SwPaM &rRg, const SfxItemSet&,
const SetAttrMode nFlags);
virtual void ReRead(SwPaM&, const String& rGrfName, const String& rFltName, const Graphic* pGraphic, const GraphicObject* pGrfObj);
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 6c2a69c3..7f9d8c8 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -54,7 +54,7 @@ class SfxPoolItem;
class SfxItemSet;
class SvxAutoCorrect;
-class SwField; // fuer Felder
+class SwField;
class SwFieldType;
class SwDDEFieldType;
class SwNewDBMgr;
@@ -256,8 +256,8 @@ public:
sal_Bool GetCurAttr( SfxItemSet& ,
const bool bMergeIndentValuesOfNumRule = false ) const;
// <--
- void SetAttr( const SfxPoolItem&, sal_uInt16 nFlags = 0 );
- void SetAttr( const SfxItemSet&, sal_uInt16 nFlags = 0 );
+ void SetAttrItem( const SfxPoolItem&, sal_uInt16 nFlags = 0 );
+ void SetAttrSet( const SfxItemSet&, sal_uInt16 nFlags = 0 );
// Setze das Attribut als neues default Attribut im Dokument.
void SetDefault( const SfxPoolItem& );
@@ -332,7 +332,6 @@ public:
// Felder
void Insert2(SwField&, const bool bForceExpandHints = false);
- SwField* GetCurFld() const;
void UpdateFlds( SwField & ); // ein einzelnes Feld
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index f5e2f6e..784f0fb 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -312,20 +312,40 @@ public:
class SW_DLLPUBLIC SwInputField : public SwField
{
- String aContent;
- String aPText;
- String aHelp;
- String aToolTip;
- sal_uInt16 nSubType;
+ mutable String aContent;
+ String aPText;
+ String aHelp;
+ String aToolTip;
+ sal_uInt16 nSubType;
+ bool mbIsFormField;
+
+ SwFmtFld* mpFmtFld; // attribute to which the <SwInputField> belongs to
virtual String Expand() const;
virtual SwField* Copy() const;
+ // Accessing Input Field's content
+ const String& getContent() const;
+
public:
// Direkte Eingabe ueber Dialog alten Wert loeschen
- SwInputField(SwInputFieldType*, const String& rContent ,
- const String& rPrompt, sal_uInt16 nSubType = 0,
- sal_uLong nFmt = 0);
+ SwInputField(
+ SwInputFieldType* pFieldType,
+ const String& rContent,
+ const String& rPrompt,
+ sal_uInt16 nSubType = 0,
+ sal_uLong nFmt = 0,
+ bool bIsFormField = true );
+ virtual ~SwInputField();
+
+ void SetFmtFld( SwFmtFld& rFmtFld );
+ SwFmtFld* GetFmtFld();
+
+ // Providing new Input Field's content:
+ // Fill Input Field's content depending on <nSupType>.
+ void applyFieldContent( const String& rNewFieldContent );
+
+ bool isFormField() const;
virtual String GetFieldName() const;
@@ -343,9 +363,7 @@ public:
virtual String GetToolTip() const;
virtual void SetToolTip(const String & rStr);
- virtual sal_Bool isFormField() const;
-
- virtual sal_uInt16 GetSubType() const;
+ virtual sal_uInt16 GetSubType() const;
virtual void SetSubType(sal_uInt16 nSub);
virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index 886354e0..43d6d5b 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -308,6 +308,8 @@ class SW_DLLPUBLIC SwField
{
private:
mutable String m_Cache; /// #i85766# cached expansion (for clipboard)
+ bool m_bUseFieldValueCache; /// control the usage of the cached field value
+
sal_uInt16 nLang; // Immer ueber SetLanguage aendern!
sal_Bool bIsAutomaticLanguage;
sal_uInt32 nFormat;
@@ -320,7 +322,10 @@ private:
protected:
void SetFormat(sal_uInt32 nSet) {nFormat = nSet;}
- SwField(SwFieldType* pTyp, sal_uInt32 nFmt = 0, sal_uInt16 nLang = LANGUAGE_SYSTEM);
+ SwField( SwFieldType* pTyp,
+ sal_uInt32 nFmt = 0,
+ sal_uInt16 nLang = LANGUAGE_SYSTEM,
+ bool m_bUseFieldValueCache = true );
public:
virtual ~SwField();
diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx
index 3986517..0fe42bd 100644
--- a/sw/inc/fmtfld.hxx
+++ b/sw/inc/fmtfld.hxx
@@ -39,15 +39,13 @@ class SwFieldType;
// ATT_FLD ***********************************
class SW_DLLPUBLIC SwFmtFld : public SfxPoolItem, public SwClient, public SfxBroadcaster
{
- friend class SwTxtFld;
friend void _InitCore();
+ SwFmtFld( sal_uInt16 nWhich ); // for default-Attibute
- SwField *pField;
- SwTxtFld* pTxtAttr; // mein TextAttribut
+ SwField* mpField;
+ SwTxtFld* mpTxtFld; // the TextAttribute
- SwFmtFld(); // das default-Attibut
- // geschuetzter CopyCtor
// @@@ copy construction allowed, but copy assignment is not? @@@
SwFmtFld& operator=(const SwFmtFld& rFld);
@@ -74,11 +72,11 @@ public:
const SwField* GetField() const
{
- return pField;
+ return mpField;
}
SwField* GetField()
{
- return pField;
+ return mpField;
}
// #111840#
@@ -89,13 +87,23 @@ public:
@attention The current field will be destroyed before setting the new field.
*/
- void SetFld(SwField * pField);
+ void SetField( SwField * pField );
+
+
+ const SwTxtFld* GetTxtFld() const
+ {
+ return mpTxtFld;
+ }
+ SwTxtFld* GetTxtFld()
+ {
+ return mpTxtFld;
+ }
+ void SetTxtFld( SwTxtFld& rTxtFld );
+ void ClearTxtFld();
- const SwTxtFld *GetTxtFld() const { return pTxtAttr; }
- SwTxtFld *GetTxtFld() { return pTxtAttr; }
void RegisterToFieldType( SwFieldType& );
- sal_Bool IsFldInDoc() const;
+ bool IsFldInDoc() const;
sal_Bool IsProtect() const;
};
diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx
index 9708134..f5b4ce1 100644
--- a/sw/inc/hintids.hxx
+++ b/sw/inc/hintids.hxx
@@ -33,11 +33,15 @@
#define CH_TXTATR_INWORD ((sal_Unicode)0x02)
#define CH_TXTATR_TAB ((sal_Unicode)'\t')
#define CH_TXTATR_NEWLINE ((sal_Unicode)'\n')
-#define CH_TXT_ATR_FIELDSTART ((sal_Unicode)0x04)
-#define CH_TXT_ATR_FIELDEND ((sal_Unicode)0x05)
+#define CH_TXT_ATR_INPUTFIELDSTART ((sal_Unicode)0x04)
+#define CH_TXT_ATR_INPUTFIELDEND ((sal_Unicode)0x05)
+
+#define CH_TXT_ATR_FORMELEMENT ((sal_Unicode)0x06)
+
+#define CH_TXT_ATR_FIELDSTART ((sal_Unicode)0x07)
+#define CH_TXT_ATR_FIELDEND ((sal_Unicode)0x08)
#define CH_TXT_ATR_SUBST_FIELDSTART ("[")
#define CH_TXT_ATR_SUBST_FIELDEND ("]")
-#define CH_TXT_ATR_FORMELEMENT ((sal_Unicode)0x06)
/*
* Hier kommen erst mal die enums fuer die Hints
@@ -129,7 +133,7 @@ RES_TXTATR_WITHEND_BEGIN = RES_TXTATR_BEGIN ,
RES_TXTATR_CHARFMT, // 49
RES_TXTATR_CJK_RUBY, // 50
RES_TXTATR_UNKNOWN_CONTAINER, // 51
- RES_TXTATR_DUMMY5, // 52
+ RES_TXTATR_INPUTFIELD, // 52
RES_TXTATR_WITHEND_END,
// alle TextAttribute ohne ein Ende
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 393cd9a..4a60daa 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -52,7 +52,8 @@ namespace utl {
class SwTxtFmtColl;
class SwCntntFrm;
-class SwTxtFld; // Fuer GetTxtFld()
+class SwTxtFld;
+class SwTxtInputFld;
class SfxItemSet;
class SwUndoTransliterate;
@@ -92,9 +93,7 @@ class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable
//Also niemals direkt zugreifen!
SwpHints *m_pSwpHints;
- // --> OD 2005-11-02 #i51089 - TUNING#
mutable SwNodeNum* mpNodeNum; // Numerierung fuer diesen Absatz
- // <--
XubString m_Text;
SwParaIdleData_Impl* m_pParaIdleData_Impl;
@@ -111,20 +110,15 @@ class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable
bool m_bNotifiable;
// sal_uInt8 nOutlineLevel; //#outline level, removed by zhaojianwei.
- // --> OD 2008-11-19 #i70748#
+
bool mbEmptyListStyleSetDueToSetOutlineLevelAttr;
- // <--
- // --> OD 2008-03-27 #refactorlists#
// boolean, indicating that a <SetAttr(..)> or <ResetAttr(..)> or
// <ResetAllAttr(..)> method is running.
// Needed to avoid duplicate handling of attribute change actions.
bool mbInSetOrResetAttr;
- // <--
- // --> OD 2008-05-06 #refactorlists#
// 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;
@@ -184,9 +178,6 @@ class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable
/** create number for this text node, if not already existing
- OD 2005-11-02 #i51089 - TUNING#
- OD 2007-10-26 #i83479# - made private
-
@return number of this node
*/
SwNodeNum* CreateNum() const;
@@ -195,6 +186,8 @@ class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable
SW_DLLPRIVATE void impl_FmtToTxtAttr(const SfxItemSet& i_rAttrSet);
+ const SwTxtInputFld* GetOverlappingInputFld( const SwTxtAttr& rTxtAttr ) const;
+
public:
//Bug 120881:Modify here for Directly Page Numbering
bool HasPageNumberField();
@@ -211,9 +204,7 @@ public:
void SetAutoCompleteWordDirty( bool bNew ) const;
void SetWrong( SwWrongList* pNew, bool bDelete = true );
SwWrongList* GetWrong();
- // --> OD 2008-05-23 #i71360#
const SwWrongList* GetWrong() const;
- // <--
void SetGrammarCheck( SwGrammarMarkUp* pNew, bool bDelete = true );
SwGrammarMarkUp* GetGrammarCheck();
// SMARTTAGS
@@ -252,14 +243,12 @@ public:
void GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMax, sal_uLong &rAbs,
OutputDevice* pOut = 0 ) const;
- // --> OD 2008-03-13 #refactorlists#
// overriding to handle change of certain paragraph attributes
virtual sal_Bool SetAttr( const SfxPoolItem& );
virtual sal_Bool SetAttr( const SfxItemSet& rSet );
virtual sal_Bool ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 );
virtual sal_Bool ResetAttr( const SvUShorts& rWhichArr );
virtual sal_uInt16 ResetAllAttr();
- // <--
/// insert text content
void InsertText( const XubString & rStr, const SwIndex & rIdx,
@@ -285,7 +274,7 @@ public:
refmarks, toxmarks, and metas will be ignored unless this is true
ATTENTION: setting bInclRefToxMark is only allowed from UNDO!
*/
- void RstAttr(
+ void RstTxtAttr(
const SwIndex &rIdx,
const xub_StrLen nLen,
const sal_uInt16 nWhich = 0,
@@ -310,11 +299,13 @@ public:
// setze diese Attribute am TextNode. Wird der gesamte Bereich umspannt,
// dann setze sie nur im AutoAttrSet (SwCntntNode:: SetAttr)
- sal_Bool SetAttr( const SfxItemSet& rSet,
- xub_StrLen nStt, xub_StrLen nEnd,
- const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
+ sal_Bool SetAttr(
+ const SfxItemSet& rSet,
+ const xub_StrLen nStt,
+ const xub_StrLen nEnd,
+ const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
+
// erfrage die Attribute vom TextNode ueber den Bereich
- // --> OD 2008-01-16 #newlistlevelattrs#
// Introduce 4th optional parameter <bMergeIndentValuesOfNumRule>.
// If <bMergeIndentValuesOfNumRule> == sal_True, the indent attributes of
// the corresponding list level of an applied list style is merged into
@@ -337,7 +328,6 @@ public:
void DeleteAttribute ( SwTxtAttr * const pTxtAttr );
// Aktionen auf Text und Attributen
- // --> OD 2008-11-18 #i96213#
// introduce optional parameter to control, if all attributes have to be copied.
void CopyText( SwTxtNode * const pDest,
const SwIndex &rStart,
@@ -348,7 +338,6 @@ public:
const SwIndex &rStart,
xub_StrLen nLen,
const bool bForceCopyOfAllAttrs = false );
- // <--
void CutText(SwTxtNode * const pDest,
const SwIndex & rStart, const xub_StrLen nLen);
@@ -374,8 +363,8 @@ public:
sal_Bool bFmtToTxtAttributes = sal_True );
enum GetTxtAttrMode {
- DEFAULT, /// DEFAULT: (Start < nIndex <= End)
- EXPAND, /// EXPAND : (Start <= nIndex < End)
+ DEFAULT, /// DEFAULT: (Start <= nIndex < End)
+ EXPAND, /// EXPAND : (Start < nIndex <= End)
PARENT, /// PARENT : (Start < nIndex < End)
};
@@ -387,20 +376,19 @@ public:
hints of which several may cover a single position, like
RES_TXTATR_CHARFMT, RES_TXTATR_REFMARK, RES_TXTATR_TOXMARK
*/
- SwTxtAttr *GetTxtAttrAt(xub_StrLen const nIndex, RES_TXTATR const nWhich,
- enum GetTxtAttrMode const eMode = DEFAULT) const;
- //Bug 120881:Modify here for Directly Page Numbering
- SwTxtFld *GetTxtFld( xub_StrLen const rIdx )
- { return (SwTxtFld *)GetTxtAttrAt( rIdx, RES_TXTATR_FIELD ); }
- //Bug 120881(End)
+ SwTxtAttr *GetTxtAttrAt(
+ xub_StrLen const nIndex,
+ RES_TXTATR const nWhich,
+ enum GetTxtAttrMode const eMode = DEFAULT ) const;
/** get the innermost text attributes covering position nIndex.
@param nWhich only attributes with this id are returned.
@param eMode the predicate for matching (@see GetTxtAttrMode).
*/
- ::std::vector<SwTxtAttr *> GetTxtAttrsAt(xub_StrLen const nIndex,
- RES_TXTATR const nWhich,
- enum GetTxtAttrMode const eMode = DEFAULT) const;
+ ::std::vector<SwTxtAttr *> GetTxtAttrsAt(
+ xub_StrLen const nIndex,
+ RES_TXTATR const nWhich,
+ enum GetTxtAttrMode const eMode = DEFAULT ) const;
/** get the text attribute at position nIndex which owns
the dummy character CH_TXTATR_* at that position, if one exists.
@@ -409,8 +397,13 @@ public:
attribute with given which id
@return the text attribute at nIndex of type nWhich, if it exists
*/
- SwTxtAttr *GetTxtAttrForCharAt( const xub_StrLen nIndex,
- const RES_TXTATR nWhich = RES_TXTATR_END ) const;
+ SwTxtAttr *GetTxtAttrForCharAt(
+ const xub_StrLen nIndex,
+ const RES_TXTATR nWhich = RES_TXTATR_END ) const;
+
+ SwTxtFld* GetFldTxtAttrAt(
+ const xub_StrLen nIndex,
+ const bool bIncludeInputFldAtStart = false ) const;
// Aktuelles Wort zurueckliefern
XubString GetCurWord(xub_StrLen) const;
@@ -427,8 +420,6 @@ public:
// (Methode steht im ndcopy.cxx!!)
void CopyCollFmt( SwTxtNode& rDestNd );
- //const SwNodeNum* _GetNodeNum() const { return pNdNum; }
-
//
// BEGIN OF BULLET/NUMBERING/OUTLINE STUFF:
//
@@ -461,20 +452,6 @@ public:
void UpdateOutlineState();
- /** -> #i23730#
-
- Returns if this text node may be numbered.
-
- A text node may be numbered if
- - it has no SwNodeNum
- - it has a SwNodeNum and it has a numbering rule and the according
- SwNumFmt defines a numbering type that is an enumeration.
-
- @retval sal_True this text node may be numbered
- @retval sal_False else
- */
- //sal_Bool MayBeNumbered() const;
-
/**
Notify this textnode that its numbering rule has changed.
*/
@@ -482,7 +459,6 @@ public:
/** Returns outline of numbering string
- OD 2005-11-17 #128041#
Introduce parameter <_bInclPrefixAndSuffixStrings> in order to control,
if the prefix and the suffix strings have to been included or not.
@@ -518,9 +494,7 @@ public:
*/
sal_Bool GetFirstLineOfsWithNum( short& rFirstOffset ) const;
- // --> OD 2010-01-05 #b6884103#
SwTwips GetAdditionalIndentForStartingNewList() const;
- // <--
// --> OD 2008-12-02 #i96772#
void ClearLRSpaceItemDueToListLevelIndents( SvxLRSpaceItem& o_rLRSpaceItem ) const;
@@ -667,15 +641,12 @@ public:
*/
bool HasVisibleNumberingOrBullet() const;
- // --> OD 2008-02-19 #refactorlists#
void SetListId( const String sListId );
String GetListId() const;
- // <--
/** Determines, if the list level indent attributes can be applied to the
paragraph.
- OD 2008-01-17 #newlistlevelattrs#
The list level indents can be applied to the paragraph under the one
of following conditions:
- the list style is directly applied to the paragraph and the paragraph
@@ -694,8 +665,6 @@ public:
/** Retrieves the list tab stop position, if the paragraph's list level defines
one and this list tab stop has to merged into the tap stops of the paragraph
- OD 2008-01-17 #newlistlevelattrs#
-
@author OD
@param nListTabStopPosition
@@ -708,8 +677,6 @@ public:
/** Retrieves the character following the list label, if the paragraph's
list level defines one.
- OD 2008-01-17 #newlistlevelattrs#
-
@author OD
@return XubString - the list tab stop position
@@ -805,8 +772,11 @@ public:
TYPEINFO(); // fuer rtti
// override SwIndexReg
- virtual void Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
- const bool bNegative = false, const bool bDelete = false );
+ virtual void Update(
+ SwIndex const & rPos,
+ const xub_StrLen nChangeLen,
+ const bool bNegative = false,
+ const bool bDelete = false );
// change text to Upper/Lower/Hiragana/Katagana/...
void TransliterateText( utl::TransliterationWrapper& rTrans,
@@ -836,13 +806,9 @@ public:
void SetCountedInList( bool bCounted );
bool IsCountedInList() const;
- // --> OD 2008-03-13 #refactorlists#
-// void SyncNumberAndNumRule();
-// void UnregisterNumber();
void AddToList();
void RemoveFromList();
bool IsInList() const;
- // <--
bool IsFirstOfNumRule() const;
diff --git a/sw/inc/txatbase.hxx b/sw/inc/txatbase.hxx
index 1213fdf..1d7fd4b 100644
--- a/sw/inc/txatbase.hxx
+++ b/sw/inc/txatbase.hxx
@@ -60,6 +60,7 @@ private:
bool m_bDontExpandStart : 1; // don't expand start at paragraph start (ruby)
bool m_bNesting : 1; // SwTxtAttrNesting
bool m_bHasDummyChar : 1; // without end + meta
+ bool m_bHasContent : 1; // text attribute with content
protected:
SwTxtAttr( SfxPoolItem& rAttr, xub_StrLen nStart );
@@ -72,6 +73,7 @@ protected:
void SetDontExpandStartAttr(bool bFlag) { m_bDontExpandStart = bFlag; }
void SetNesting(const bool bFlag) { m_bNesting = bFlag; }
void SetHasDummyChar(const bool bFlag) { m_bHasDummyChar = bFlag; }
+ void SetHasContent( const bool bFlag ) { m_bHasContent = bFlag; }
public:
@@ -83,10 +85,10 @@ public:
const xub_StrLen* GetStart() const { return & m_nStart; }
/// end position
- virtual xub_StrLen* GetEnd();
- inline const xub_StrLen* GetEnd() const;
- /// end (if available), else start
- inline const xub_StrLen* GetAnyEnd() const;
+ virtual xub_StrLen* GetEnd(); // also used to change the end position
+ inline const xub_StrLen* End() const;
+ /// end (if available), else start
+ inline const xub_StrLen* GetAnyEnd() const;
inline void SetDontExpand( bool bDontExpand );
bool DontExpand() const { return m_bDontExpand; }
@@ -99,6 +101,7 @@ public:
bool IsDontExpandStartAttr() const { return m_bDontExpandStart; }
bool IsNesting() const { return m_bNesting; }
bool HasDummyChar() const { return m_bHasDummyChar; }
+ bool HasContent() const { return m_bHasContent; }
inline const SfxPoolItem& GetAttr() const;
inline SfxPoolItem& GetAttr();
@@ -127,21 +130,20 @@ protected:
public:
SwTxtAttrEnd( SfxPoolItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd );
- using SwTxtAttr::GetEnd;
virtual xub_StrLen* GetEnd();
};
// --------------- Inline Implementierungen ------------------------
-inline const xub_StrLen* SwTxtAttr::GetEnd() const
+inline const xub_StrLen* SwTxtAttr::End() const
{
return const_cast<SwTxtAttr * >(this)->GetEnd();
}
inline const xub_StrLen* SwTxtAttr::GetAnyEnd() const
{
- const xub_StrLen* pEnd = GetEnd();
+ const xub_StrLen* pEnd = End();
return pEnd ? pEnd : GetStart();
}
@@ -183,8 +185,10 @@ inline const SwFmtAutoFmt& SwTxtAttr::GetAutoFmt() const
inline const SwFmtFld& SwTxtAttr::GetFmtFld() const
{
- ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_FIELD,
- "Wrong attribute" );
+ ASSERT( m_pAttr
+ && ( m_pAttr->Which() == RES_TXTATR_FIELD
+ || m_pAttr->Which() == RES_TXTATR_INPUTFIELD ),
+ "Wrong attribute" );
return (const SwFmtFld&)(*m_pAttr);
}
diff --git a/sw/inc/txtfld.hxx b/sw/inc/txtfld.hxx
index 48c9707..83ca739 100644
--- a/sw/inc/txtfld.hxx
+++ b/sw/inc/txtfld.hxx
@@ -33,44 +33,69 @@ class SwTxtNode;
class SwTxtFld : public SwTxtAttr
{
- mutable String m_aExpand;
+ mutable String m_aExpand; // only used to determine, if field content is changing in <ExpandTxtFld()>
SwTxtNode * m_pTxtNode;
public:
- SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStart);
+ SwTxtFld(
+ SwFmtFld & rAttr,
+ xub_StrLen const nStart );
+
virtual ~SwTxtFld();
- void CopyFld( SwTxtFld *pDest ) const;
- void Expand() const;
- inline void ExpandAlways();
+ void CopyTxtFld( SwTxtFld *pDest ) const;
+
+ void ExpandTxtFld() const;
+ inline void ExpandAlways()
+ {
+ m_aExpand += ' '; // changing current value to assure that <ExpandTxtFld()> changes the value.
+ ExpandTxtFld();
+ }
// get and set TxtNode pointer
- SwTxtNode* GetpTxtNode() const { return m_pTxtNode; }
- inline SwTxtNode& GetTxtNode() const;
- void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
- // enable notification that field content has changed and needs reformatting
- void NotifyContentChange(SwFmtFld& rFmtFld);
+ inline SwTxtNode* GetpTxtNode() const
+ {
+ return m_pTxtNode;
+ }
+ inline SwTxtNode& GetTxtNode() const
+ {
+ ASSERT( m_pTxtNode, "SwTxtFld:: where is my TxtNode?" );
+ return *m_pTxtNode;
+ }
+ inline void ChgTxtNode( SwTxtNode* pNew )
+ {
+ m_pTxtNode = pNew;
+ }
- // #111840#
- /**
- Returns position of this field.
+ bool IsFldInDoc() const;
+
+ // enable notification that field content has changed and needs reformatting
+ virtual void NotifyContentChange( SwFmtFld& rFmtFld );
- @return position of this field. Has to be deleted explicitly.
- */
-// SwPosition * GetPosition() const;
};
-inline SwTxtNode& SwTxtFld::GetTxtNode() const
+class SwTxtInputFld : public SwTxtFld
{
- ASSERT( m_pTxtNode, "SwTxtFld:: where is my TxtNode?" );
- return *m_pTxtNode;
-}
+public:
+ SwTxtInputFld(
+ SwFmtFld & rAttr,
+ xub_StrLen const nStart,
+ xub_StrLen const nEnd );
-inline void SwTxtFld::ExpandAlways()
-{
- m_aExpand += ' ';
- Expand();
-}
+ virtual ~SwTxtInputFld();
+
+ virtual xub_StrLen* GetEnd();
+
+ virtual void NotifyContentChange( SwFmtFld& rFmtFld );
+
+ void UpdateTextNodeContent( const String& rNewContent );
+
+ const String GetFieldContent() const;
+ void UpdateFieldContent();
+
+private:
+ xub_StrLen m_nEnd;
+};
#endif
diff --git a/sw/inc/txtrfmrk.hxx b/sw/inc/txtrfmrk.hxx
index d9620ef..8ad7410 100644
--- a/sw/inc/txtrfmrk.hxx
+++ b/sw/inc/txtrfmrk.hxx
@@ -40,7 +40,6 @@ public:
xub_StrLen const nStart, xub_StrLen const*const pEnd = 0);
virtual xub_StrLen * GetEnd(); // SwTxtAttr
- inline const xub_StrLen * GetEnd() const { return m_pEnd; }
// get and set TxtNode pointer
inline const SwTxtNode& GetTxtNode() const;
diff --git a/sw/inc/txttxmrk.hxx b/sw/inc/txttxmrk.hxx
index 73c1416..1db53e9 100644
--- a/sw/inc/txttxmrk.hxx
+++ b/sw/inc/txttxmrk.hxx
@@ -42,7 +42,6 @@ public:
virtual ~SwTxtTOXMark();
virtual xub_StrLen *GetEnd(); // SwTxtAttr
- inline const xub_StrLen* GetEnd() const { return m_pEnd; }
void CopyTOXMark( SwDoc* pDestDoc );
diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx
index 3d52b90..352f48a 100644
--- a/sw/inc/viscrs.hxx
+++ b/sw/inc/viscrs.hxx
@@ -30,6 +30,7 @@
class SwCrsrShell;
class SwShellCrsr;
+class SwTxtInputFld;
// -------- Ab hier Klassen / Methoden fuer den nicht Text-Cursor ------
@@ -76,6 +77,7 @@ public:
// #i75172# predefines
namespace sdr { namespace overlay { class OverlayObject; }}
+namespace sw { namespace overlay { class OverlayRangesOutline; }}
class SwSelPaintRects : public SwRects
{
@@ -89,7 +91,6 @@ class SwSelPaintRects : public SwRects
const SwCrsrShell* pCShell;
virtual void Paint( const Rectangle& rRect );
- virtual void FillRects() = 0;
// #i75172#
sdr::overlay::OverlayObject* mpCursorOverlay;
@@ -98,10 +99,17 @@ class SwSelPaintRects : public SwRects
sdr::overlay::OverlayObject* getCursorOverlay() const { return mpCursorOverlay; }
void setCursorOverlay(sdr::overlay::OverlayObject* pNew) { mpCursorOverlay = pNew; }
+ bool mbShowTxtInputFldOverlay;
+ sw::overlay::OverlayRangesOutline* mpTxtInputFldOverlay;
+
+ void HighlightInputFld();
+
public:
SwSelPaintRects( const SwCrsrShell& rCSh );
virtual ~SwSelPaintRects();
+ virtual void FillRects() = 0;
+
// #i75172# in SwCrsrShell::CreateCrsr() the content of SwSelPaintRects is exchanged. To
// make a complete swap access to mpCursorOverlay is needed there
void swapContent(SwSelPaintRects& rSwap);
@@ -110,6 +118,11 @@ public:
void Hide();
void Invalidate( const SwRect& rRect );
+ inline void SetShowTxtInputFldOverlay( const bool bShow )
+ {
+ mbShowTxtInputFldOverlay = bShow;
+ }
+
const SwCrsrShell* GetShell() const { return pCShell; }
// check current MapMode of the shell and set possibly the static members.
// Optional set the parameters pX, pY
@@ -124,8 +137,6 @@ class SwShellCrsr : public virtual SwCursor, public SwSelPaintRects
Point aMkPt, aPtPt;
const SwPosition* pPt; // fuer Zuordung vom GetPoint() zum aPtPt
- virtual void FillRects(); // fuer Table- und normalen Crsr
-
using SwCursor::UpDown;
public:
@@ -135,6 +146,8 @@ public:
SwShellCrsr( SwShellCrsr& );
virtual ~SwShellCrsr();
+ virtual void FillRects(); // fuer Table- und normalen Crsr
+
void Show(); // Update und zeige alle Selektionen an
void Hide(); // verstecke alle Selektionen
void Invalidate( const SwRect& rRect );
@@ -182,7 +195,6 @@ class SwShellTableCrsr : public virtual SwShellCrsr, public virtual SwTableCurso
// TabellenBoxen. D.h., wird aus dem einen Array an einer Position
// etwas geloescht, dann muss es auch im anderen erfolgen!!
-
public:
SwShellTableCrsr( const SwCrsrShell& rCrsrSh, const SwPosition& rPos );
SwShellTableCrsr( const SwCrsrShell& rCrsrSh,
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index d7f02f4..15532fa 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -36,6 +36,7 @@ interface BaseText
FN_INSERT_GLOSSARY // status(final|play|record)
[
ExecMethod = ExecGlossary ;
+ StateMethod = GetState ;
]
FN_TXTATR_INET // status()
@@ -138,7 +139,7 @@ interface BaseText
SID_INSERTDOC // status(final|play|rec)
[
ExecMethod = Execute ;
- StateMethod = NoState ;
+ StateMethod = GetState ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
FN_INSERT_BOOKMARK // status(final|play)
@@ -242,13 +243,13 @@ interface BaseText
FN_INSERT_BREAK // status(final|play)
[
ExecMethod = ExecInsert ;
- StateMethod = NoState ;
+ StateMethod = GetState ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
FN_INSERT_PAGEBREAK // status(final|play)
[
ExecMethod = ExecInsert ;
- StateMethod = NoState ;
+ StateMethod = GetState ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
FN_INSERT_LINEBREAK // status(final|play)
@@ -260,19 +261,19 @@ interface BaseText
FN_INSERT_COLUMN_BREAK // status(final|play)
[
ExecMethod = ExecInsert ;
- StateMethod = NoState ;
+ StateMethod = GetState ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
FN_INSERT_BREAK_DLG // status(final|play)
[
ExecMethod = Execute ;
- StateMethod = NoState ;
+ StateMethod = GetState ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
SID_INSERT_AVMEDIA // status(final|play)
[
ExecMethod = ExecInsert;
- StateMethod = NoState ;
+ StateMethod = StateInsert ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
FN_INSERT_HRULER // status()
@@ -340,6 +341,7 @@ interface BaseText
FN_INSERT_HYPERLINK // status()
[
ExecMethod = Execute ;
+ StateMethod = GetState;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
SID_HYPERLINK_DIALOG
@@ -931,6 +933,7 @@ interface BaseText
FN_EXPAND_GLOSSARY // status(final|play)
[
ExecMethod = ExecGlossary ;
+ StateMethod = GetState ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
FN_POSTIT // status(final|play)
diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi
index f1f0dfd..945d531 100644
--- a/sw/sdi/_viewsh.sdi
+++ b/sw/sdi/_viewsh.sdi
@@ -641,12 +641,12 @@ interface BaseTextEditView
ExecMethod = Execute ;
StateMethod = GetState ;
]
- SID_INSERT_GRAPHIC // status(final|play)
- [
- ExecMethod = Execute ;
- StateMethod = NoState ;
- DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
- ]
+ SID_INSERT_GRAPHIC // status(final|play)
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState ;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
SID_AUTOSPELL_CHECK
[
ExecMethod = ExecViewOptions ;
diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx
index 18de520..64d6dab 100644
--- a/sw/source/core/access/accportions.cxx
+++ b/sw/source/core/access/accportions.cxx
@@ -326,6 +326,7 @@ sal_Bool SwAccessiblePortionData::IsGrayPortionType( sal_uInt16 nType ) const
case POR_NUMBER:
case POR_FLD:
case POR_URL:
+ case POR_INPUTFLD:
case POR_ISOTOX:
case POR_TOX:
case POR_HIDDEN:
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 6a5d2e4..31dedef 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -315,7 +315,7 @@ SfxItemInfo __FAR_DATA aSlotTab[] =
{ 0, 0 }, // RES_TXTATR_CHARFMT
{ SID_ATTR_CHAR_CJK_RUBY, 0 }, // RES_TXTATR_CJK_RUBY
{ 0, SFX_ITEM_POOLABLE }, // RES_TXTATR_UNKNOWN_CONTAINER
- { 0, SFX_ITEM_POOLABLE }, // RES_TXTATR_DUMMY5
+ { 0, 0 }, // RES_TXTATR_INPUTFIELD
{ 0, 0 }, // RES_TXTATR_FIELD
{ 0, 0 }, // RES_TXTATR_FLYCNT
@@ -528,8 +528,9 @@ void _InitCore()
aAttrTab[ RES_TXTATR_CHARFMT- POOLATTR_BEGIN ] = new SwFmtCharFmt( 0 );
aAttrTab[ RES_TXTATR_CJK_RUBY - POOLATTR_BEGIN ] = new SwFmtRuby( aEmptyStr );
aAttrTab[ RES_TXTATR_UNKNOWN_CONTAINER - POOLATTR_BEGIN ] = new SvXMLAttrContainerItem( RES_TXTATR_UNKNOWN_CONTAINER );
+ aAttrTab[ RES_TXTATR_INPUTFIELD - POOLATTR_BEGIN ] = new SwFmtFld( RES_TXTATR_INPUTFIELD );
- aAttrTab[ RES_TXTATR_FIELD- POOLATTR_BEGIN ] = new SwFmtFld;
+ aAttrTab[ RES_TXTATR_FIELD- POOLATTR_BEGIN ] = new SwFmtFld( RES_TXTATR_FIELD );
aAttrTab[ RES_TXTATR_FLYCNT - POOLATTR_BEGIN ] = new SwFmtFlyCnt( 0 );
aAttrTab[ RES_TXTATR_FTN - POOLATTR_BEGIN ] = new SwFmtFtn;
@@ -538,7 +539,6 @@ void _InitCore()
aAttrTab[ RES_TXTATR_DUMMY3 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_TXTATR_DUMMY3 );
aAttrTab[ RES_TXTATR_DUMMY1 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_TXTATR_DUMMY1 );
aAttrTab[ RES_TXTATR_DUMMY2 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_TXTATR_DUMMY2 );
- aAttrTab[ RES_TXTATR_DUMMY5 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_TXTATR_DUMMY5 );
// TextAttr - Dummies
aAttrTab[ RES_CHRATR_BIDIRTL - POOLATTR_BEGIN ] = new SfxInt16Item( RES_CHRATR_BIDIRTL, sal_Int16(-1) );
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 3223d41..b07fafb 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -138,7 +138,7 @@ SwCallLink::~SwCallLink()
for( n = 0; n < rHts.Count(); n++ )
{
const SwTxtAttr* pHt = rHts[ n ];
- pEnd = pHt->GetEnd();
+ pEnd = pHt->End();
nStart = *pHt->GetStart();
// nur Start oder Start und Ende gleich, dann immer
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index f502375..b6375c6 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -962,8 +962,10 @@ void SwCrsrShell::SwapPam()
// Ansonsten wird er auf die gewaehlte SSelection gesetzt.
-sal_Bool SwCrsrShell::ChgCurrPam( const Point & rPt,
- sal_Bool bTstOnly, sal_Bool bTstHit )
+sal_Bool SwCrsrShell::ChgCurrPam(
+ const Point & rPt,
+ sal_Bool bTstOnly,
+ sal_Bool bTstHit )
{
SET_CURR_SHELL( this );
@@ -1414,9 +1416,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
return; // wenn nicht, dann kein Update !!
}
- // --> OD 2005-12-14 #i27301#
SwNotifyAccAboutInvalidTextSelections aInvalidateTextSelections( *this );
- // <--
if ( bIgnoreReadonly )
{
@@ -2151,6 +2151,7 @@ void SwCrsrShell::ShowCrsr()
if( !bBasicHideCrsr )
{
bSVCrsrVis = sal_True;
+ pCurCrsr->SetShowTxtInputFldOverlay( true );
UpdateCrsr();
}
}
@@ -2163,6 +2164,7 @@ void SwCrsrShell::HideCrsr()
bSVCrsrVis = sal_False;
// evt. die sel. Bereiche aufheben !!
SET_CURR_SHELL( this );
+ pCurCrsr->SetShowTxtInputFldOverlay( false );
pVisCrsr->Hide();
}
}
@@ -3004,38 +3006,34 @@ sal_Bool SwCrsrShell::FindValidCntntNode( sal_Bool bOnlyText )
}
-void SwCrsrShell::NewCoreSelection()
-{
-}
-
-
sal_Bool SwCrsrShell::IsCrsrReadonly() const
{
if ( GetViewOptions()->IsReadonly() ||
- // --> FME 2004-06-29 #114856# Formular view
- GetViewOptions()->IsFormView() )
- // <--
+ GetViewOptions()->IsFormView() ) // Formular view
{
SwFrm *pFrm = GetCurrFrm( sal_False );
const SwFlyFrm* pFly;
const SwSection* pSection;
if( pFrm && pFrm->IsInFly() &&
- (pFly = pFrm->FindFlyFrm())->GetFmt()->GetEditInReadonly().GetValue() &&
- pFly->Lower() &&
- !pFly->Lower()->IsNoTxtFrm() &&
- !GetDrawView()->GetMarkedObjectList().GetMarkCount() )
+ (pFly = pFrm->FindFlyFrm())->GetFmt()->GetEditInReadonly().GetValue() &&
+ pFly->Lower() &&
+ !pFly->Lower()->IsNoTxtFrm() &&
+ !GetDrawView()->GetMarkedObjectList().GetMarkCount() )
{
return sal_False;
}
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // edit in readonly sections
else if ( pFrm && pFrm->IsInSct() &&
- 0 != ( pSection = pFrm->FindSctFrm()->GetSection() ) &&
- pSection->IsEditInReadonlyFlag() )
+ 0 != ( pSection = pFrm->FindSctFrm()->GetSection() ) &&
+ pSection->IsEditInReadonlyFlag() )
+ {
+ return sal_False;
+ }
+ else if ( !IsMultiSelection() && CrsrInsideInputFld() )
{
return sal_False;
}
- // <--
return sal_True;
}
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 6c32e55..fbbde30 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -40,7 +40,7 @@
#include <pam.hxx>
#include <ndtxt.hxx>
#include <fldbas.hxx>
-#include <swtable.hxx> // SwTxtFld
+#include <swtable.hxx>
#include <docary.hxx>
#include <txtfld.hxx>
#include <fmtfld.hxx>
@@ -56,7 +56,7 @@
#include <docfld.hxx>
#include <expfld.hxx>
#include <reffld.hxx>
-#include <flddat.hxx> // SwTxtFld
+#include <flddat.hxx>
#include <cellatr.hxx>
#include <swundo.hxx>
#include <redline.hxx>
@@ -618,73 +618,84 @@ const SwTOXMark& SwCrsrShell::GotoTOXMark( const SwTOXMark& rStart,
// springe zum naechsten / vorherigen FeldTypen
-void lcl_MakeFldLst( _SetGetExpFlds& rLst, const SwFieldType& rFldType,
- sal_uInt16 nSubType, sal_Bool bInReadOnly,
- sal_Bool bChkInpFlag = sal_False )
+void lcl_MakeFldLst(
+ _SetGetExpFlds& rLst,
+ const SwFieldType& rFldType,
+ const bool bInReadOnly,
+ const bool bChkInpFlag = false )
{
// es muss immer der 1. Frame gesucht werden
Point aPt;
- SwTxtFld* pTxtFld;
+ SwTxtFld* pTxtFld = NULL;
SwIterator<SwFmtFld,SwFieldType> aIter(rFldType);
- bool bSubType = nSubType != USHRT_MAX;
for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
- if( 0 != ( pTxtFld = pFmtFld->GetTxtFld() ) &&
- ( !bChkInpFlag || ((SwSetExpField*)pTxtFld->GetFmtFld().GetField())
- ->GetInputFlag() ) &&
- (!bSubType || (pFmtFld->GetField()->GetSubType()
- & 0xff ) == nSubType ))
+ {
+ pTxtFld = pFmtFld->GetTxtFld();
+ if ( pTxtFld != NULL
+ && ( !bChkInpFlag
+ || ((SwSetExpField*)pTxtFld->GetFmtFld().GetField())->GetInputFlag() ) )
{
- SwCntntFrm* pCFrm;
const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode();
- if( 0 != ( pCFrm = rTxtNode.getLayoutFrm( rTxtNode.GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False )) &&
- ( bInReadOnly || !pCFrm->IsProtected() ))
+ const SwCntntFrm* pCFrm =
+ rTxtNode.getLayoutFrm( rTxtNode.GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False );
+ if ( pCFrm != NULL
+ && ( bInReadOnly || !pCFrm->IsProtected() ) )
{
- _SetGetExpFld* pNew = new _SetGetExpFld(
- SwNodeIndex( rTxtNode ), pTxtFld );
+ _SetGetExpFld* pNew = new _SetGetExpFld( SwNodeIndex( rTxtNode ), pTxtFld );
pNew->SetBodyPos( *pCFrm );
rLst.Insert( pNew );
}
}
+ }
}
-sal_Bool SwCrsrShell::MoveFldType( const SwFieldType* pFldType, sal_Bool bNext,
- sal_uInt16 nSubType, sal_uInt16 nResType )
+sal_Bool SwCrsrShell::MoveFldType(
+ const SwFieldType* pFldType,
+ const bool bNext,
+ const sal_uInt16 nResType,
+ const bool bAddSetExpressionFldsToInputFlds )
{
// sortierte Liste aller Felder
_SetGetExpFlds aSrtLst( 64 );
- if (pFldType)
+ if ( pFldType )
{
if( RES_INPUTFLD != pFldType->Which() && !pFldType->GetDepends() )
+ {
return sal_False;
+ }
// Modify-Object gefunden, trage alle Felder ins Array ein
- ::lcl_MakeFldLst( aSrtLst, *pFldType, nSubType, IsReadOnlyAvailable() );
+ ::lcl_MakeFldLst( aSrtLst, *pFldType, ( IsReadOnlyAvailable() ? true : false ) );
- if( RES_INPUTFLD == pFldType->Which() )
+ if( RES_INPUTFLD == pFldType->Which() && bAddSetExpressionFldsToInputFlds )
{
// es gibt noch versteckte InputFelder in den SetExp. Feldern
const SwFldTypes& rFldTypes = *pDoc->GetFldTypes();
const sal_uInt16 nSize = rFldTypes.Count();
-
- // Alle Typen abklappern
for( sal_uInt16 i=0; i < nSize; ++i )
- if( RES_SETEXPFLD == ( pFldType = rFldTypes[ i ] )->Which() )
- ::lcl_MakeFldLst( aSrtLst, *pFldType, nSubType,
- IsReadOnlyAvailable(), sal_True );
+ {
+ pFldType = rFldTypes[ i ];
+ if ( RES_SETEXPFLD == pFldType->Which() )
+ {
+ ::lcl_MakeFldLst( aSrtLst, *pFldType, ( IsReadOnlyAvailable() ? true : false ), true );
+ }
+ }
}
}
else
{
const SwFldTypes& rFldTypes = *pDoc->GetFldTypes();
const sal_uInt16 nSize = rFldTypes.Count();
-
- // Alle Typen abklappern
for( sal_uInt16 i=0; i < nSize; ++i )
- if( nResType == ( pFldType = rFldTypes[ i ] )->Which() )
- ::lcl_MakeFldLst( aSrtLst, *pFldType, nSubType,
- IsReadOnlyAvailable() );
+ {
+ pFldType = rFldTypes[ i ];
+ if( nResType == pFldType->Which() )
+ {
+ ::lcl_MakeFldLst( aSrtLst, *pFldType, ( IsReadOnlyAvailable() ? true : false ) );
+ }
+ }
}
// keine Felder gefunden?
@@ -703,12 +714,11 @@ sal_Bool SwCrsrShell::MoveFldType( const SwFieldType* pFldType, sal_Bool bNext,
SwTxtNode* pTNd = rPos.nNode.GetNode().GetTxtNode();
ASSERT( pTNd, "Wo ist mein CntntNode?" );
- SwTxtFld * pTxtFld = static_cast<SwTxtFld *>(
- pTNd->GetTxtAttrForCharAt(rPos.nContent.GetIndex(),
- RES_TXTATR_FIELD));
- sal_Bool bDelFld = 0 == pTxtFld;
+ SwTxtFld * pTxtFld = pTNd->GetFldTxtAttrAt( rPos.nContent.GetIndex(), true );
+ const bool bDelFld = ( pTxtFld == NULL );
if( bDelFld )
{
+ // create dummy for the search
SwFmtFld* pFmtFld = new SwFmtFld( SwDateTimeField(
(SwDateTimeFieldType*)pDoc->GetSysFldType( RES_DATETIMEFLD ) ) );
@@ -716,7 +726,12 @@ sal_Bool SwCrsrShell::MoveFldType( const SwFieldType* pFldType, sal_Bool bNext,
pTxtFld->ChgTxtNode( pTNd );
}
- _SetGetExpFld aSrch( rPos.nNode, pTxtFld, &rPos.nContent );
+ SwIndex aSearchIdx( rPos.nContent );
+ if ( !bDelFld && pTxtFld->HasContent() )
+ {
+ aSearchIdx = *(pTxtFld->GetStart());
+ }
+ _SetGetExpFld aSrch( rPos.nNode, pTxtFld, &aSearchIdx );
if( rPos.nNode.GetIndex() < pDoc->GetNodes().GetEndOfExtras().GetIndex() )
{
// auch beim Einsammeln wird nur der erste Frame benutzt!
@@ -742,7 +757,9 @@ sal_Bool SwCrsrShell::MoveFldType( const SwFieldType* pFldType, sal_Bool bNext,
return sal_False; // weiter nach vorne geht nicht
}
else if( bNext ? nPos >= aSrtLst.Count() : !nPos--)
+ {
return sal_False;
+ }
}
const _SetGetExpFld& rFnd = **( aSrtLst.GetData() + nPos );
@@ -783,6 +800,128 @@ sal_Bool SwCrsrShell::GotoFld( const SwFmtFld& rFld )
}
+SwTxtFld * SwCrsrShell::GetTxtFldAtPos(
+ const SwPosition* pPos,
+ const bool bIncludeInputFldAtStart ) const
+{
+ SwTxtFld* pTxtFld = NULL;
+
+ SwTxtNode * const pNode = pPos->nNode.GetNode().GetTxtNode();
+ if ( pNode != NULL )
+ {
+ pTxtFld = pNode->GetFldTxtAttrAt( pPos->nContent.GetIndex(), bIncludeInputFldAtStart );
+ }
+
+ return pTxtFld;
+}
+
+
+SwField* SwCrsrShell::GetFieldAtCrsr(
+ const SwPaM* pCrsr,
+ const bool bIncludeInputFldAtStart ) const
+{
+ SwField* pFieldAtCrsr = NULL;
+
+ SwTxtFld* pTxtFld = GetTxtFldAtPos( pCrsr->Start(), bIncludeInputFldAtStart );
+ if ( pTxtFld != NULL
+ && pCrsr->Start()->nNode == pCrsr->End()->nNode )
+ {
+ const xub_StrLen nTxtFldLength =
+ pTxtFld->End() != NULL
+ ? *(pTxtFld->End()) - *(pTxtFld->GetStart())
+ : 1;
+ if ( ( pCrsr->End()->nContent.GetIndex() - pCrsr->Start()->nContent.GetIndex() ) <= nTxtFldLength )
+ {
+ pFieldAtCrsr = (SwField*)pTxtFld->GetFmtFld().GetField();
+ }
+ }
+
+ return pFieldAtCrsr;
+}
+
+
+SwField* SwCrsrShell::GetCurFld( const bool bIncludeInputFldAtStart ) const
+{
+ SwPaM* pCrsr = GetCrsr();
+ if ( pCrsr->GetNext() != pCrsr )
+ {
+ // multi selection not handled.
+ return NULL;
+ }
+
+ SwField* pCurFld = GetFieldAtCrsr( pCrsr, bIncludeInputFldAtStart );;
+ if ( pCurFld != NULL
+ && RES_TABLEFLD == pCurFld->GetTyp()->Which() )
+ {
+ // TabellenFormel ? wandel internen in externen Namen um
+ const SwTableNode* pTblNd = IsCrsrInTbl();
+ ((SwTblField*)pCurFld)->PtrToBoxNm( pTblNd ? &pTblNd->GetTable() : 0 );
+ }
+
+ return pCurFld;
+}
+
+
+bool SwCrsrShell::CrsrInsideInputFld() const
+{
+ bool bCrsrInsideInputFld = false;
+
+ const SwPaM* pCrsr = GetCrsr();
+ const SwPaM* pFirst = pCrsr;
+ do
+ {
+ bCrsrInsideInputFld = dynamic_cast<const SwInputField*>(GetFieldAtCrsr( pCrsr, false )) != NULL;
+
+ pCrsr = static_cast<SwPaM*>(pCrsr->GetNext());
+ } while ( !bCrsrInsideInputFld
+ && pCrsr != pFirst );
+
+ return bCrsrInsideInputFld;
+}
+
+
+bool SwCrsrShell::PosInsideInputFld( const SwPosition& rPos ) const
+{
+ return dynamic_cast<const SwTxtInputFld*>(GetTxtFldAtPos( &rPos, false )) != NULL;
+}
+
+
+bool SwCrsrShell::DocPtInsideInputFld( const Point& rDocPt ) const
+{
+ SwPosition aPos( *(GetCrsr()->Start()) );
+ Point aDocPt( rDocPt );
+ if ( GetLayout()->GetCrsrOfst( &aPos, aDocPt ) )
+ {
+ return PosInsideInputFld( aPos );
+ }
+ return false;
+}
+
+
+xub_StrLen SwCrsrShell::StartOfInputFldAtPos( const SwPosition& rPos ) const
+{
+ const SwTxtInputFld* pTxtInputFld = dynamic_cast<const SwTxtInputFld*>(GetTxtFldAtPos( &rPos, true ));
+ if ( pTxtInputFld == NULL )
+ {
+ ASSERT( false, "<SwEditShell::StartOfInputFldAtPos(..)> - no Input Field at given position" );
+ return 0;
+ }
+ return *(pTxtInputFld->GetStart());
+}
+
+
+xub_StrLen SwCrsrShell::EndOfInputFldAtPos( const SwPosition& rPos ) const
+{
+ const SwTxtInputFld* pTxtInputFld = dynamic_cast<const SwTxtInputFld*>(GetTxtFldAtPos( &rPos, true ));
+ if ( pTxtInputFld == NULL )
+ {
+ ASSERT( false, "<SwEditShell::EndOfInputFldAtPos(..)> - no Input Field at given position" );
+ return 0;
+ }
+ return *(pTxtInputFld->End());
+}
+
+
void SwCrsrShell::GotoOutline( sal_uInt16 nIdx )
{
SwCursor* pCrsr = getShellCrsr( true );
@@ -1028,7 +1167,8 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
pTxtNd = aPos.nNode.GetNode().GetTxtNode();
const SwNodes& rNds = GetDoc()->GetNodes();
- if( pTxtNd && SwContentAtPos::SW_OUTLINE & rCntntAtPos.eCntntAtPos
+ if( pTxtNd
+ && SwContentAtPos::SW_OUTLINE & rCntntAtPos.eCntntAtPos
&& rNds.GetOutLineNds().Count() )
{
const SwTxtNode* pONd = pTxtNd->FindOutlineNodeOfLevel( MAXLEVEL-1);
@@ -1039,16 +1179,13 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
bRet = sal_True;
}
}
- // --> FME 2005-05-13 #i43742# New function: SW_CONTENT_CHECK
- else if ( SwContentAtPos::SW_CONTENT_CHECK & rCntntAtPos.eCntntAtPos &&
- bCrsrFoundExact )
+ else if ( SwContentAtPos::SW_CONTENT_CHECK & rCntntAtPos.eCntntAtPos
+ && bCrsrFoundExact )
{
bRet = sal_True;
}
- // <--
- // #i23726#
- else if( pTxtNd &&
- SwContentAtPos::SW_NUMLABEL & rCntntAtPos.eCntntAtPos)
+ else if( pTxtNd
+ && SwContentAtPos::SW_NUMLABEL & rCntntAtPos.eCntntAtPos)
{
bRet = aTmpState.bInNumPortion;
rCntntAtPos.aFnd.pNode = pTxtNd;
@@ -1061,8 +1198,9 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
{
if( !aTmpState.bPosCorr )
{
- if( !bRet && SwContentAtPos::SW_SMARTTAG & rCntntAtPos.eCntntAtPos
- && !aTmpState.bFtnNoInfo )
+ if ( !bRet
+ && SwContentAtPos::SW_SMARTTAG & rCntntAtPos.eCntntAtPos
+ && !aTmpState.bFtnNoInfo )
{
const SwWrongList* pSmartTagList = pTxtNd->GetSmartTags();
xub_StrLen nCurrent = aPos.nContent.GetIndex();
@@ -1089,22 +1227,14 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
pCurCrsr->DeleteMark();
*pCurCrsr->GetPoint() = aPos;
- if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
- nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
+ if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION | nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
bRet = sal_False;
else
UpdateCrsr();
}
if( bRet )
{
-// rCntntAtPos.sStr = pTxtNd->GetExpandTxt(
-// *pTxtAttr->GetStart(),
-// *pTxtAttr->GetEnd() - *pTxtAttr->GetStart(),
-// sal_False );
-
-// rCntntAtPos.aFnd.pAttr = &pTxtAttr->GetAttr();
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_SMARTTAG;
-// rCntntAtPos.pFndTxtAttr = pTxtAttr;
if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
@@ -1112,19 +1242,21 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
}
}
- if( !bRet && ( SwContentAtPos::SW_FIELD | SwContentAtPos::SW_CLICKFIELD )
- & rCntntAtPos.eCntntAtPos && !aTmpState.bFtnNoInfo )
+ if ( !bRet
+ && ( SwContentAtPos::SW_FIELD | SwContentAtPos::SW_CLICKFIELD ) & rCntntAtPos.eCntntAtPos
+ && !aTmpState.bFtnNoInfo )
{
- pTxtAttr = pTxtNd->GetTxtAttrForCharAt(
- aPos.nContent.GetIndex(), RES_TXTATR_FIELD );
- const SwField* pFld = pTxtAttr
- ? pTxtAttr->GetFmtFld().GetField()
- : 0;
- if( SwContentAtPos::SW_CLICKFIELD & rCntntAtPos.eCntntAtPos &&
- pFld && !pFld->HasClickHdl() )
+ pTxtAttr = pTxtNd->GetFldTxtAttrAt( aPos.nContent.GetIndex() );
+ const SwField* pFld = pTxtAttr != NULL
+ ? pTxtAttr->GetFmtFld().GetField()
+ : 0;
+ if ( SwContentAtPos::SW_CLICKFIELD & rCntntAtPos.eCntntAtPos
+ && pFld && !pFld->HasClickHdl() )
+ {
pFld = 0;
+ }
- if( pFld )
+ if ( pFld )
{
if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
@@ -1140,14 +1272,14 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
// Click-Felder in geschuetzten Bereichen zulassen
// Nur Platzhalter geht nicht!
if( SwContentAtPos::SW_FIELD & rCntntAtPos.eCntntAtPos
- || RES_JUMPEDITFLD == pFld->Which() )
+ || RES_JUMPEDITFLD == pFld->Which() )
pFld = 0;
}
else
UpdateCrsr();
}
else if( RES_TABLEFLD == pFld->Which() &&
- ((SwTblField*)pFld)->IsIntrnlName() )
+ ((SwTblField*)pFld)->IsIntrnlName() )
{
// erzeuge aus der internen (fuer CORE)
// die externe (fuer UI) Formel
@@ -1166,16 +1298,16 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
}
}
- if( !bRet && SwContentAtPos::SW_FORMCTRL & rCntntAtPos.eCntntAtPos )
- {
- IDocumentMarkAccess* pMarksAccess = GetDoc()->getIDocumentMarkAccess( );
- sw::mark::IFieldmark* pFldBookmark = pMarksAccess->getFieldmarkFor( aPos );
- if( bCrsrFoundExact && pTxtNd && pFldBookmark) {
- rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FORMCTRL;
- rCntntAtPos.aFnd.pFldmark = pFldBookmark;
- bRet=sal_True;
- }
- }
+ if( !bRet && SwContentAtPos::SW_FORMCTRL & rCntntAtPos.eCntntAtPos )
+ {
+ IDocumentMarkAccess* pMarksAccess = GetDoc()->getIDocumentMarkAccess( );
+ sw::mark::IFieldmark* pFldBookmark = pMarksAccess->getFieldmarkFor( aPos );
+ if( bCrsrFoundExact && pTxtNd && pFldBookmark) {
+ rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FORMCTRL;
+ rCntntAtPos.aFnd.pFldmark = pFldBookmark;
+ bRet=sal_True;
+ }
+ }
if( !bRet && SwContentAtPos::SW_FTN & rCntntAtPos.eCntntAtPos )
{
@@ -1193,7 +1325,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FTN;
}
else if ( 0 != ( pTxtAttr = pTxtNd->GetTxtAttrForCharAt(
- aPos.nContent.GetIndex(), RES_TXTATR_FTN )) )
+ aPos.nContent.GetIndex(), RES_TXTATR_FTN )) )
{
bRet = sal_True;
if( bSetCrsr )
@@ -1202,14 +1334,14 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
SwCrsrSaveState aSaveState( *pCurCrsr );
pCurCrsr->GetPoint()->nNode = *((SwTxtFtn*)pTxtAttr)->GetStartNode();
SwCntntNode* pCNd = GetDoc()->GetNodes().GoNextSection(
- &pCurCrsr->GetPoint()->nNode,
- sal_True, !IsReadOnlyAvailable() );
+ &pCurCrsr->GetPoint()->nNode,
+ sal_True, !IsReadOnlyAvailable() );
if( pCNd )
{
pCurCrsr->GetPoint()->nContent.Assign( pCNd, 0 );
if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
- nsSwCursorSelOverFlags::SELOVER_TOGGLE ))
+ nsSwCursorSelOverFlags::SELOVER_TOGGLE ))
bRet = sal_False;
else
UpdateCrsr();
@@ -1230,9 +1362,9 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
}
}
- if( !bRet && ( SwContentAtPos::SW_TOXMARK |
- SwContentAtPos::SW_REFMARK ) &
- rCntntAtPos.eCntntAtPos && !aTmpState.bFtnNoInfo )
+ if( !bRet
+ && ( SwContentAtPos::SW_TOXMARK | SwContentAtPos::SW_REFMARK ) & rCntntAtPos.eCntntAtPos
+ && !aTmpState.bFtnNoInfo )
{
pTxtAttr = 0;
if( SwContentAtPos::SW_TOXMARK & rCntntAtPos.eCntntAtPos )
@@ -1267,8 +1399,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
SwCrsrSaveState aSaveState( *pCurCrsr );
pCurCrsr->DeleteMark();
*pCurCrsr->GetPoint() = aPos;
- if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
- nsSwCursorSelOverFlags::SELOVER_TOGGLE ) )
+ if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION | nsSwCursorSelOverFlags::SELOVER_TOGGLE ) )
bRet = sal_False;
else
UpdateCrsr();
@@ -1276,19 +1407,18 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
if( bRet )
{
- const xub_StrLen* pEnd = pTxtAttr->GetEnd();
+ const xub_StrLen* pEnd = pTxtAttr->End();
if( pEnd )
- rCntntAtPos.sStr = pTxtNd->GetExpandTxt(
- *pTxtAttr->GetStart(),
- *pEnd - *pTxtAttr->GetStart() );
+ rCntntAtPos.sStr =
+ pTxtNd->GetExpandTxt( *pTxtAttr->GetStart(), *pEnd - *pTxtAttr->GetStart() );
else if( RES_TXTATR_TOXMARK == pTxtAttr->Which())
- rCntntAtPos.sStr = pTxtAttr->GetTOXMark().
- GetAlternativeText();
+ rCntntAtPos.sStr =
+ pTxtAttr->GetTOXMark().GetAlternativeText();
rCntntAtPos.eCntntAtPos =
RES_TXTATR_TOXMARK == pTxtAttr->Which()
- ? SwContentAtPos::SW_TOXMARK
- : SwContentAtPos::SW_REFMARK;
+ ? SwContentAtPos::SW_TOXMARK
+ : SwContentAtPos::SW_REFMARK;
rCntntAtPos.pFndTxtAttr = pTxtAttr;
rCntntAtPos.aFnd.pAttr = &pTxtAttr->GetAttr();
@@ -1298,8 +1428,9 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
}
}
- if( !bRet && SwContentAtPos::SW_INETATTR & rCntntAtPos.eCntntAtPos
- && !aTmpState.bFtnNoInfo )
+ if ( !bRet
+ && SwContentAtPos::SW_INETATTR & rCntntAtPos.eCntntAtPos
+ && !aTmpState.bFtnNoInfo )
{
pTxtAttr = pTxtNd->GetTxtAttrAt(
aPos.nContent.GetIndex(), RES_TXTATR_INETFMT);
@@ -1314,7 +1445,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
pCurCrsr->DeleteMark();
*pCurCrsr->GetPoint() = aPos;
if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
- nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
+ nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
bRet = sal_False;
else
UpdateCrsr();
@@ -1322,8 +1453,8 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
if( bRet )
{
rCntntAtPos.sStr = pTxtNd->GetExpandTxt(
- *pTxtAttr->GetStart(),
- *pTxtAttr->GetEnd() - *pTxtAttr->GetStart() );
+ *pTxtAttr->GetStart(),
+ *pTxtAttr->GetEnd() - *pTxtAttr->GetStart() );
rCntntAtPos.aFnd.pAttr = &pTxtAttr->GetAttr();
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_INETATTR;
@@ -1351,12 +1482,12 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
}
}
- if( !bRet && (
- SwContentAtPos::SW_TABLEBOXFML & rCntntAtPos.eCntntAtPos
+ if( !bRet
+ && ( SwContentAtPos::SW_TABLEBOXFML & rCntntAtPos.eCntntAtPos
#ifdef DBG_UTIL
- || SwContentAtPos::SW_TABLEBOXVALUE & rCntntAtPos.eCntntAtPos
+ || SwContentAtPos::SW_TABLEBOXVALUE & rCntntAtPos.eCntntAtPos
#endif
- ))
+ ) )
{
const SwTableNode* pTblNd;
const SwTableBox* pBox;
@@ -1364,15 +1495,15 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
const SfxPoolItem* pItem;
if( pSttNd && 0 != ( pTblNd = pTxtNd->FindTableNode()) &&
0 != ( pBox = pTblNd->GetTable().GetTblBox(
- pSttNd->GetIndex() )) &&
+ pSttNd->GetIndex() )) &&
#ifdef DBG_UTIL
( SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
- RES_BOXATR_FORMULA, sal_False, &pItem ) ||
- SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
- RES_BOXATR_VALUE, sal_False, &pItem ))
+ RES_BOXATR_FORMULA, sal_False, &pItem ) ||
+ SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
+ RES_BOXATR_VALUE, sal_False, &pItem ))
#else
SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
- RES_BOXATR_FORMULA, sal_False, &pItem )
+ RES_BOXATR_FORMULA, sal_False, &pItem )
#endif
)
{
@@ -1404,7 +1535,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_TABLEBOXVALUE;
else
#endif
- ((SwTblBoxFormula*)pItem)->PtrToBoxNm( &pTblNd->GetTable() );
+ ((SwTblBoxFormula*)pItem)->PtrToBoxNm( &pTblNd->GetTable() );
bRet = sal_True;
if( bSetCrsr )
@@ -1413,7 +1544,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
SwCrsrSaveState aSaveState( *pCurCrsr );
*pCurCrsr->GetPoint() = aPos;
if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
- nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
+ nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
bRet = sal_False;
else
UpdateCrsr();
@@ -1438,7 +1569,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
{
xub_StrLen n = aPos.nContent.GetIndex();
SfxItemSet aSet( GetDoc()->GetAttrPool(), POOLATTR_BEGIN,
- POOLATTR_END - 1 );
+ POOLATTR_END - 1 );
if( pTxtNd->GetpSwpHints() )
{
for( sal_uInt16 i = 0; i < pTxtNd->GetSwpHints().Count(); ++i )
@@ -1448,12 +1579,12 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
if( nAttrStart > n ) // ueber den Bereich hinaus
break;
- if( 0 != pHt->GetEnd() && (
+ if( 0 != pHt->End() && (
( nAttrStart < n &&
- ( pHt->DontExpand() ? n < *pHt->GetEnd()
- : n <= *pHt->GetEnd() )) ||
+ ( pHt->DontExpand() ? n < *pHt->End()
+ : n <= *pHt->End() )) ||
( n == nAttrStart &&
- ( nAttrStart == *pHt->GetEnd() || !n ))) )
+ ( nAttrStart == *pHt->End() || !n ))) )
{
aSet.Put( pHt->GetAttr() );
}
@@ -1472,18 +1603,18 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
pTxtNd->SwCntntNode::GetAttr( aSet );
rCntntAtPos.sStr.AssignAscii(
- RTL_CONSTASCII_STRINGPARAM( "Pos: (" ));
+ RTL_CONSTASCII_STRINGPARAM( "Pos: (" ));
rCntntAtPos.sStr += String::CreateFromInt32( aPos.nNode.GetIndex());
rCntntAtPos.sStr += ':';
rCntntAtPos.sStr += String::CreateFromInt32( aPos.nContent.GetIndex());
rCntntAtPos.sStr += ')';
rCntntAtPos.sStr.AppendAscii(
- RTL_CONSTASCII_STRINGPARAM( "\nAbs.Vorl.: " ));
+ RTL_CONSTASCII_STRINGPARAM( "\nAbs.Vorl.: " ));
rCntntAtPos.sStr += pTxtNd->GetFmtColl()->GetName();
if( pTxtNd->GetCondFmtColl() )
rCntntAtPos.sStr.AppendAscii(
- RTL_CONSTASCII_STRINGPARAM( "\nBed.Vorl.: " ))
- += pTxtNd->GetCondFmtColl()->GetName();
+ RTL_CONSTASCII_STRINGPARAM( "\nBed.Vorl.: " ))
+ += pTxtNd->GetCondFmtColl()->GetName();
if( aSet.Count() )
{
@@ -1496,11 +1627,11 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
{
String aStr;
GetDoc()->GetAttrPool().GetPresentation( *pItem,
- SFX_ITEM_PRESENTATION_COMPLETE,
- SFX_MAPUNIT_CM, aStr );
+ SFX_ITEM_PRESENTATION_COMPLETE,
+ SFX_MAPUNIT_CM, aStr );
if( sAttrs.Len() )
sAttrs.AppendAscii(
- RTL_CONSTASCII_STRINGPARAM( ", " ));
+ RTL_CONSTASCII_STRINGPARAM( ", " ));
sAttrs += aStr;
}
if( aIter.IsAtEnd() )
@@ -1512,8 +1643,8 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
if( rCntntAtPos.sStr.Len() )
rCntntAtPos.sStr += '\n';
rCntntAtPos.sStr.AppendAscii(
- RTL_CONSTASCII_STRINGPARAM( "Attr: " ) )
- += sAttrs;
+ RTL_CONSTASCII_STRINGPARAM( "Attr: " ) )
+ += sAttrs;
}
}
bRet = sal_True;
@@ -1531,7 +1662,6 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
return bRet;
}
-// --> OD 2008-06-19 #i90516#
const SwPostItField* SwCrsrShell::GetPostItFieldAtCursor() const
{
const SwPostItField* pPostItFld = 0;
@@ -1542,9 +1672,8 @@ const SwPostItField* SwCrsrShell::GetPostItFieldAtCursor() const
const SwTxtNode* pTxtNd = pCursorPos->nNode.GetNode().GetTxtNode();
if ( pTxtNd )
{
- SwTxtAttr* pTxtAttr = pTxtNd->GetTxtAttrForCharAt(
- pCursorPos->nContent.GetIndex(), RES_TXTATR_FIELD );
- const SwField* pFld = pTxtAttr ? pTxtAttr->GetFmtFld().GetField() : 0;
+ SwTxtAttr* pTxtAttr = pTxtNd->GetFldTxtAttrAt( pCursorPos->nContent.GetIndex() );
+ const SwField* pFld = pTxtAttr != NULL ? pTxtAttr->GetFmtFld().GetField() : 0;
if ( pFld && pFld->Which()== RES_POSTITFLD )
{
pPostItFld = static_cast<const SwPostItField*>(pFld);
@@ -1554,7 +1683,6 @@ const SwPostItField* SwCrsrShell::GetPostItFieldAtCursor() const
return pPostItFld;
}
-// <--
// befindet sich der Node in einem geschuetzten Bereich?
sal_Bool SwContentAtPos::IsInProtectSect() const
@@ -1622,17 +1750,44 @@ bool SwContentAtPos::IsInRTLText()const
return bRet;
}
-sal_Bool SwCrsrShell::SelectTxtAttr( sal_uInt16 nWhich, sal_Bool bExpand,
- const SwTxtAttr* pTxtAttr )
+
+sal_Bool SwCrsrShell::SelectTxt( const xub_StrLen nStart,
+ const xub_StrLen nEnd )
+{
+ SET_CURR_SHELL( this );
+ sal_Bool bRet = sal_False;
+
+ SwCallLink aLk( *this );
+ SwCrsrSaveState aSaveState( *pCurCrsr );
+
+ SwPosition& rPos = *pCurCrsr->GetPoint();
+ pCurCrsr->DeleteMark();
+ rPos.nContent = nStart;
+ pCurCrsr->SetMark();
+ rPos.nContent = nEnd;
+
+ if( !pCurCrsr->IsSelOvr() )
+ {
+ UpdateCrsr();
+ bRet = sal_True;
+ }
+
+ return bRet;
+}
+
+
+sal_Bool SwCrsrShell::SelectTxtAttr( sal_uInt16 nWhich,
+ sal_Bool bExpand,
+ const SwTxtAttr* pTxtAttr )
{
SET_CURR_SHELL( this );
sal_Bool bRet = sal_False;
if( !IsTableMode() )
{
- SwPosition& rPos = *pCurCrsr->GetPoint();
if( !pTxtAttr )
{
+ SwPosition& rPos = *pCurCrsr->GetPoint();
SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode();
pTxtAttr = (pTxtNd)
? pTxtNd->GetTxtAttrAt(rPos.nContent.GetIndex(),
@@ -1643,20 +1798,8 @@ sal_Bool SwCrsrShell::SelectTxtAttr( sal_uInt16 nWhich, sal_Bool bExpand,
if( pTxtAttr )
{
- SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
- SwCrsrSaveState aSaveState( *pCurCrsr );
-
- pCurCrsr->DeleteMark();
- rPos.nContent = *pTxtAttr->GetStart();
- pCurCrsr->SetMark();
- const xub_StrLen* pEnd = pTxtAttr->GetEnd();
- rPos.nContent = pEnd ? *pEnd : *pTxtAttr->GetStart() + 1;
-
- if( !pCurCrsr->IsSelOvr() )
- {
- UpdateCrsr();
- bRet = sal_True;
- }
+ const xub_StrLen* pEnd = pTxtAttr->End();
+ bRet = SelectTxt( *pTxtAttr->GetStart(), ( pEnd ? *pEnd : *pTxtAttr->GetStart() + 1 ) );
}
}
return bRet;
@@ -2175,7 +2318,7 @@ sal_Bool SwCrsrShell::SelectNxtPrvHyperlink( sal_Bool bNext )
aCmpPos.GetPosOfContent( *pCurCrsr->GetPoint() );
pCurCrsr->DeleteMark();
pCurCrsr->SetMark();
- pCurCrsr->GetPoint()->nContent = *pFndAttr->SwTxtAttr::GetEnd();
+ pCurCrsr->GetPoint()->nContent = *pFndAttr->End();
if( !pCurCrsr->IsInProtectTable() && !pCurCrsr->IsSelOvr() )
{
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index 9d2c2f1..09c3e4d 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -154,7 +154,7 @@ sal_Bool lcl_Search( const SwTxtNode& rTxtNd, SwPaM& rPam,
if( pTxtHt->Which() == rCmpItem.Which() &&
( !bValue || CmpAttr( pTxtHt->GetAttr(), rCmpItem )))
{
- lcl_SetAttrPam( rPam, *pTxtHt->GetStart(), pTxtHt->GetEnd(), bForward );
+ lcl_SetAttrPam( rPam, *pTxtHt->GetStart(), pTxtHt->End(), bForward );
return sal_True;
}
return sal_False;
@@ -902,7 +902,7 @@ sal_Bool SwPaM::Find( const SfxPoolItem& rAttr, sal_Bool bValue, SwMoveFn fnMove
const SwPaM *pRegion, sal_Bool bInReadOnly )
{
// stelle fest welches Attribut gesucht wird:
- sal_uInt16 nWhich = rAttr.Which();
+ const sal_uInt16 nWhich = rAttr.Which();
int bCharAttr = isCHRATR(nWhich) || isTXTATR(nWhich);
SwPaM* pPam = MakeRegion( fnMove, pRegion );
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 74cca26..eee2731 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -57,9 +57,10 @@ using namespace util;
String *ReplaceBackReferences( const SearchOptions& rSearchOpt, SwPaM* pPam );
+
String& lcl_CleanStr(
const SwTxtNode& rNd,
- xub_StrLen nStart,
+ const xub_StrLen nStart,
xub_StrLen& rEnde,
SvULongs& rArr,
String& rRet,
@@ -125,7 +126,6 @@ String& lcl_CleanStr(
const SwTxtAttr* pHt = (*pHts)[n];
if ( pHt->HasDummyChar() && (nStt >= nStart) )
{
- //JP 17.05.00: Task 75806 ask for ">=" and not for ">"
switch( pHt->Which() )
{
case RES_TXTATR_FLYCNT:
@@ -136,14 +136,6 @@ String& lcl_CleanStr(
case RES_TXTATR_META:
case RES_TXTATR_METAFIELD:
{
- // JP 06.05.98: mit Bug 50100 werden sie als Trenner erwuenscht und nicht
- // mehr zum Wort dazu gehoerend.
- // MA 23.06.98: mit Bug 51215 sollen sie konsequenterweise auch am
- // Satzanfang und -ende ignoriert werden wenn sie Leer sind.
- // Dazu werden sie schlicht entfernt. Fuer den Anfang entfernen
- // wir sie einfach.
- // Fuer das Ende merken wir uns die Ersetzungen und entferenen
- // hinterher alle am Stringende (koenten ja 'normale' 0x7f drinstehen
sal_Bool bEmpty = RES_TXTATR_FIELD != pHt->Which() ||
!(static_cast<SwTxtFld const*>(pHt)
->GetFmtFld().GetField()->ExpandField(true).Len());
@@ -171,9 +163,9 @@ String& lcl_CleanStr(
if ( bNewSoftHyphen )
{
- rArr.Insert( nAkt, rArr.Count() );
+ rArr.Insert( nAkt, rArr.Count() );
--rEnde;
- rRet.Erase( nAkt, 1 );
+ rRet.Erase( nAkt, 1 );
++nSoftHyphen;
}
}
@@ -203,8 +195,8 @@ xub_StrLen GetPostIt(xub_StrLen aCount,const SwpHints *pHts)
{
aIndex++;
const SwTxtAttr* pTxtAttr = (*pHts)[i];
- if ( (pTxtAttr->Which()==RES_TXTATR_FIELD) &&
- (pTxtAttr->GetFmtFld().GetField()->Which()==RES_POSTITFLD))
+ if ( (pTxtAttr->Which()==RES_TXTATR_FIELD)
+ && (pTxtAttr->GetFmtFld().GetField()->Which()==RES_POSTITFLD))
{
aCount--;
if (!aCount)
@@ -216,8 +208,8 @@ xub_StrLen GetPostIt(xub_StrLen aCount,const SwpHints *pHts)
for (xub_StrLen i = aIndex; i <pHts->Count();i++)
{
const SwTxtAttr* pTxtAttr = (*pHts)[i];
- if ( (pTxtAttr->Which()==RES_TXTATR_FIELD) &&
- (pTxtAttr->GetFmtFld().GetField()->Which()==RES_POSTITFLD))
+ if ( (pTxtAttr->Which()==RES_TXTATR_FIELD)
+ && (pTxtAttr->GetFmtFld().GetField()->Which()==RES_POSTITFLD))
break;
else
aIndex++;
@@ -309,10 +301,10 @@ sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes
for (xub_StrLen i = 0; i <pHts->Count();i++)
{
- xub_StrLen aPos = *(*pHts)[i]->GetStart();
+ const xub_StrLen aPos = *(*pHts)[i]->GetStart();
const SwTxtAttr* pTxtAttr = (*pHts)[i];
- if ( (pTxtAttr->Which()==RES_TXTATR_FIELD) &&
- (pTxtAttr->GetFmtFld().GetField()->Which()==RES_POSTITFLD))
+ if ( (pTxtAttr->Which()==RES_TXTATR_FIELD)
+ && (pTxtAttr->GetFmtFld().GetField()->Which()==RES_POSTITFLD))
{
if ( (aPos >= nStart) && (aPos <= nEnde) )
aNumberPostits++;
diff --git a/sw/source/core/crsr/overlayrangesoutline.cxx b/sw/source/core/crsr/overlayrangesoutline.cxx
new file mode 100755
index 0000000..3859463
--- /dev/null
+++ b/sw/source/core/crsr/overlayrangesoutline.cxx
@@ -0,0 +1,117 @@
+/**************************************************************
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*************************************************************/
+
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sw.hxx"
+
+#include <overlayrangesoutline.hxx>
+#include <svx/sdr/overlay/overlaymanager.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace
+{
+ // combine ranges geometrically to a single, ORed polygon
+ basegfx::B2DPolyPolygon impCombineRangesToPolyPolygon(const std::vector< basegfx::B2DRange >& rRanges)
+ {
+ const sal_uInt32 nCount(rRanges.size());
+ basegfx::B2DPolyPolygon aRetval;
+
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ const basegfx::B2DPolygon aDiscretePolygon(basegfx::tools::createPolygonFromRect(rRanges[a]));
+
+ if(0 == a)
+ {
+ aRetval.append(aDiscretePolygon);
+ }
+ else
+ {
+ aRetval = basegfx::tools::solvePolygonOperationOr(aRetval, basegfx::B2DPolyPolygon(aDiscretePolygon));
+ }
+ }
+
+ return aRetval;
+ }
+}
+
+namespace sw
+{
+ namespace overlay
+ {
+ drawinglayer::primitive2d::Primitive2DSequence OverlayRangesOutline::createOverlayObjectPrimitive2DSequence()
+ {
+ drawinglayer::primitive2d::Primitive2DSequence aRetval;
+ const sal_uInt32 nCount(getRanges().size());
+
+ if( nCount )
+ {
+ const basegfx::BColor aRGBColor(getBaseColor().getBColor());
+ const basegfx::B2DPolyPolygon aPolyPolygon(impCombineRangesToPolyPolygon(getRanges()));
+ const drawinglayer::primitive2d::Primitive2DReference aOutline(
+ new drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D(
+ aPolyPolygon,
+ aRGBColor));
+
+ aRetval.realloc(1);
+ aRetval[0] = aOutline;
+ }
+
+ return aRetval;
+ }
+
+ OverlayRangesOutline::OverlayRangesOutline(
+ const Color& rColor,
+ const std::vector< basegfx::B2DRange >& rRanges )
+ : sdr::overlay::OverlayObject(rColor)
+ , maRanges(rRanges)
+ {
+ // no AA for highlight overlays
+ allowAntiAliase(false);
+ }
+
+ OverlayRangesOutline::~OverlayRangesOutline()
+ {
+ if( getOverlayManager() )
+ {
+ getOverlayManager()->remove(*this);
+ }
+ }
+
+ void OverlayRangesOutline::setRanges(const std::vector< basegfx::B2DRange >& rNew)
+ {
+ if(rNew != maRanges)
+ {
+ maRanges = rNew;
+ objectChange();
+ }
+ }
+ } // end of namespace overlay
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/sw/source/core/crsr/overlayrangesoutline.hxx b/sw/source/core/crsr/overlayrangesoutline.hxx
new file mode 100755
index 0000000..58a2bbb
--- /dev/null
+++ b/sw/source/core/crsr/overlayrangesoutline.hxx
@@ -0,0 +1,70 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+
+
+#ifndef _SW_OVERLAY_OVERLAYRANGESOUTLINE_HXX
+#define _SW_OVERLAY_OVERLAYRANGESOUTLINE_HXX
+
+#include <svx/sdr/overlay/overlayobject.hxx>
+#include <basegfx/range/b2drange.hxx>
+
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sw
+{
+ namespace overlay
+ {
+ class OverlayRangesOutline : public sdr::overlay::OverlayObject
+ {
+ protected:
+ // geometry of overlay
+ std::vector< basegfx::B2DRange > maRanges;
+
+ // geometry creation for OverlayObject
+ virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
+
+ public:
+ OverlayRangesOutline(
+ const Color& rColor,
+ const std::vector< basegfx::B2DRange >& rRanges );
+
+ virtual ~OverlayRangesOutline();
+
+ // data read access
+ inline const std::vector< basegfx::B2DRange >& getRanges() const
+ {
+ return maRanges;
+ }
+
+ // data write access
+ void setRanges(const std::vector< basegfx::B2DRange >& rNew);
+ };
+ } // end of namespace overlay
+} // end of namespace sw
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SW_OVERLAY_OVERLAYRANGESOUTLINE_HXX
+
+// eof
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index bd8c05c..9dd182a 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list