View | Details | Raw Unified | Return to issue 33737
Collapse All | Expand All

(-)inc/IDocumentBookmarkAccess.hxx (-9 / +20 lines)
Lines 45-66 Link Here
45
class SwPaM;
45
class SwPaM;
46
class KeyCode;
46
class KeyCode;
47
class String;
47
class String;
48
class SwFieldBookmark;
48
49
49
 /** Provides access to the bookmarks of a document.
50
 /** Provides access to the bookmarks of a document.
50
 */
51
 */
51
 class IDocumentBookmarkAccess
52
 class IDocumentBookmarkAccess
52
 {
53
 {
53
 public:
54
 public:
54
    enum BookmarkType 
55
    enum BookmarkType
55
    { 
56
    {
56
        BOOKMARK, 
57
        BOOKMARK,
57
        MARK, 
58
        MARK,
58
        DDE_BOOKMARK, 
59
        DDE_BOOKMARK,
59
        UNO_BOOKMARK,
60
        UNO_BOOKMARK,
60
        HIDDEN_BOOKMARK
61
        HIDDEN_BOOKMARK,
62
        FIELD_BOOKMARK
61
    };
63
    };
62
    
64
63
 public:    
65
 public:
64
    /** Returns all bookmarks set at the document.
66
    /** Returns all bookmarks set at the document.
65
67
66
       @returns
68
       @returns
Lines 92-97 Link Here
92
                                      /*[in]*/const String& rName, /*[in]*/const String& rShortName,
94
                                      /*[in]*/const String& rName, /*[in]*/const String& rShortName,
93
                                      /*[in]*/BookmarkType eMark ) = 0;
95
                                      /*[in]*/BookmarkType eMark ) = 0;
94
96
97
    /** insert bookmark based field
98
       @param pBookmarkField
99
       [in] the to-be-inserted bookmark, SwPositions are already set, this takes ownership
100
       @returns
101
       result of the insert operation, if false pBookmarkField is invalid
102
    */
103
    virtual bool insertField(/*[in]*/ SwFieldBookmark* pBookmarkField) = 0;
104
105
95
    /** Deletes a bookmark.
106
    /** Deletes a bookmark.
96
107
97
       @param nPos
108
       @param nPos
Lines 147-153 Link Here
147
       the bookmark.
158
       the bookmark.
148
    */
159
    */
149
    virtual SwBookmark& getBookmark(  /*[in]*/sal_uInt16 nPos, /*[in]*/bool bBkmrk) = 0;
160
    virtual SwBookmark& getBookmark(  /*[in]*/sal_uInt16 nPos, /*[in]*/bool bBkmrk) = 0;
150
    
161
151
protected:
162
protected:
152
    virtual ~IDocumentBookmarkAccess() {};
163
    virtual ~IDocumentBookmarkAccess() {};
153
 };
164
 };
(-)inc/bookmrk.hxx (-4 / +54 lines)
Lines 61-74 Link Here
61
#define SW_DECL_SWSERVEROBJECT_DEFINED
61
#define SW_DECL_SWSERVEROBJECT_DEFINED
62
SV_DECL_REF( SwServerObject )
62
SV_DECL_REF( SwServerObject )
63
#endif
63
#endif
64
64
#ifndef _FLDBAS_HXX
65
65
#include <fldbas.hxx>
66
struct SwPosition;	// fwd Decl. wg. UI
66
#endif
67
68
namespace com{ namespace sun{ namespace star{ namespace uno{
69
    class Any;
70
}}}}
71
struct SwPosition;  // fwd Decl. wg. UI
67
72
68
class SwBookmark : public SwModify
73
class SwBookmark : public SwModify
69
{
74
{
70
	friend class SwDoc;			// fuers Loeschen
75
	friend class SwDoc;			// fuers Loeschen
71
//  friend class Sw3IoImp;      // fuers Setzen der Position(en)
72
76
73
	SwPosition *pPos1, *pPos2;	// wird im CTOR gesetzt, im DTOR geloescht
77
	SwPosition *pPos1, *pPos2;	// wird im CTOR gesetzt, im DTOR geloescht
74
                                // pPos1 is always != 0, pPos2 may be 0
78
                                // pPos1 is always != 0, pPos2 may be 0
Lines 82-91 Link Here
82
	KeyCode		aCode;
86
	KeyCode		aCode;
83
	IDocumentBookmarkAccess::BookmarkType eMarkType;
87
	IDocumentBookmarkAccess::BookmarkType eMarkType;
84
88
89
    void setNewPositions( const SwPaM& rNew );
90
85
public:
91
public:
86
	TYPEINFO();
92
	TYPEINFO();
87
93
88
	SwBookmark(const SwPosition& aPos);
94
	SwBookmark(const SwPosition& aPos);
95
    SwBookmark(const SwPosition& rPos, const SwPosition& rSecondPos);
89
	SwBookmark(const SwPosition& aPos,
96
	SwBookmark(const SwPosition& aPos,
90
		const KeyCode& rCode,
97
		const KeyCode& rCode,
91
		const String& rName, const String& rShortName);
98
		const String& rName, const String& rShortName);
Lines 113-118 Link Here
113
    BOOL IsDDEMark() const      { return IDocumentBookmarkAccess::DDE_BOOKMARK == eMarkType; }
120
    BOOL IsDDEMark() const      { return IDocumentBookmarkAccess::DDE_BOOKMARK == eMarkType; }
114
	BOOL IsUNOMark() const 		{ return IDocumentBookmarkAccess::UNO_BOOKMARK == eMarkType; }
121
	BOOL IsUNOMark() const 		{ return IDocumentBookmarkAccess::UNO_BOOKMARK == eMarkType; }
115
    BOOL IsHiddenBookMark() const { return IDocumentBookmarkAccess::HIDDEN_BOOKMARK == eMarkType; }
122
    BOOL IsHiddenBookMark() const { return IDocumentBookmarkAccess::HIDDEN_BOOKMARK == eMarkType; }
123
    BOOL IsFieldBookMark() const { return IDocumentBookmarkAccess::FIELD_BOOKMARK == eMarkType; }
116
	void SetType( IDocumentBookmarkAccess::BookmarkType eNewType ) 	{ eMarkType = eNewType; }
124
	void SetType( IDocumentBookmarkAccess::BookmarkType eNewType ) 	{ eMarkType = eNewType; }
117
	IDocumentBookmarkAccess::BookmarkType GetType() const 	{ return eMarkType; }
125
	IDocumentBookmarkAccess::BookmarkType GetType() const 	{ return eMarkType; }
118
126
Lines 159-164 Link Here
159
		const KeyCode& rCode,
167
		const KeyCode& rCode,
160
		const String& rName, const String& rShortName);
168
		const String& rName, const String& rShortName);
161
};
169
};
170
/*-----------------02.04.2007 08:37-----------------*/
171
/** Base class of bookmark-like field implementation
172
 */
173
class SwFieldBookmark : public SwBookmark
174
{
175
    RES_FIELDS          m_eFieldType;
162
176
177
public:
178
    SwFieldBookmark(const SwPosition& rPos, const SwPosition& rOtherPos, RES_FIELDS eFieldType );
179
    virtual ~SwFieldBookmark();
180
181
    void            setPresentation( const ::rtl::OUString rPresentation );
182
    RES_FIELDS      GetFieldResId() const { return m_eFieldType;}
183
184
    virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, BYTE nMId ) const;
185
    virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, BYTE nMId );
186
};
187
188
/*-----------------02.04.2007 08:37-----------------*/
189
/** Successor of SwInputField
190
       @param rHint
191
       [in] the hint will be displayed as fly over help
192
       @param rUserFieldname
193
       [in] contains the name of the related SwUserFieldType if the field should be connected to it
194
 */
195
class SwInputFieldBookmark : public SwFieldBookmark
196
{
197
    ::rtl::OUString     m_sHint;
198
    ::rtl::OUString     m_sUserFieldName;
199
200
public:
201
    SwInputFieldBookmark(
202
        const SwPaM& rPaM,
203
        const ::rtl::OUString& rHint,
204
        const ::rtl::OUString& rUserFieldName );
205
    virtual ~SwInputFieldBookmark();
206
207
    const ::rtl::OUString& GetHint() const { return m_sHint; }
208
    const ::rtl::OUString& GetUserFieldName() const { return m_sUserFieldName; }
209
210
    virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, BYTE nMId ) const;
211
    virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, BYTE nMId );
212
};
163
213
164
#endif
214
#endif
(-)inc/ddefld.hxx (-2 / +2 lines)
Lines 73-80 Link Here
73
	~SwDDEFieldType();
73
	~SwDDEFieldType();
74
74
75
	const String& GetExpansion() const			{ return aExpansion; }
75
	const String& GetExpansion() const			{ return aExpansion; }
76
	void SetExpansion( const String& rStr )		{ aExpansion = rStr,
76
    void SetExpansion( const String& rStr )        { aExpansion = rStr,
77
												  bCRLFFlag = FALSE; }
77
                                                bCRLFFlag = FALSE; }
78
78
79
	virtual SwFieldType* Copy() const;
79
	virtual SwFieldType* Copy() const;
80
	virtual const String& GetName() const;
80
	virtual const String& GetName() const;
(-)inc/doc.hxx (-1 / +2 lines)
Lines 594-600 Link Here
594
    //
594
    //
595
595
596
    sal_Bool    bWinEncryption                      ;    // imported document password encrypted?
596
    sal_Bool    bWinEncryption                      ;    // imported document password encrypted?
597
    
597
598
    sal_Bool    mbStartIdleTimer                 ;    // idle timer mode start/stop
598
    sal_Bool    mbStartIdleTimer                 ;    // idle timer mode start/stop
599
599
600
	static SwAutoCompleteWord *pACmpltWords;	// Liste aller Worte fuers AutoComplete
600
	static SwAutoCompleteWord *pACmpltWords;	// Liste aller Worte fuers AutoComplete
Lines 748-753 Link Here
748
    virtual SwBookmark* makeBookmark( /*[in]*/const SwPaM& rPaM, /*[in]*/const KeyCode& rKC,
748
    virtual SwBookmark* makeBookmark( /*[in]*/const SwPaM& rPaM, /*[in]*/const KeyCode& rKC,
749
                                      /*[in]*/ const String& rName, /*[in]*/const String& rShortName,
749
                                      /*[in]*/ const String& rName, /*[in]*/const String& rShortName,
750
                                      /*[in]*/BookmarkType eMark );
750
                                      /*[in]*/BookmarkType eMark );
751
    virtual bool insertField(/*[in]*/ SwFieldBookmark* pBookmarkField);
751
    virtual void deleteBookmark( /*[in]*/sal_uInt16 nPos );
752
    virtual void deleteBookmark( /*[in]*/sal_uInt16 nPos );
752
    virtual void deleteBookmark( /*[in]*/const String& rName );
753
    virtual void deleteBookmark( /*[in]*/const String& rName );
753
    virtual sal_uInt16 findBookmark( /*[in]*/const String& rName );
754
    virtual sal_uInt16 findBookmark( /*[in]*/const String& rName );
(-)inc/expfld.hxx (-48 lines)
Lines 307-360 Link Here
307
	{ return 0 != (GSE_SEQ & ((SwSetExpFieldType*)GetTyp())->GetType()); }
307
	{ return 0 != (GSE_SEQ & ((SwSetExpFieldType*)GetTyp())->GetType()); }
308
308
309
/*--------------------------------------------------------------------
309
/*--------------------------------------------------------------------
310
	Beschreibung: Eingabe im Text/Variable setzen
311
 --------------------------------------------------------------------*/
312
313
class SwInputFieldType : public SwFieldType
314
{
315
	SwDoc* pDoc;
316
public:
317
	SwInputFieldType( SwDoc* pDoc );
318
319
	virtual SwFieldType* Copy() const;
320
321
	SwDoc* GetDoc() const { return pDoc; }
322
};
323
324
/*--------------------------------------------------------------------
325
	Beschreibung: Eingabefeld
326
 --------------------------------------------------------------------*/
327
328
class SwInputField : public SwField
329
{
330
	String  aContent;
331
	String	aPText;
332
	USHORT  nSubType;
333
public:
334
	// Direkte Eingabe ueber Dialog alten Wert loeschen
335
	SwInputField(SwInputFieldType*, const String& rContent ,
336
				 const String& rPrompt, USHORT nSubType = 0,
337
				 ULONG nFmt = 0);
338
339
	virtual	String			GetCntnt(BOOL bName = FALSE) const;
340
	virtual String	 		Expand() const;
341
	virtual SwField* 		Copy() const;
342
343
	// Content
344
	virtual const String&	GetPar1() const;
345
	virtual void			SetPar1(const String& rStr);
346
347
	// aPromptText
348
	virtual String			GetPar2() const;
349
	virtual void			SetPar2(const String& rStr);
350
351
	virtual USHORT			GetSubType() const;
352
	virtual void			SetSubType(USHORT nSub);
353
	virtual	BOOL       	QueryValue( com::sun::star::uno::Any& rVal, BYTE nMId ) const;
354
	virtual	BOOL		PutValue( const com::sun::star::uno::Any& rVal, BYTE nMId );
355
};
356
357
/*--------------------------------------------------------------------
358
    Description: Sorted list of input fields and DropDown fields
310
    Description: Sorted list of input fields and DropDown fields
359
 --------------------------------------------------------------------*/
311
 --------------------------------------------------------------------*/
360
312
(-)inc/swtypes.hxx (-1 / +2 lines)
Lines 173-179 Link Here
173
// <- #i30312#
173
// <- #i30312#
174
174
175
// Anzahl der SystemField-Types vom SwDoc
175
// Anzahl der SystemField-Types vom SwDoc
176
#define INIT_FLDTYPES	32
176
// SwInputField removed - now 31 fields
177
#define INIT_FLDTYPES   31
177
// Anzahl der vordefinierten Seq-Feldtypen. Es handelt sich dabei
178
// Anzahl der vordefinierten Seq-Feldtypen. Es handelt sich dabei
178
// immer um die letzen Felder vor INIT_FLDTYPES
179
// immer um die letzen Felder vor INIT_FLDTYPES
179
#define INIT_SEQ_FLDTYPES	4
180
#define INIT_SEQ_FLDTYPES	4
(-)inc/unofield.hxx (-4 / +10 lines)
Lines 63-68 Link Here
63
class SwField;
63
class SwField;
64
class SwSetExpField;
64
class SwSetExpField;
65
class String;
65
class String;
66
class SwFieldBookmark;
66
/* -----------------04.12.98 12:49-------------------
67
/* -----------------04.12.98 12:49-------------------
67
 *
68
 *
68
 * --------------------------------------------------*/
69
 * --------------------------------------------------*/
Lines 97-103 Link Here
97
98
98
	SwXFieldMaster(SwDoc* pDoc, sal_uInt16 nResId);
99
	SwXFieldMaster(SwDoc* pDoc, sal_uInt16 nResId);
99
	SwXFieldMaster(SwFieldType& rType, SwDoc* pDoc);
100
	SwXFieldMaster(SwFieldType& rType, SwDoc* pDoc);
100
	
101
101
102
102
	TYPEINFO();
103
	TYPEINFO();
103
104
Lines 170-176 Link Here
170
public:
171
public:
171
	SwXTextField(sal_uInt16 nServiceId);
172
	SwXTextField(sal_uInt16 nServiceId);
172
	SwXTextField(const SwFmtFld& rFmt, SwDoc* pDoc);
173
	SwXTextField(const SwFmtFld& rFmt, SwDoc* pDoc);
173
	
174
    SwXTextField( SwFieldBookmark& rFieldBookmark );
175
174
176
175
	TYPEINFO();
177
	TYPEINFO();
176
178
Lines 219-224 Link Here
219
221
220
	const SwField*  	GetField() const;
222
	const SwField*  	GetField() const;
221
	const SwFmtFld* 	GetFldFmt(){return GetField() ? pFmtFld : 0; };
223
	const SwFmtFld* 	GetFldFmt(){return GetField() ? pFmtFld : 0; };
224
    SwFieldBookmark*    GetBookmarkField() const;
222
225
223
    // #111840#
226
    // #111840#
224
    /**
227
    /**
Lines 246-252 Link Here
246
	virtual ~SwXTextFieldMasters();
249
	virtual ~SwXTextFieldMasters();
247
public:
250
public:
248
	SwXTextFieldMasters(SwDoc* pDoc);
251
	SwXTextFieldMasters(SwDoc* pDoc);
249
	
252
250
253
251
	//XNameAccess
254
	//XNameAccess
252
	virtual ::com::sun::star::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
255
	virtual ::com::sun::star::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
Lines 285-291 Link Here
285
	virtual ~SwXTextFieldTypes();
288
	virtual ~SwXTextFieldTypes();
286
public:
289
public:
287
	SwXTextFieldTypes(SwDoc* pDoc);
290
	SwXTextFieldTypes(SwDoc* pDoc);
288
	
291
289
292
290
	//XEnumerationAccess
293
	//XEnumerationAccess
291
	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration >  SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException );
294
	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration >  SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException );
Lines 306-311 Link Here
306
309
307
    // SwUnoCollection
310
    // SwUnoCollection
308
    virtual void    Invalidate();
311
    virtual void    Invalidate();
312
313
    static SwXTextField*     GetObject( SwFieldBookmark& rBkm );
314
309
};
315
};
310
316
311
/* -----------------21.12.98 14:49-------------------
317
/* -----------------21.12.98 14:49-------------------
(-)inc/unoport.hxx (+3 lines)
Lines 133-138 Link Here
133
	::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >  	xTOXMark;
133
	::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >  	xTOXMark;
134
	::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > 	xBookmark;
134
	::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > 	xBookmark;
135
	::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > 	xFootnote;
135
	::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > 	xFootnote;
136
    ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >    xBookmarkField;
136
    ::com::sun::star::uno::Any* pRubyText;
137
    ::com::sun::star::uno::Any* pRubyText;
137
    ::com::sun::star::uno::Any* pRubyStyle;
138
    ::com::sun::star::uno::Any* pRubyStyle;
138
    ::com::sun::star::uno::Any* pRubyAdjust;
139
    ::com::sun::star::uno::Any* pRubyAdjust;
Lines 248-253 Link Here
248
	void 				SetFootnote( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >  xMark)
249
	void 				SetFootnote( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >  xMark)
249
							{xFootnote = xMark;}
250
							{xFootnote = xMark;}
250
251
252
    void                SetBookmarkField( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xField )
253
                            {xBookmarkField = xField; }
251
	void				SetControlChar(sal_Int16 nSet) {nControlChar = nSet;}
254
	void				SetControlChar(sal_Int16 nSet) {nControlChar = nSet;}
252
255
253
	BOOL				IsCollapsed() const { return bIsCollapsed;}
256
	BOOL				IsCollapsed() const { return bIsCollapsed;}
(-)inc/viewsh.hxx (-14 / +4 lines)
Lines 218-226 Link Here
218
    void            InitPrt( SfxPrinter * , OutputDevice *pPDFOut = NULL );
218
    void            InitPrt( SfxPrinter * , OutputDevice *pPDFOut = NULL );
219
219
220
    //Klammerung von zusammengehoerenden Aktionen.
220
    //Klammerung von zusammengehoerenden Aktionen.
221
	inline void StartAction();
221
    void StartAction();
222
		   void ImplStartAction();
222
		   void ImplStartAction();
223
	inline void EndAction( const sal_Bool bIdleEnd = sal_False );
223
    void EndAction( const sal_Bool bIdleEnd = sal_False );
224
		   void ImplEndAction( const sal_Bool bIdleEnd = sal_False );
224
		   void ImplEndAction( const sal_Bool bIdleEnd = sal_False );
225
    sal_uInt16 ActionCount() const { return nStartAction; }
225
    sal_uInt16 ActionCount() const { return nStartAction; }
226
	sal_Bool ActionPend() const { return nStartAction != 0; }
226
	sal_Bool ActionPend() const { return nStartAction != 0; }
Lines 245-251 Link Here
245
	void SetNoNextScroll();
245
	void SetNoNextScroll();
246
246
247
	void InvalidateWindows( const SwRect &rRect );
247
	void InvalidateWindows( const SwRect &rRect );
248
	
248
249
	//////////////////////////////////////////////////////////////////////////////
249
	//////////////////////////////////////////////////////////////////////////////
250
	// #i72754# set of Pre/PostPaints with lock counter and initial target OutDev
250
	// #i72754# set of Pre/PostPaints with lock counter and initial target OutDev
251
protected:
251
protected:
Lines 581-597 Link Here
581
   aInvalidRect.Clear();
581
   aInvalidRect.Clear();
582
}
582
}
583
583
584
inline void ViewShell::StartAction()
584
585
{
586
	if ( !nStartAction++ )
587
		ImplStartAction();
588
}
589
inline void ViewShell::EndAction( const sal_Bool bIdleEnd )
590
{
591
	if( 0 == (nStartAction - 1) )
592
		ImplEndAction( bIdleEnd );
593
	--nStartAction;
594
}
595
585
596
inline void ViewShell::LockPaint()
586
inline void ViewShell::LockPaint()
597
{
587
{
(-)source/core/crsr/bookmrk.cxx (+175 lines)
Lines 46-51 Link Here
46
#ifndef _PAM_HXX
46
#ifndef _PAM_HXX
47
#include <pam.hxx>
47
#include <pam.hxx>
48
#endif
48
#endif
49
#ifndef _SWCRSR_HXX
50
#include <swcrsr.hxx>
51
#endif
52
#ifndef _DOC_HXX
53
#include <doc.hxx>
54
#endif
55
#ifndef _UNOCRSRHELPER_HXX
56
#include <unocrsrhelper.hxx>
57
#endif
58
#ifndef _NDTXT_HXX
59
#include <ndtxt.hxx>
60
#endif
61
#ifndef _CRSSKIP_HXX
62
#include <crsskip.hxx>
63
#endif
64
#ifndef _UNOFLDMID_H
65
#include <unofldmid.h>
66
#endif
49
#ifndef _SWSERV_HXX
67
#ifndef _SWSERV_HXX
50
#include <swserv.hxx>
68
#include <swserv.hxx>
51
#endif
69
#endif
Lines 54-59 Link Here
54
#endif
72
#endif
55
#include <IDocumentBookmarkAccess.hxx>
73
#include <IDocumentBookmarkAccess.hxx>
56
74
75
using namespace ::com::sun::star;
76
57
SV_IMPL_REF( SwServerObject )
77
SV_IMPL_REF( SwServerObject )
58
78
59
TYPEINIT1( SwBookmark, SwModify );  //rtti
79
TYPEINIT1( SwBookmark, SwModify );  //rtti
Lines 84-89 Link Here
84
	pPos1 = new SwPosition(aPos);
104
	pPos1 = new SwPosition(aPos);
85
}
105
}
86
106
107
/*-- 02.04.2007 09:28:45---------------------------------------------------
108
109
  -----------------------------------------------------------------------*/
110
SwBookmark::SwBookmark(const SwPosition& rPos, const SwPosition& rSecondPos)
111
    : SwModify( 0 ),
112
    aStartMacro( aEmptyStr, aEmptyStr ),
113
    aEndMacro  ( aEmptyStr, aEmptyStr ),
114
    eMarkType( IDocumentBookmarkAccess::BOOKMARK )
115
{
116
    pPos1 = new SwPosition(rPos);
117
    pPos2 = new SwPosition(rSecondPos);
118
}
119
87
// Beim Loeschen von Text werden Bookmarks mitgeloescht!
120
// Beim Loeschen von Text werden Bookmarks mitgeloescht!
88
121
89
122
Lines 137-142 Link Here
137
	refObj = pObj;
170
	refObj = pObj;
138
}
171
}
139
172
173
/*-- 04.04.2007 09:10:15---------------------------------------------------
174
175
  -----------------------------------------------------------------------*/
176
void SwBookmark::setNewPositions( const SwPaM& rNew )
177
{
178
    *pPos1 = *rNew.Start();
179
    if( pPos2 )
180
        delete pPos2, pPos2 = 0;
181
    if( rNew.HasMark() )
182
        pPos2 = new SwPosition( *rNew.End() );
183
}
184
140
185
141
SwMark::SwMark( const SwPosition& aPos,
186
SwMark::SwMark( const SwPosition& aPos,
142
				const KeyCode& rCode,
187
				const KeyCode& rCode,
Lines 155-158 Link Here
155
{
200
{
156
	eMarkType = IDocumentBookmarkAccess::UNO_BOOKMARK;
201
	eMarkType = IDocumentBookmarkAccess::UNO_BOOKMARK;
157
}
202
}
203
/*-- 02.04.2007 09:27:54---------------------------------------------------
204
205
  -----------------------------------------------------------------------*/
206
SwFieldBookmark::SwFieldBookmark(
207
    const SwPosition& rPos, const SwPosition& rOtherPos, RES_FIELDS eFieldType ) :
208
        SwBookmark( rPos, rOtherPos ),
209
        m_eFieldType( eFieldType )
210
{
211
    eMarkType = IDocumentBookmarkAccess::FIELD_BOOKMARK;
212
}
213
/*-- 02.04.2007 09:27:54---------------------------------------------------
214
215
  -----------------------------------------------------------------------*/
216
SwFieldBookmark::~SwFieldBookmark()
217
{
218
}
219
/*-- 05.04.2007 09:37:40---------------------------------------------------
158
220
221
  -----------------------------------------------------------------------*/
222
BOOL SwFieldBookmark::QueryValue( uno::Any&, BYTE  ) const
223
{
224
    return sal_True;
225
}
226
/*-- 05.04.2007 09:37:41---------------------------------------------------
227
228
  -----------------------------------------------------------------------*/
229
BOOL SwFieldBookmark::PutValue( const uno::Any& , BYTE  )
230
{
231
    return sal_True;
232
}
233
/*-- 02.04.2007 10:15:20---------------------------------------------------
234
235
  -----------------------------------------------------------------------*/
236
void SwFieldBookmark::setPresentation( const ::rtl::OUString rPresentation )
237
{
238
    //TODO: should be a method at SwDoc/IDocumentContentOperations
239
    //to support correct Undo!
240
    SwCursor aNewCrsr( GetPos() );
241
    SwDoc* pDoc = aNewCrsr.GetDoc();
242
    if(GetOtherPos())
243
    {
244
        aNewCrsr.SetMark();
245
        *aNewCrsr.GetMark() = *GetOtherPos();
246
    }
247
248
    if(aNewCrsr.HasMark())
249
        pDoc->DeleteAndJoin(aNewCrsr);
250
251
    if(rPresentation.getLength())
252
    {
253
        xub_StrLen nIndex = aNewCrsr.Start()->nContent.GetIndex();
254
        SwUnoCursorHelper::DocInsertStringSplitCR( *pDoc, aNewCrsr, rPresentation );
255
        aNewCrsr.SetMark();
256
        aNewCrsr.GetMark()->nContent = nIndex;
257
    }
258
    //TODO: currently no Undo!!
259
    setNewPositions( aNewCrsr );
260
}
261
/*-- 02.04.2007 09:27:54---------------------------------------------------
262
263
  -----------------------------------------------------------------------*/
264
SwInputFieldBookmark::SwInputFieldBookmark(
265
            const SwPaM& rPaM,
266
            const ::rtl::OUString& rHint,
267
            const ::rtl::OUString& rUserFieldName ) :
268
        SwFieldBookmark( *rPaM.Start(), *rPaM.End(), RES_INPUTFLD ),
269
        m_sHint( rHint ),
270
        m_sUserFieldName(rUserFieldName)
271
{
272
}
273
/*-- 02.04.2007 09:27:54---------------------------------------------------
274
275
  -----------------------------------------------------------------------*/
276
SwInputFieldBookmark::~SwInputFieldBookmark()
277
{
278
}
279
/*-- 05.04.2007 09:38:00---------------------------------------------------
280
281
  -----------------------------------------------------------------------*/
282
BOOL SwInputFieldBookmark::QueryValue( uno::Any& rVal, BYTE nMId ) const
283
{
284
    nMId &= ~CONVERT_TWIPS;
285
    switch( nMId )
286
    {
287
        case FIELD_PROP_PAR1:
288
        {
289
            ::rtl::OUString sText;
290
            const SwTxtNode* pTxtNd = Start()->nNode.GetNode().GetTxtNode();
291
            if( pTxtNd )
292
            {
293
                xub_StrLen nStt = Start()->nContent.GetIndex();
294
                sText = pTxtNd->GetExpandTxt( nStt,
295
                        End()->nContent.GetIndex() - nStt );
296
            }
297
            rVal <<= sText;
298
        }
299
        break;
300
        case FIELD_PROP_PAR2:
301
            rVal <<= m_sHint;
302
        break;
303
        default:
304
            DBG_ERROR("illegal property");
305
    }
306
    return sal_True;
307
}
308
/*-- 05.04.2007 09:38:00---------------------------------------------------
309
310
  -----------------------------------------------------------------------*/
311
BOOL SwInputFieldBookmark::PutValue( const uno::Any& rVal, BYTE nMId )
312
{
313
    nMId &= ~CONVERT_TWIPS;
314
    switch( nMId )
315
    {
316
    case FIELD_PROP_PAR1:
317
    {
318
        ::rtl::OUString sPresentation;
319
        rVal >>= sPresentation;
320
        setPresentation(sPresentation);
321
    }
322
    break;
323
    case FIELD_PROP_PAR2:
324
    {
325
        ::rtl::OUString sPresentation;
326
        rVal >>= m_sHint;
327
    }
328
    break;
329
    default:
330
        DBG_ERROR("illegal property");
331
    }
332
    return sal_True;
333
}
(-)source/core/doc/docbm.cxx (-1 / +20 lines)
Lines 196-201 Link Here
196
	}
196
	}
197
	return pBM;
197
	return pBM;
198
}
198
}
199
bool SwDoc::insertField(/*[in]*/ SwFieldBookmark* pBookmarkField)
200
{
201
    // fix bookmark positions if they are invalid
202
    lcl_FixPosition( *pBookmarkField->pPos1 );
203
    if( pBookmarkField->pPos2 != NULL )
204
        lcl_FixPosition( *pBookmarkField->pPos2 );
205
206
    if( !pBookmarkTbl->Insert( pBookmarkField ) )
207
        delete pBookmarkField, pBookmarkField = 0;
208
    if( DoesUndo() )
209
    {
210
        ClearRedo();
211
        //TODO: create appropriate undo code
212
        AppendUndo( new SwUndoInsBookmark( *pBookmarkField ));
213
    }
214
215
    SetModified();
216
    return pBookmarkField != 0;
217
}
199
218
200
void SwDoc::deleteBookmark( /*[in]*/sal_uInt16 nPos )
219
void SwDoc::deleteBookmark( /*[in]*/sal_uInt16 nPos )
201
{
220
{
Lines 678-684 Link Here
678
            nReturn = BEHIND_SAME_NODE;
697
            nReturn = BEHIND_SAME_NODE;
679
    }
698
    }
680
    else if( nIndex > nNode )
699
    else if( nIndex > nNode )
681
        nReturn = BEHIND_NODE; 
700
        nReturn = BEHIND_NODE;
682
    return nReturn;
701
    return nReturn;
683
}
702
}
684
703
(-)source/core/doc/docfld.cxx (-30 / +31 lines)
Lines 347-355 Link Here
347
	}
347
	}
348
}
348
}
349
349
350
const SwFldTypes* SwDoc::GetFldTypes() const 
350
const SwFldTypes* SwDoc::GetFldTypes() const
351
{ 
351
{
352
    return pFldTypes; 
352
    return pFldTypes;
353
}
353
}
354
354
355
/*--------------------------------------------------------------------
355
/*--------------------------------------------------------------------
Lines 357-363 Link Here
357
 --------------------------------------------------------------------*/
357
 --------------------------------------------------------------------*/
358
358
359
SwFieldType* SwDoc::GetFldType( USHORT nResId, const String& rName,
359
SwFieldType* SwDoc::GetFldType( USHORT nResId, const String& rName,
360
		 bool bDbFieldMatching // used in some UNO calls for RES_DBFLD 
360
		 bool bDbFieldMatching // used in some UNO calls for RES_DBFLD
361
								   // to use different string matching code
361
								   // to use different string matching code
362
								   // #i51815#
362
								   // #i51815#
363
		 ) const
363
		 ) const
Lines 796-828 Link Here
796
}
796
}
797
797
798
void SwDoc::LockExpFlds()
798
void SwDoc::LockExpFlds()
799
{ 
799
{
800
    ++nLockExpFld; 
800
    ++nLockExpFld;
801
}
801
}
802
802
803
void SwDoc::UnlockExpFlds()
803
void SwDoc::UnlockExpFlds()
804
{ 
804
{
805
    if( nLockExpFld ) 
805
    if( nLockExpFld )
806
        --nLockExpFld; 
806
        --nLockExpFld;
807
}
807
}
808
808
809
bool SwDoc::IsExpFldsLocked() const		
809
bool SwDoc::IsExpFldsLocked() const
810
{ 
810
{
811
    return 0 != nLockExpFld; 
811
    return 0 != nLockExpFld;
812
}
812
}
813
813
814
SwDocUpdtFld& SwDoc::GetUpdtFlds() const
814
SwDocUpdtFld& SwDoc::GetUpdtFlds() const
815
{ 
815
{
816
    return *pUpdtFlds;
816
    return *pUpdtFlds;
817
}
817
}
818
818
819
bool SwDoc::IsNewFldLst() const 
819
bool SwDoc::IsNewFldLst() const
820
{ 
820
{
821
    return mbNewFldLst; 
821
    return mbNewFldLst;
822
}
822
}
823
823
824
void SwDoc::SetNewFldLst(bool bFlag) 
824
void SwDoc::SetNewFldLst(bool bFlag)
825
{ 
825
{
826
    mbNewFldLst = bFlag;
826
    mbNewFldLst = bFlag;
827
}
827
}
828
828
Lines 1416-1422 Link Here
1416
//			if( pGFld->IsInBodyTxt() )
1416
//			if( pGFld->IsInBodyTxt() )
1417
            SwSbxValue aValue = aCalc.Calculate(
1417
            SwSbxValue aValue = aCalc.Calculate(
1418
                                        pSect->GetCondition() );
1418
                                        pSect->GetCondition() );
1419
            if(!aValue.IsVoidValue())                
1419
            if(!aValue.IsVoidValue())
1420
                pSect->SetCondHidden( aValue.GetBool() );
1420
                pSect->SetCondHidden( aValue.GetBool() );
1421
			continue;
1421
			continue;
1422
		}
1422
		}
Lines 1439-1445 Link Here
1439
            SwSbxValue aValue = aCalc.Calculate( pHFld->GetPar1() );
1439
            SwSbxValue aValue = aCalc.Calculate( pHFld->GetPar1() );
1440
            sal_Bool bValue = !aValue.GetBool();
1440
            sal_Bool bValue = !aValue.GetBool();
1441
            if(!aValue.IsVoidValue())
1441
            if(!aValue.IsVoidValue())
1442
            {        
1442
            {
1443
                pHFld->SetValue( bValue );
1443
                pHFld->SetValue( bValue );
1444
                // Feld Evaluieren
1444
                // Feld Evaluieren
1445
                pHFld->Evaluate(this);
1445
                pHFld->Evaluate(this);
Lines 1687-1693 Link Here
1687
	pFldTypes->Insert( new SwPostItFieldType, nFldType++ );
1687
	pFldTypes->Insert( new SwPostItFieldType, nFldType++ );
1688
	pFldTypes->Insert( new SwDocStatFieldType(this), nFldType++);
1688
	pFldTypes->Insert( new SwDocStatFieldType(this), nFldType++);
1689
	pFldTypes->Insert( new SwDocInfoFieldType(this), nFldType++);
1689
	pFldTypes->Insert( new SwDocInfoFieldType(this), nFldType++);
1690
	pFldTypes->Insert( new SwInputFieldType( this ), nFldType++ );
1690
// removed - SwInputField replace by SwInputFieldBookmark
1691
//    pFldTypes->Insert( new SwInputFieldType( this ), nFldType++ );
1691
	pFldTypes->Insert( new SwTblFieldType( this ), nFldType++);
1692
	pFldTypes->Insert( new SwTblFieldType( this ), nFldType++);
1692
	pFldTypes->Insert( new SwMacroFieldType(this), nFldType++ );
1693
	pFldTypes->Insert( new SwMacroFieldType(this), nFldType++ );
1693
	pFldTypes->Insert( new SwHiddenParaFieldType, nFldType++ );
1694
	pFldTypes->Insert( new SwHiddenParaFieldType, nFldType++ );
Lines 2767-2773 Link Here
2767
}
2768
}
2768
2769
2769
// #111840#
2770
// #111840#
2770
bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld, 
2771
bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
2771
                      SwMsgPoolItem * pMsgHnt,
2772
                      SwMsgPoolItem * pMsgHnt,
2772
                      bool bUpdateFlds)
2773
                      bool bUpdateFlds)
2773
{
2774
{
Lines 2780-2796 Link Here
2780
    USHORT nFldWhich = rSrcFld.GetTyp()->Which();
2781
    USHORT nFldWhich = rSrcFld.GetTyp()->Which();
2781
    SwNodeIndex aTblNdIdx(pDstTxtFld->GetTxtNode());
2782
    SwNodeIndex aTblNdIdx(pDstTxtFld->GetTxtNode());
2782
2783
2783
    if (pDstFld->GetTyp()->Which() == 
2784
    if (pDstFld->GetTyp()->Which() ==
2784
        rSrcFld.GetTyp()->Which())
2785
        rSrcFld.GetTyp()->Which())
2785
    {
2786
    {
2786
        if (DoesUndo())
2787
        if (DoesUndo())
2787
        {
2788
        {
2788
            SwPosition * pPos = 
2789
            SwPosition * pPos =
2789
                pDstTxtFld->GetPosition();
2790
                pDstTxtFld->GetPosition();
2790
2791
2791
            ASSERT(pPos, "SwTxtFld not in its SwTxtNode?");
2792
            ASSERT(pPos, "SwTxtFld not in its SwTxtNode?");
2792
            
2793
2793
            AppendUndo(new SwUndoFieldFromDoc(*pPos, *pDstFld, rSrcFld, 
2794
            AppendUndo(new SwUndoFieldFromDoc(*pPos, *pDstFld, rSrcFld,
2794
                                              pMsgHnt, bUpdateFlds));
2795
                                              pMsgHnt, bUpdateFlds));
2795
            delete pPos;
2796
            delete pPos;
2796
        }
2797
        }
Lines 2798-2804 Link Here
2798
        // Das gefundene Feld wird angepasst ...
2799
        // Das gefundene Feld wird angepasst ...
2799
        //pDstFld->ChangeFormat( rSrcFld.GetFormat() );
2800
        //pDstFld->ChangeFormat( rSrcFld.GetFormat() );
2800
        //pDstFld->SetLanguage( rSrcFld.GetLanguage() );
2801
        //pDstFld->SetLanguage( rSrcFld.GetLanguage() );
2801
        
2802
2802
        SwField * pNewFld = rSrcFld.Copy();
2803
        SwField * pNewFld = rSrcFld.Copy();
2803
        pDstFmtFld->SetFld(pNewFld);
2804
        pDstFmtFld->SetFld(pNewFld);
2804
2805
Lines 2813-2819 Link Here
2813
2814
2814
        case RES_TABLEFLD:
2815
        case RES_TABLEFLD:
2815
            {
2816
            {
2816
                const SwTableNode* pTblNd = 
2817
                const SwTableNode* pTblNd =
2817
                    IsIdxInTbl(aTblNdIdx);
2818
                    IsIdxInTbl(aTblNdIdx);
2818
                if( pTblNd )
2819
                if( pTblNd )
2819
                {
2820
                {
Lines 2825-2831 Link Here
2825
                        pNewFld->GetTyp()->Modify(0, &aTblUpdate);
2826
                        pNewFld->GetTyp()->Modify(0, &aTblUpdate);
2826
2827
2827
                    if (! bUpdateFlds)
2828
                    if (! bUpdateFlds)
2828
                        bTblSelBreak = TRUE; 
2829
                        bTblSelBreak = TRUE;
2829
                }
2830
                }
2830
            }
2831
            }
2831
            break;
2832
            break;
Lines 2878-2884 Link Here
2878
    Any aOldVal;
2879
    Any aOldVal;
2879
    SwField * pField = GetField(rPos);
2880
    SwField * pField = GetField(rPos);
2880
2881
2881
    
2882
2882
    if (DoesUndo() && pField->QueryValue(aOldVal, nMId))
2883
    if (DoesUndo() && pField->QueryValue(aOldVal, nMId))
2883
        AppendUndo(new SwUndoFieldFromAPI(rPos, aOldVal, rVal, nMId));
2884
        AppendUndo(new SwUndoFieldFromAPI(rPos, aOldVal, rVal, nMId));
2884
2885
(-)source/core/fields/expfld.cxx (-141 lines)
Lines 1056-1202 Link Here
1056
	}
1056
	}
1057
}
1057
}
1058
1058
1059
/*--------------------------------------------------------------------
1060
	Beschreibung: Eingabefeld Type
1061
 ---------------------------------------------------------------------*/
1062
1063
SwInputFieldType::SwInputFieldType( SwDoc* pD )
1064
	: SwFieldType( RES_INPUTFLD ), pDoc( pD )
1065
{
1066
}
1067
1068
SwFieldType* SwInputFieldType::Copy() const
1069
{
1070
	SwInputFieldType* pType = new SwInputFieldType( pDoc );
1071
	return pType;
1072
}
1073
1074
/*--------------------------------------------------------------------
1075
	Beschreibung: Eingabefeld
1076
 --------------------------------------------------------------------*/
1077
1078
SwInputField::SwInputField(SwInputFieldType* pType, const String& rContent,
1079
						   const String& rPrompt, USHORT nSub, ULONG nFmt) :
1080
	SwField(pType, nFmt), nSubType(nSub), aContent(rContent), aPText(rPrompt)
1081
{
1082
}
1083
1084
String SwInputField::GetCntnt(BOOL bName) const
1085
{
1086
	if ( bName )
1087
	{
1088
		String aStr(SwField::GetCntnt(bName));
1089
		if ((nSubType & 0x00ff) == INP_USR)
1090
		{
1091
			aStr += GetTyp()->GetName();
1092
			aStr += ' ';
1093
			aStr += aContent;
1094
		}
1095
		return aStr;
1096
	}
1097
	return Expand();
1098
}
1099
1100
SwField* SwInputField::Copy() const
1101
{
1102
	SwInputField* pFld = new SwInputField((SwInputFieldType*)GetTyp(), aContent,
1103
										  aPText, GetSubType(), GetFormat());
1104
    pFld->SetAutomaticLanguage(IsAutomaticLanguage());
1105
    return pFld;
1106
}
1107
1108
String SwInputField::Expand() const
1109
{
1110
	String sRet;
1111
	if((nSubType & 0x00ff) == INP_TXT)
1112
		sRet = aContent;
1113
1114
	else if( (nSubType & 0x00ff) == INP_USR )
1115
	{
1116
		SwUserFieldType* pUserTyp = (SwUserFieldType*)
1117
							((SwInputFieldType*)GetTyp())->GetDoc()->
1118
							GetFldType( RES_USERFLD, aContent, false );
1119
		if( pUserTyp )
1120
			sRet = pUserTyp->GetContent();
1121
	}
1122
	return sRet;
1123
}
1124
1125
/*-----------------06.03.98 11:12-------------------
1126
1127
--------------------------------------------------*/
1128
BOOL SwInputField::QueryValue( uno::Any& rAny, BYTE nMId ) const
1129
{
1130
    nMId &= ~CONVERT_TWIPS;
1131
	switch( nMId )
1132
	{
1133
	case FIELD_PROP_PAR1:
1134
		 rAny <<= OUString( aContent );
1135
		break;
1136
	case FIELD_PROP_PAR2:
1137
		rAny <<= OUString( aPText );
1138
		break;
1139
	default:
1140
		DBG_ERROR("illegal property");
1141
	}
1142
	return TRUE;
1143
}
1144
/*-----------------06.03.98 11:12-------------------
1145
1146
--------------------------------------------------*/
1147
BOOL SwInputField::PutValue( const uno::Any& rAny, BYTE nMId )
1148
{
1149
    nMId &= ~CONVERT_TWIPS;
1150
	switch( nMId )
1151
	{
1152
	case FIELD_PROP_PAR1:
1153
		 ::GetString( rAny, aContent );
1154
		break;
1155
	case FIELD_PROP_PAR2:
1156
		::GetString( rAny, aPText );
1157
		break;
1158
	default:
1159
		DBG_ERROR("illegal property");
1160
	}
1161
	return TRUE;
1162
}
1163
/*--------------------------------------------------------------------
1164
	Beschreibung: Bedingung setzen
1165
 --------------------------------------------------------------------*/
1166
1167
void SwInputField::SetPar1(const String& rStr)
1168
{
1169
	aContent = rStr;
1170
}
1171
1172
const String& SwInputField::GetPar1() const
1173
{
1174
	return aContent;
1175
}
1176
1177
/*--------------------------------------------------------------------
1178
	Beschreibung: True/False Text
1179
 --------------------------------------------------------------------*/
1180
1181
void SwInputField::SetPar2(const String& rStr)
1182
{
1183
	aPText = rStr;
1184
}
1185
1186
String SwInputField::GetPar2() const
1187
{
1188
	return aPText;
1189
}
1190
1191
USHORT SwInputField::GetSubType() const
1192
{
1193
	return nSubType;
1194
}
1195
1196
void SwInputField::SetSubType(USHORT nSub)
1197
{
1198
	nSubType = nSub;
1199
}
1200
/*-----------------05.03.98 17:22-------------------
1059
/*-----------------05.03.98 17:22-------------------
1201
1060
1202
--------------------------------------------------*/
1061
--------------------------------------------------*/
(-)source/core/undo/undobj.cxx (-2 / +3 lines)
Lines 750-759 Link Here
750
			for( USHORT n = 0; n < rBkmkTbl.Count(); ++n )
750
			for( USHORT n = 0; n < rBkmkTbl.Count(); ++n )
751
			{
751
			{
752
				BYTE nTyp = 0;
752
				BYTE nTyp = 0;
753
                pBkmk = rBkmkTbl[ n ];
753
				if( ( DELCNT_CHKNOCNTNT & nDelCntntType )
754
				if( ( DELCNT_CHKNOCNTNT & nDelCntntType )
754
					? (pStt->nNode <= ( pBkmk = rBkmkTbl[ n ])->GetPos().nNode &&
755
					? (pStt->nNode <= pBkmk->GetPos().nNode &&
755
									pBkmk->GetPos().nNode < pEnd->nNode )
756
									pBkmk->GetPos().nNode < pEnd->nNode )
756
					: (*pStt <= ( pBkmk = rBkmkTbl[ n ])->GetPos() &&
757
					: (*pStt <= pBkmk->GetPos() &&
757
									pBkmk->GetPos() < *pEnd ) )
758
									pBkmk->GetPos() < *pEnd ) )
758
					nTyp = SwHstryBookmark::BKMK_POS;
759
					nTyp = SwHstryBookmark::BKMK_POS;
759
760
(-)source/core/unocore/unobkm.cxx (-1 / +1 lines)
Lines 61-67 Link Here
61
#ifndef _DOCARY_HXX
61
#ifndef _DOCARY_HXX
62
#include <docary.hxx>
62
#include <docary.hxx>
63
#endif
63
#endif
64
#ifndef _SWUNDO_HXX //autogen
64
#ifndef _SWUNDO_HXX
65
#include <swundo.hxx>
65
#include <swundo.hxx>
66
#endif
66
#endif
67
#ifndef _COMCORE_HRC
67
#ifndef _COMCORE_HRC
(-)source/core/unocore/unofield.cxx (-11 / +107 lines)
Lines 52-57 Link Here
52
#ifndef _TXTFLD_HXX //autogen
52
#ifndef _TXTFLD_HXX //autogen
53
#include <txtfld.hxx>
53
#include <txtfld.hxx>
54
#endif
54
#endif
55
#ifndef _BOOKMRK_HXX
56
#include <bookmrk.hxx>
57
#endif
55
#ifndef _NDTXT_HXX //autogen
58
#ifndef _NDTXT_HXX //autogen
56
#include <ndtxt.hxx>
59
#include <ndtxt.hxx>
57
#endif
60
#endif
Lines 79-84 Link Here
79
#ifndef _VIEWSH_HXX
82
#ifndef _VIEWSH_HXX
80
#include <viewsh.hxx>
83
#include <viewsh.hxx>
81
#endif
84
#endif
85
#ifndef _SWUNDO_HXX //autogen
86
#include <swundo.hxx>
87
#endif
82
#ifndef _COMPHELPER_TYPES_HXX_
88
#ifndef _COMPHELPER_TYPES_HXX_
83
#include <comphelper/types.hxx>
89
#include <comphelper/types.hxx>
84
#endif
90
#endif
Lines 394-399 Link Here
394
	return nSrvId;
400
	return nSrvId;
395
}
401
}
396
402
403
sal_uInt16 lcl_GetServiceForField( const SwFieldBookmark& rFieldBookmark )
404
{
405
    sal_uInt16 nRet = USHRT_MAX;
406
    switch( rFieldBookmark.GetFieldResId() )
407
    {
408
        case RES_INPUTFLD:
409
        {
410
            const SwInputFieldBookmark* pInputField = dynamic_cast< const SwInputFieldBookmark* >( &rFieldBookmark );
411
            DBG_ASSERT( pInputField, "field which id and type don't match")
412
            nRet = pInputField->GetUserFieldName().getLength() ?
413
                SW_SERVICE_FIELDTYPE_INPUT_USER :
414
                SW_SERVICE_FIELDTYPE_INPUT;
415
        }
416
        break;
417
        default: DBG_ERROR("unsupported type");
418
    };
419
    return nRet;
420
}
421
397
sal_uInt16 lcl_GetPropMapIdForFieldType( USHORT nWhich )
422
sal_uInt16 lcl_GetPropMapIdForFieldType( USHORT nWhich )
398
{
423
{
399
	sal_uInt16 nId;
424
	sal_uInt16 nId;
Lines 1304-1309 Link Here
1304
{
1329
{
1305
	pDc->GetUnoCallBack()->Add(this);
1330
	pDc->GetUnoCallBack()->Add(this);
1306
}
1331
}
1332
/*-- 04.04.2007 12:24:36---------------------------------------------------
1333
1334
  -----------------------------------------------------------------------*/
1335
SwXTextField::SwXTextField( SwFieldBookmark& rFieldBookmark) :
1336
    pFmtFld(0),
1337
    aLstnrCntnr( (XTextContent*)this),
1338
    m_pDoc( rFieldBookmark.GetPos().GetDoc() ),
1339
    m_nServiceId( lcl_GetServiceForField( rFieldBookmark )),
1340
    m_bIsDescriptor(sal_False),
1341
    m_pProps(0),
1342
    m_bCallUpdate(sal_False)
1343
{
1344
    rFieldBookmark.Add( this );
1345
}
1307
/*-- 14.12.98 11:37:15---------------------------------------------------
1346
/*-- 14.12.98 11:37:15---------------------------------------------------
1308
1347
1309
  -----------------------------------------------------------------------*/
1348
  -----------------------------------------------------------------------*/
Lines 1359-1366 Link Here
1359
	vos::OGuard  aGuard(Application::GetSolarMutex());
1398
	vos::OGuard  aGuard(Application::GetSolarMutex());
1360
	OUString sRet;
1399
	OUString sRet;
1361
	const SwField* pField = GetField();
1400
	const SwField* pField = GetField();
1401
    const SwFieldBookmark* pFieldBookmark = 0;
1362
	if(pField)
1402
	if(pField)
1363
		sRet = pField->GetCntnt(bShowCommand);
1403
		sRet = pField->GetCntnt(bShowCommand);
1404
    else if( 0 != (pFieldBookmark = GetBookmarkField() ))
1405
    {
1406
        const SwTxtNode* pTxtNd = pFieldBookmark->Start()->nNode.GetNode().GetTxtNode();
1407
        if( pTxtNd )
1408
        {
1409
            xub_StrLen nStt = pFieldBookmark->Start()->nContent.GetIndex();
1410
            sRet = pTxtNd->GetExpandTxt( nStt,
1411
                    pFieldBookmark->End()->nContent.GetIndex() - nStt );
1412
        }
1413
    }
1364
	else
1414
	else
1365
		throw uno::RuntimeException();
1415
		throw uno::RuntimeException();
1366
	return sRet;
1416
	return sRet;
Lines 1765-1776 Link Here
1765
			case SW_SERVICE_FIELDTYPE_INPUT_USER:
1815
			case SW_SERVICE_FIELDTYPE_INPUT_USER:
1766
			case SW_SERVICE_FIELDTYPE_INPUT:
1816
			case SW_SERVICE_FIELDTYPE_INPUT:
1767
			{
1817
			{
1768
				SwFieldType* pFldType = pDoc->GetFldType(RES_INPUTFLD, m_sTypeName, sal_True);
1818
                pDoc->StartUndo( UNDO_INSERT, 0 );
1769
				if(!pFldType)
1819
                bool bInputUser = SW_SERVICE_FIELDTYPE_INPUT_USER == m_nServiceId;
1770
					throw uno::RuntimeException();
1820
1771
				USHORT nInpSubType = SW_SERVICE_FIELDTYPE_INPUT_USER == m_nServiceId ? INP_USR : INP_TXT;
1821
                SwFieldBookmark* pBookmarkField =
1772
				pFld = new SwInputField((SwInputFieldType*)pFldType,
1822
                    new SwInputFieldBookmark( *aPam.Start(),
1773
						m_pProps->sPar1, m_pProps->sPar2, nInpSubType);
1823
                        m_pProps->sPar2,
1824
                        bInputUser ? m_pProps->sPar2 : ::rtl::OUString());
1825
                if( pDoc->insertField( pBookmarkField ))
1826
                {
1827
                    pBookmarkField->Add(this);
1828
                    if( !bInputUser )
1829
                        pBookmarkField->setPresentation(m_pProps->sPar1 );
1830
                }
1831
                pDoc->EndUndo( UNDO_INSERT, 0 );
1774
			}
1832
			}
1775
			break;
1833
			break;
1776
			case SW_SERVICE_FIELDTYPE_MACRO:
1834
			case SW_SERVICE_FIELDTYPE_MACRO:
Lines 1881-1888 Link Here
1881
				const SwFmtFld& rFld = pTxtAttr->GetFld();
1939
				const SwFmtFld& rFld = pTxtAttr->GetFld();
1882
				pFmtFld = &rFld;
1940
				pFmtFld = &rFld;
1883
			}
1941
			}
1942
		    delete pFld;
1884
		}
1943
		}
1885
		delete pFld;
1886
1944
1887
		m_pDoc = pDoc;
1945
		m_pDoc = pDoc;
1888
		m_pDoc->GetUnoCallBack()->Add(this);
1946
		m_pDoc->GetUnoCallBack()->Add(this);
Lines 1911-1916 Link Here
1911
	vos::OGuard  aGuard(Application::GetSolarMutex());
1969
	vos::OGuard  aGuard(Application::GetSolarMutex());
1912
	uno::Reference< XTextRange >   aRef;
1970
	uno::Reference< XTextRange >   aRef;
1913
	SwField* pField = (SwField*)GetField();
1971
	SwField* pField = (SwField*)GetField();
1972
    const SwFieldBookmark* pFieldBookmark = 0;
1914
	if(pField)
1973
	if(pField)
1915
	{
1974
	{
1916
		const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld();
1975
		const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld();
Lines 1923-1928 Link Here
1923
		aRef = SwXTextRange::CreateTextRangeFromPosition(m_pDoc,
1982
		aRef = SwXTextRange::CreateTextRangeFromPosition(m_pDoc,
1924
								*aPam.GetPoint(), aPam.GetMark());
1983
								*aPam.GetPoint(), aPam.GetMark());
1925
	}
1984
	}
1985
    else if( 0 != (pFieldBookmark = GetBookmarkField() ))
1986
    {
1987
        SwPaM aPam( *pFieldBookmark->Start(), *pFieldBookmark->End(), 0 );
1988
        aRef = SwXTextRange::CreateTextRangeFromPosition(m_pDoc,
1989
                                *aPam.GetPoint(), aPam.GetMark());
1990
    }
1926
	return aRef;
1991
	return aRef;
1927
1992
1928
}
1993
}
Lines 1994-1999 Link Here
1994
{
2059
{
1995
	vos::OGuard  aGuard(Application::GetSolarMutex());
2060
	vos::OGuard  aGuard(Application::GetSolarMutex());
1996
	SwField* pField = (SwField*)GetField();
2061
	SwField* pField = (SwField*)GetField();
2062
    SwFieldBookmark* pFieldBookmark = 0;
1997
	const SfxItemPropertyMap* _pMap = aSwMapProvider.GetPropertyMap(
2063
	const SfxItemPropertyMap* _pMap = aSwMapProvider.GetPropertyMap(
1998
								lcl_GetPropertyMapOfService( m_nServiceId));
2064
								lcl_GetPropertyMapOfService( m_nServiceId));
1999
	const SfxItemPropertyMap*	pMap = SfxItemPropertyMap::GetByName(_pMap, rPropertyName);
2065
	const SfxItemPropertyMap*	pMap = SfxItemPropertyMap::GetByName(_pMap, rPropertyName);
Lines 2041-2046 Link Here
2041
            pFmtFld->GetTxtFld()->Expand();
2107
            pFmtFld->GetTxtFld()->Expand();
2042
        }
2108
        }
2043
	}
2109
	}
2110
    else if( 0 != (pFieldBookmark = GetBookmarkField() ))
2111
    {
2112
        //TODO: create equivalent to PutValueToField()
2113
        pFieldBookmark->PutValue(rValue, pMap->nWID);
2114
    }
2044
	else if(m_pProps)
2115
	else if(m_pProps)
2045
	{
2116
	{
2046
		String* pStr = 0;
2117
		String* pStr = 0;
Lines 2144-2149 Link Here
2144
	vos::OGuard  aGuard(Application::GetSolarMutex());
2215
	vos::OGuard  aGuard(Application::GetSolarMutex());
2145
	uno::Any aRet;
2216
	uno::Any aRet;
2146
	const SwField* pField = GetField();
2217
	const SwField* pField = GetField();
2218
    const SwFieldBookmark* pFieldBookmark = 0;
2147
	const SfxItemPropertyMap* _pMap = aSwMapProvider.GetPropertyMap(
2219
	const SfxItemPropertyMap* _pMap = aSwMapProvider.GetPropertyMap(
2148
								lcl_GetPropertyMapOfService( m_nServiceId));
2220
								lcl_GetPropertyMapOfService( m_nServiceId));
2149
	const SfxItemPropertyMap*	pMap = SfxItemPropertyMap::GetByName(_pMap, rPropertyName);
2221
	const SfxItemPropertyMap*	pMap = SfxItemPropertyMap::GetByName(_pMap, rPropertyName);
Lines 2211-2223 Link Here
2211
                    {
2283
                    {
2212
                        xub_StrLen nHiddenStart;
2284
                        xub_StrLen nHiddenStart;
2213
                        xub_StrLen nHiddenEnd;
2285
                        xub_StrLen nHiddenEnd;
2214
                        
2286
2215
                        SwPosition *pPos = pTxtFld->GetPosition();
2287
                        SwPosition *pPos = pTxtFld->GetPosition();
2216
                        if (!pPos)
2288
                        if (!pPos)
2217
                            throw RuntimeException();
2289
                            throw RuntimeException();
2218
2290
2219
                        bHidden = SwScriptInfo::GetBoundsOfHiddenRange( rTxtNode, 
2291
                        bHidden = SwScriptInfo::GetBoundsOfHiddenRange( rTxtNode,
2220
                                        pPos->nContent.GetIndex(), 
2292
                                        pPos->nContent.GetIndex(),
2221
                                        nHiddenStart, nHiddenEnd );
2293
                                        nHiddenStart, nHiddenEnd );
2222
                    }
2294
                    }
2223
2295
Lines 2238-2243 Link Here
2238
            else
2310
            else
2239
                pField->QueryValue( aRet, pMap->nWID );
2311
                pField->QueryValue( aRet, pMap->nWID );
2240
        }
2312
        }
2313
        else if( 0 != (pFieldBookmark = GetBookmarkField() ))
2314
        {
2315
            //TODO: Handling of special properties as above
2316
            pFieldBookmark->QueryValue(aRet, pMap->nWID);
2317
        }
2241
        else if( m_pProps )     // currently just a descriptor...
2318
        else if( m_pProps )     // currently just a descriptor...
2242
		{
2319
		{
2243
			switch(pMap->nWID)
2320
			switch(pMap->nWID)
Lines 2502-2507 Link Here
2502
		return  pFmtFld->GetFld();
2579
		return  pFmtFld->GetFld();
2503
	return 0;
2580
	return 0;
2504
}
2581
}
2582
/*-- 05.04.2007 09:15:55---------------------------------------------------
2583
2584
  -----------------------------------------------------------------------*/
2585
SwFieldBookmark* SwXTextField::GetBookmarkField() const
2586
{
2587
    return dynamic_cast<SwFieldBookmark*>(const_cast<SwModify*>(GetRegisteredIn()));
2588
}
2505
2589
2506
// #111840#
2590
// #111840#
2507
SwPosition * SwXTextField::GetPosition()
2591
SwPosition * SwXTextField::GetPosition()
Lines 2580-2586 Link Here
2580
2664
2581
sal_uInt16 lcl_GetIdByName( String& rName, String& rTypeName )
2665
sal_uInt16 lcl_GetIdByName( String& rName, String& rTypeName )
2582
{
2666
{
2583
    if( rName.EqualsAscii( COM_TEXT_FLDMASTER, 0, RTL_CONSTASCII_LENGTH(COM_TEXT_FLDMASTER )) 
2667
    if( rName.EqualsAscii( COM_TEXT_FLDMASTER, 0, RTL_CONSTASCII_LENGTH(COM_TEXT_FLDMASTER ))
2584
        ||  rName.EqualsAscii( COM_TEXT_FLDMASTER_CC, 0, RTL_CONSTASCII_LENGTH(COM_TEXT_FLDMASTER_CC )))
2668
        ||  rName.EqualsAscii( COM_TEXT_FLDMASTER_CC, 0, RTL_CONSTASCII_LENGTH(COM_TEXT_FLDMASTER_CC )))
2585
		rName.Erase(0, 30);
2669
		rName.Erase(0, 30);
2586
2670
Lines 2821-2826 Link Here
2821
{
2905
{
2822
    SwUnoCollection::Invalidate();
2906
    SwUnoCollection::Invalidate();
2823
	aRefreshCont.Disposing();
2907
	aRefreshCont.Disposing();
2908
}
2909
/*-- 04.04.2007 12:21:47---------------------------------------------------
2910
2911
  -----------------------------------------------------------------------*/
2912
SwXTextField* SwXTextFieldTypes::GetObject( SwFieldBookmark& rBkm )
2913
{
2914
    SwXTextField* pField = (SwXTextField*)SwClientIter( rBkm ).
2915
                                    First( TYPE( SwXTextField ));
2916
    if( !pField )
2917
        pField = new SwXTextField( rBkm );
2918
    return pField;
2919
2824
}
2920
}
2825
/*-- 21.12.98 10:35:17---------------------------------------------------
2921
/*-- 21.12.98 10:35:17---------------------------------------------------
2826
2922
(-)source/core/unocore/unoport.cxx (+8 lines)
Lines 444-449 Link Here
444
                    rVal = *pToSet;
444
                    rVal = *pToSet;
445
            }
445
            }
446
            break;
446
            break;
447
            //TODO: bookmark text fields should be available as cursor property
448
            case FN_UNO_TEXT_FIELD:
449
                if(xBookmarkField.is())
450
                {
451
                    rVal <<= xBookmarkField;
452
                    break;
453
                }
454
            //no break
447
            default:
455
            default:
448
                PropertyState eTemp;
456
                PropertyState eTemp;
449
                BOOL bDone = SwUnoCursorHelper::getCrsrPropertyValue(
457
                BOOL bDone = SwUnoCursorHelper::getCrsrPropertyValue(
(-)source/core/unocore/unoportenum.cxx (-12 / +161 lines)
Lines 70-75 Link Here
70
#ifndef _UNOOBJ_HXX
70
#ifndef _UNOOBJ_HXX
71
#include <unoobj.hxx>
71
#include <unoobj.hxx>
72
#endif
72
#endif
73
#ifndef _UNOFIELD_HXX
74
#include <unofield.hxx>
75
#endif
73
#ifndef _UNOREDLINE_HXX
76
#ifndef _UNOREDLINE_HXX
74
#include <unoredline.hxx>
77
#include <unoredline.hxx>
75
#endif
78
#endif
Lines 294-300 Link Here
294
	BYTE						nBkmType;
297
	BYTE						nBkmType;
295
	const SwPosition 			aPosition;
298
	const SwPosition 			aPosition;
296
299
297
	SwXBookmarkPortion_Impl( SwXBookmark* pXMark, BYTE nType, const SwPosition &rPosition ) 
300
	SwXBookmarkPortion_Impl( SwXBookmark* pXMark, BYTE nType, const SwPosition &rPosition )
298
	: xBookmark ( pXMark )
301
	: xBookmark ( pXMark )
299
	, nBkmType  ( nType )
302
	, nBkmType  ( nType )
300
	, aPosition ( rPosition )
303
	, aPosition ( rPosition )
Lines 315-321 Link Here
315
		// #i16896# for bookmark portions at the same position, the start should
318
		// #i16896# for bookmark portions at the same position, the start should
316
		// always precede the end. Hence compare positions, and use bookmark type
319
		// always precede the end. Hence compare positions, and use bookmark type
317
		// as tie-breaker for same position.
320
		// as tie-breaker for same position.
318
		// return ( r1->nIndex   == r2->nIndex ) 
321
		// return ( r1->nIndex   == r2->nIndex )
319
		//	 ? ( r1->nBkmType <  r2->nBkmType )
322
		//	 ? ( r1->nBkmType <  r2->nBkmType )
320
		//	 : ( r1->nIndex   <  r2->nIndex );
323
		//	 : ( r1->nIndex   <  r2->nIndex );
321
324
Lines 329-335 Link Here
329
	}
332
	}
330
};
333
};
331
typedef std::multiset < SwXBookmarkPortion_ImplSharedPtr, BookmarkCompareStruct > SwXBookmarkPortion_ImplList;
334
typedef std::multiset < SwXBookmarkPortion_ImplSharedPtr, BookmarkCompareStruct > SwXBookmarkPortion_ImplList;
335
//-----------------------------------------------------------------------------
336
struct SwXFieldBookmarkPortion_Impl
337
{
338
    Reference<XTextContent>     m_xField;
339
    BYTE                        m_nBkmType;
340
    const SwPosition            m_aPosition;
341
    xub_StrLen                  m_nLength;
342
343
    SwXFieldBookmarkPortion_Impl( SwXTextField* pXField, BYTE nType,
344
            const SwPosition &rPosition, xub_StrLen nLength )
345
    : m_xField ( pXField )
346
    , m_nBkmType  ( nType )
347
    , m_aPosition ( rPosition )
348
    , m_nLength( nLength )
349
    {
350
    }
351
    ULONG getIndex ()
352
    {
353
        return m_aPosition.nContent.GetIndex();
354
    }
355
};
332
356
357
typedef boost::shared_ptr < SwXFieldBookmarkPortion_Impl > SwXFieldBookmarkPortion_ImplSharedPtr;
358
struct FieldBookmarkCompareStruct
359
{
360
    bool operator () ( const SwXFieldBookmarkPortion_ImplSharedPtr &r1,
361
                       const SwXFieldBookmarkPortion_ImplSharedPtr &r2 )
362
    {
363
        return r1->m_aPosition < r2->m_aPosition;
364
    }
365
};
366
typedef std::multiset < SwXFieldBookmarkPortion_ImplSharedPtr, FieldBookmarkCompareStruct >
367
        SwXFieldBookmarkPortion_ImplList;
333
//-----------------------------------------------------------------------------
368
//-----------------------------------------------------------------------------
334
void lcl_ExportBookmark(
369
void lcl_ExportBookmark(
335
	SwXBookmarkPortion_ImplList& rBkmArr, ULONG nIndex,
370
	SwXBookmarkPortion_ImplList& rBkmArr, ULONG nIndex,
Lines 346-352 Link Here
346
		}
381
		}
347
		if ( nIndex < pPtr->getIndex() )
382
		if ( nIndex < pPtr->getIndex() )
348
			break;
383
			break;
349
		
384
350
		SwXTextPortion* pPortion;
385
		SwXTextPortion* pPortion;
351
		if(BKM_TYPE_START == pPtr->nBkmType || BKM_TYPE_START_END == pPtr->nBkmType)
386
		if(BKM_TYPE_START == pPtr->nBkmType || BKM_TYPE_START_END == pPtr->nBkmType)
352
		{
387
		{
Lines 367-372 Link Here
367
		rBkmArr.erase( aIter++ );
402
		rBkmArr.erase( aIter++ );
368
	}
403
	}
369
}
404
}
405
//-----------------------------------------------------------------------------
406
void lcl_ExportFieldBookmark(
407
    SwXFieldBookmarkPortion_ImplList& rFieldBkmArr, ULONG nIndex,
408
    SwUnoCrsr* pUnoCrsr, Reference<XText> & rParent, XTextRangeArr& rPortionArr)
409
{
410
    for ( SwXFieldBookmarkPortion_ImplList::iterator aIter = rFieldBkmArr.begin(), aEnd = rFieldBkmArr.end();
411
          aIter != aEnd; )
412
    {
413
        SwXFieldBookmarkPortion_ImplSharedPtr pPtr = (*aIter);
414
        if ( nIndex > pPtr->getIndex() )
415
        {
416
            rFieldBkmArr.erase( aIter++ );
417
            continue;
418
        }
419
        if ( nIndex < pPtr->getIndex() )
420
            break;
421
422
        SwXTextPortion* pPortion;
423
        if(BKM_TYPE_START == pPtr->m_nBkmType || BKM_TYPE_START_END == pPtr->m_nBkmType)
424
        {
425
            pUnoCrsr->Right( pPtr->m_nLength,CRSR_SKIP_CHARS,FALSE,FALSE );
426
            rPortionArr.Insert(
427
                new Reference< XTextRange >(pPortion = new SwXTextPortion(pUnoCrsr, rParent, PORTION_FIELD)),
428
                rPortionArr.Count());
429
            pPortion->SetBookmarkField( pPtr->m_xField );
430
            pPortion->SetCollapsed(BKM_TYPE_START_END == pPtr->m_nBkmType ? TRUE : FALSE);
431
            if(*pUnoCrsr->GetPoint() < *pUnoCrsr->GetMark())
432
                pUnoCrsr->Exchange();
433
            *pUnoCrsr->GetMark() = *pUnoCrsr->GetPoint();
434
435
        }
436
/*        if(BKM_TYPE_END == pPtr->m_nBkmType)
437
        {
438
            rPortionArr.Insert(
439
                new Reference< XTextRange >(pPortion = new SwXTextPortion(pUnoCrsr, rParent, PORTION_BOOKMARK_END)),
440
                rPortionArr.Count());
441
            pPortion->SetBookmark(pPtr->xBookmark);
442
        }*/
443
        rFieldBkmArr.erase( aIter++ );
444
    }
445
}
370
/* -----------------------------18.12.00 14:51--------------------------------
446
/* -----------------------------18.12.00 14:51--------------------------------
371
447
372
 ---------------------------------------------------------------------------*/
448
 ---------------------------------------------------------------------------*/
Lines 404-410 Link Here
404
	bool operator () ( const SwXRedlinePortion_ImplSharedPtr &r1,
480
	bool operator () ( const SwXRedlinePortion_ImplSharedPtr &r1,
405
					   const SwXRedlinePortion_ImplSharedPtr &r2 )
481
					   const SwXRedlinePortion_ImplSharedPtr &r2 )
406
	{
482
	{
407
		return getPosition ( r1 ) < getPosition ( r2 ); 
483
		return getPosition ( r1 ) < getPosition ( r2 );
408
	}
484
	}
409
};
485
};
410
typedef std::multiset < SwXRedlinePortion_ImplSharedPtr, RedlineCompareStruct > SwXRedlinePortion_ImplList;
486
typedef std::multiset < SwXRedlinePortion_ImplSharedPtr, RedlineCompareStruct > SwXRedlinePortion_ImplList;
Lines 419-424 Link Here
419
								const xub_StrLen& nFirstFrameIndex,
495
								const xub_StrLen& nFirstFrameIndex,
420
								SwXBookmarkPortion_ImplList& aBkmArr,
496
								SwXBookmarkPortion_ImplList& aBkmArr,
421
                                SwXRedlinePortion_ImplList& aRedArr,
497
                                SwXRedlinePortion_ImplList& aRedArr,
498
                                SwXFieldBookmarkPortion_ImplList& rFieldBkmArr,
422
                                sal_Int32 nEndPos )
499
                                sal_Int32 nEndPos )
423
{
500
{
424
	Reference<XTextRange> xRef;
501
	Reference<XTextRange> xRef;
Lines 622-627 Link Here
622
		{
699
		{
623
			nMovePos = (sal_uInt16)(*aRedArr.begin())->getRealIndex();
700
			nMovePos = (sal_uInt16)(*aRedArr.begin())->getRealIndex();
624
		}
701
		}
702
        //break up portions for field bookmarks
703
        if( rFieldBkmArr.size() && (*rFieldBkmArr.begin())->getIndex() < nMovePos )
704
            nMovePos = (sal_uInt16)(*rFieldBkmArr.begin())->getIndex();
625
        // break up if the destination is behind a frame
705
        // break up if the destination is behind a frame
626
		if(nFirstFrameIndex != STRING_MAXLEN && nMovePos > nFirstFrameIndex)
706
		if(nFirstFrameIndex != STRING_MAXLEN && nMovePos > nFirstFrameIndex)
627
			nMovePos = nFirstFrameIndex;
707
			nMovePos = nFirstFrameIndex;
Lines 644-649 Link Here
644
	return xRef;
724
	return xRef;
645
}
725
}
646
//-----------------------------------------------------------------------------
726
//-----------------------------------------------------------------------------
727
void lcl_FillFieldBookmarkArray(SwDoc& rDoc, SwUnoCrsr& rUnoCrsr,
728
                        SwXFieldBookmarkPortion_ImplList& rFieldBkmArr )
729
{
730
    const SwBookmarks& rMarks = rDoc.getBookmarks();
731
    sal_uInt16 nArrLen = rMarks.Count();
732
    if ( nArrLen > 0 )
733
    {
734
        const SwNodeIndex nOwnNode = rUnoCrsr.GetPoint()->nNode;
735
        //search for fields as bookmark - currently InputFields only
736
        for( sal_uInt16 n = 0; n < nArrLen; ++n )
737
        {
738
            SwBookmark* pMark = rMarks.GetObject( n );
739
            if( !pMark->IsFieldBookMark() )
740
                continue;
741
            SwFieldBookmark* pFieldMark = dynamic_cast< SwFieldBookmark* >( pMark );
742
743
            const SwPosition& rPos1 = *pMark->Start();
744
            const SwPosition* pPos2 = pMark->End();
745
            if(rPos1.nNode == nOwnNode)
746
            {
747
                BYTE nType = BKM_TYPE_START;
748
                DBG_ASSERT(!pPos2 || pPos2->nNode == nOwnNode,
749
                            "field bookmarks are currently limited to be inside of a paragraph")
750
751
                rFieldBkmArr.insert( SwXFieldBookmarkPortion_ImplSharedPtr (
752
                    new SwXFieldBookmarkPortion_Impl(
753
                        SwXTextFieldTypes::GetObject(*pFieldMark), nType, rPos1,
754
                                pPos2->nContent.GetIndex() - rPos1.nContent.GetIndex() )));
755
            }
756
// currently field bookmarks must not spread over different paragraphs
757
//            if(pPos2 && pPos2->nNode == nOwnNode)
758
//            {
759
//                BYTE nType = bBackward ? BKM_TYPE_START : BKM_TYPE_END;
760
//                    new SwXFieldBookmarkPortion_Impl( SwXTextFieldTypes::GetObject(*pFieldMark), nType, *pPos2 ) ) );
761
//            }
762
        }
763
    }
764
}
765
//-----------------------------------------------------------------------------
647
void lcl_FillBookmarkArray(SwDoc& rDoc,SwUnoCrsr& rUnoCrsr, SwXBookmarkPortion_ImplList& rBkmArr )
766
void lcl_FillBookmarkArray(SwDoc& rDoc,SwUnoCrsr& rUnoCrsr, SwXBookmarkPortion_ImplList& rBkmArr )
648
{
767
{
649
    const SwBookmarks& rMarks = rDoc.getBookmarks();
768
    const SwBookmarks& rMarks = rDoc.getBookmarks();
Lines 669-682 Link Here
669
					nType = BKM_TYPE_START_END;
788
					nType = BKM_TYPE_START_END;
670
				}
789
				}
671
790
672
				rBkmArr.insert ( SwXBookmarkPortion_ImplSharedPtr ( 
791
				rBkmArr.insert ( SwXBookmarkPortion_ImplSharedPtr (
673
					new SwXBookmarkPortion_Impl ( SwXBookmarks::GetObject( *pMark, &rDoc ), nType, rPos1 )));
792
					new SwXBookmarkPortion_Impl ( SwXBookmarks::GetObject( *pMark, &rDoc ), nType, rPos1 )));
674
793
675
			}
794
			}
676
			if(pPos2 && pPos2->nNode == nOwnNode)
795
			if(pPos2 && pPos2->nNode == nOwnNode)
677
			{
796
			{
678
				BYTE nType = bBackward ? BKM_TYPE_START : BKM_TYPE_END;
797
				BYTE nType = bBackward ? BKM_TYPE_START : BKM_TYPE_END;
679
				rBkmArr.insert( SwXBookmarkPortion_ImplSharedPtr ( 
798
				rBkmArr.insert( SwXBookmarkPortion_ImplSharedPtr (
680
					new SwXBookmarkPortion_Impl( SwXBookmarks::GetObject( *pMark, &rDoc ), nType, *pPos2 ) ) );
799
					new SwXBookmarkPortion_Impl( SwXBookmarks::GetObject( *pMark, &rDoc ), nType, *pPos2 ) ) );
681
			}
800
			}
682
		}
801
		}
Lines 701-710 Link Here
701
            const SwNodeIndex nRedNode = pRedStart->nNode;
820
            const SwNodeIndex nRedNode = pRedStart->nNode;
702
            IDocumentRedlineAccess::RedlineType_t nType = pRedline->GetType();
821
            IDocumentRedlineAccess::RedlineType_t nType = pRedline->GetType();
703
            if ( nOwnNode == nRedNode )
822
            if ( nOwnNode == nRedNode )
704
                rRedArr.insert( SwXRedlinePortion_ImplSharedPtr ( 
823
                rRedArr.insert( SwXRedlinePortion_ImplSharedPtr (
705
					new SwXRedlinePortion_Impl ( pRedline, TRUE) ) );
824
					new SwXRedlinePortion_Impl ( pRedline, TRUE) ) );
706
            if( pRedline->HasMark() && pRedline->End()->nNode == nOwnNode )
825
            if( pRedline->HasMark() && pRedline->End()->nNode == nOwnNode )
707
                rRedArr.insert( SwXRedlinePortion_ImplSharedPtr ( 
826
                rRedArr.insert( SwXRedlinePortion_ImplSharedPtr (
708
					new SwXRedlinePortion_Impl ( pRedline, FALSE) ) );
827
					new SwXRedlinePortion_Impl ( pRedline, FALSE) ) );
709
       }
828
       }
710
    }
829
    }
Lines 737-743 Link Here
737
				rPortionArr.Count());
856
				rPortionArr.Count());
738
			rRedlineArr.erase ( aIter++ );
857
			rRedlineArr.erase ( aIter++ );
739
		}
858
		}
740
		// MTG: 23/11/05: If we've iterated past nIndex, exit the loop 
859
		// MTG: 23/11/05: If we've iterated past nIndex, exit the loop
741
		else
860
		else
742
			break;
861
			break;
743
    }
862
    }
Lines 756-763 Link Here
756
    if (rRedlineArr.size())
875
    if (rRedlineArr.size())
757
        lcl_ExportRedline(rRedlineArr, nIndex, pUnoCrsr, rParent, rPortionArr);
876
        lcl_ExportRedline(rRedlineArr, nIndex, pUnoCrsr, rParent, rPortionArr);
758
}
877
}
878
879
/*-- 04.04.2007 13:38:34---------------------------------------------------
880
881
  -----------------------------------------------------------------------*/
882
void lcl_ExportFieldBookmarks( SwXFieldBookmarkPortion_ImplList& rFieldBkmArr,
883
    ULONG nIndex, SwUnoCrsr* pUnoCrsr,
884
    Reference<XText> & rParent, XTextRangeArr& rPortionArr )
885
{
886
    if (rFieldBkmArr.size())
887
        lcl_ExportFieldBookmark(rFieldBkmArr, nIndex, pUnoCrsr, rParent, rPortionArr);
888
}
759
//-----------------------------------------------------------------------------
889
//-----------------------------------------------------------------------------
760
sal_Int32 lcl_GetNextIndex(SwXBookmarkPortion_ImplList& rBkmArr, SwXRedlinePortion_ImplList& rRedlineArr)
890
sal_Int32 lcl_GetNextIndex(
891
    SwXBookmarkPortion_ImplList& rBkmArr,
892
    SwXRedlinePortion_ImplList& rRedlineArr,
893
    SwXFieldBookmarkPortion_ImplList& rFieldBkmArr )
761
{
894
{
762
	sal_Int32 nRet = -1;
895
	sal_Int32 nRet = -1;
763
	if(rBkmArr.size())
896
	if(rBkmArr.size())
Lines 772-777 Link Here
772
		if(nRet < 0 || nTmp < nRet)
905
		if(nRet < 0 || nTmp < nRet)
773
			nRet = nTmp;
906
			nRet = nTmp;
774
	}
907
	}
908
    if(rFieldBkmArr.size())
909
    {
910
        const SwXFieldBookmarkPortion_ImplSharedPtr pPtr = (*rFieldBkmArr.begin());
911
        sal_Int32 nTmp = pPtr->getIndex();
912
        if(nRet < 0 || nTmp < nRet)
913
            nRet = nTmp;
914
    }
775
	return nRet;
915
	return nRet;
776
};
916
};
777
//-----------------------------------------------------------------------------
917
//-----------------------------------------------------------------------------
Lines 792-801 Link Here
792
	{
932
	{
793
		SwXBookmarkPortion_ImplList aBkmArr;
933
		SwXBookmarkPortion_ImplList aBkmArr;
794
		SwXRedlinePortion_ImplList aRedArr;
934
		SwXRedlinePortion_ImplList aRedArr;
935
        SwXFieldBookmarkPortion_ImplList aFieldBkmArr;
795
936
796
		SwDoc* pDoc = pUnoCrsr->GetDoc();
937
		SwDoc* pDoc = pUnoCrsr->GetDoc();
797
		lcl_FillRedlineArray(*pDoc, *pUnoCrsr, aRedArr);
938
		lcl_FillRedlineArray(*pDoc, *pUnoCrsr, aRedArr);
798
		lcl_FillBookmarkArray(*pDoc, *pUnoCrsr, aBkmArr );
939
		lcl_FillBookmarkArray(*pDoc, *pUnoCrsr, aBkmArr );
940
        lcl_FillFieldBookmarkArray(*pDoc, *pUnoCrsr, aFieldBkmArr );
799
#if OSL_DEBUG_LEVEL > 1
941
#if OSL_DEBUG_LEVEL > 1
800
		for (SwXBookmarkPortion_ImplList::const_iterator aIter = aBkmArr.begin(), aEnd = aBkmArr.end();
942
		for (SwXBookmarkPortion_ImplList::const_iterator aIter = aBkmArr.begin(), aEnd = aBkmArr.end();
801
			 aIter != aEnd;
943
			 aIter != aEnd;
Lines 834-839 Link Here
834
					if(!pCNd->Len())
976
					if(!pCNd->Len())
835
					{
977
					{
836
						lcl_ExportBkmAndRedline(aBkmArr, aRedArr, 0, pUnoCrsr, xParent, aPortionArr);
978
						lcl_ExportBkmAndRedline(aBkmArr, aRedArr, 0, pUnoCrsr, xParent, aPortionArr);
979
                        lcl_ExportFieldBookmarks( aFieldBkmArr, 0, pUnoCrsr, xParent, aPortionArr );
837
                        // the paragraph is empty
980
                        // the paragraph is empty
838
                        xRef = new SwXTextPortion(pUnoCrsr, xParent, ePortionType);
981
                        xRef = new SwXTextPortion(pUnoCrsr, xParent, ePortionType);
839
                        // are there any frames?
982
                        // are there any frames?
Lines 894-899 Link Here
894
					if(!xRef.is())
1037
					if(!xRef.is())
895
					{
1038
					{
896
						lcl_ExportBkmAndRedline(aBkmArr, aRedArr, nCurrentIndex, pUnoCrsr, xParent, aPortionArr);
1039
						lcl_ExportBkmAndRedline(aBkmArr, aRedArr, nCurrentIndex, pUnoCrsr, xParent, aPortionArr);
1040
                        lcl_ExportFieldBookmarks( aFieldBkmArr, nCurrentIndex, pUnoCrsr, xParent, aPortionArr );
897
                        if(pHints)
1041
                        if(pHints)
898
						{
1042
						{
899
							xRef = lcl_ExportHints(pHints,
1043
							xRef = lcl_ExportHints(pHints,
Lines 905-910 Link Here
905
								nFirstFrameIndex,
1049
								nFirstFrameIndex,
906
								aBkmArr,
1050
								aBkmArr,
907
                                aRedArr,
1051
                                aRedArr,
1052
                                aFieldBkmArr,
908
                                nEndPos);
1053
                                nEndPos);
909
1054
910
						}
1055
						}
Lines 914-920 Link Here
914
						}
1059
						}
915
						else
1060
						else
916
						{
1061
						{
917
							sal_Int32 nNextIndex = lcl_GetNextIndex(aBkmArr, aRedArr);
1062
							sal_Int32 nNextIndex = lcl_GetNextIndex(aBkmArr, aRedArr, aFieldBkmArr);
918
                            DBG_ASSERT( nNextIndex <= pCNd->Len(), "illegal next index" );
1063
                            DBG_ASSERT( nNextIndex <= pCNd->Len(), "illegal next index" );
919
                            if( nNextIndex > pCNd->Len() )
1064
                            if( nNextIndex > pCNd->Len() )
920
                            {
1065
                            {
Lines 963-969 Link Here
963
				bAtEnd = sal_True;
1108
				bAtEnd = sal_True;
964
                lcl_ExportBkmAndRedline(aBkmArr, aRedArr, nLocalEnd,
1109
                lcl_ExportBkmAndRedline(aBkmArr, aRedArr, nLocalEnd,
965
											pUnoCrsr, xParent, aPortionArr);
1110
											pUnoCrsr, xParent, aPortionArr);
966
				if(ND_TEXTNODE == pNode->GetNodeType())
1111
                lcl_ExportFieldBookmarks( aFieldBkmArr, nLocalEnd,
1112
                                            pUnoCrsr, xParent, aPortionArr );
1113
1114
                if(ND_TEXTNODE == pNode->GetNodeType())
967
				{
1115
				{
968
					SwTxtNode* pTxtNode = (SwTxtNode*)pNode;
1116
					SwTxtNode* pTxtNode = (SwTxtNode*)pNode;
969
					SwpHints* pHints = pTxtNode->GetpSwpHints();
1117
					SwpHints* pHints = pTxtNode->GetpSwpHints();
Lines 979-984 Link Here
979
							STRING_MAXLEN,
1127
							STRING_MAXLEN,
980
							aBkmArr,
1128
							aBkmArr,
981
                            aRedArr,
1129
                            aRedArr,
1130
                            aFieldBkmArr,
982
                            nEndPos);
1131
                            nEndPos);
983
						if(xRef.is())
1132
						if(xRef.is())
984
							aPortionArr.Insert(new Reference<XTextRange>(xRef), aPortionArr.Count());
1133
							aPortionArr.Insert(new Reference<XTextRange>(xRef), aPortionArr.Count());
(-)source/core/view/viewsh.cxx (-4 / +15 lines)
Lines 362-368 Link Here
362
							aOrigin.X() = -aOrigin.X(); aOrigin.Y() = -aOrigin.Y();
362
							aOrigin.X() = -aOrigin.X(); aOrigin.Y() = -aOrigin.Y();
363
							aMapMode.SetOrigin( aOrigin );
363
							aMapMode.SetOrigin( aOrigin );
364
							pVout->SetMapMode( aMapMode );
364
							pVout->SetMapMode( aMapMode );
365
							
365
366
							// #i72754# start Pre/PostPaint encapsulation before pOut is changed to the buffering VDev
366
							// #i72754# start Pre/PostPaint encapsulation before pOut is changed to the buffering VDev
367
							const Region aRepaintRegion(aRect.SVRect());
367
							const Region aRepaintRegion(aRect.SVRect());
368
							DLPrePaint2(aRepaintRegion);
368
							DLPrePaint2(aRepaintRegion);
Lines 494-500 Link Here
494
				// #i72754# start Pre/PostPaint encapsulation before pOut is changed to the buffering VDev
494
				// #i72754# start Pre/PostPaint encapsulation before pOut is changed to the buffering VDev
495
				const Region aRepaintRegion(VisArea().SVRect());
495
				const Region aRepaintRegion(VisArea().SVRect());
496
				DLPrePaint2(aRepaintRegion);
496
				DLPrePaint2(aRepaintRegion);
497
				
497
498
				OutputDevice *pOld = pOut;
498
				OutputDevice *pOld = pOut;
499
				pOut = pVout;
499
				pOut = pVout;
500
				Paint( VisArea().SVRect() );
500
				Paint( VisArea().SVRect() );
Lines 1558-1564 Link Here
1558
	for ( USHORT i = 0; i < rRegion.Count(); ++i )
1558
	for ( USHORT i = 0; i < rRegion.Count(); ++i )
1559
	{
1559
	{
1560
		const Rectangle aRectangle(rRegion[i].SVRect());
1560
		const Rectangle aRectangle(rRegion[i].SVRect());
1561
		
1561
1562
		// #i68597# inform Drawinglayer about display change
1562
		// #i68597# inform Drawinglayer about display change
1563
		DLPrePaint2(Region(aRectangle));
1563
		DLPrePaint2(Region(aRectangle));
1564
		GetOut()->DrawRect(aRectangle);
1564
		GetOut()->DrawRect(aRectangle);
Lines 1828-1834 Link Here
1828
            pOut->SetLineColor();
1828
            pOut->SetLineColor();
1829
			pOut->DrawRect( rRect );
1829
			pOut->DrawRect( rRect );
1830
			pOut->Pop();
1830
			pOut->Pop();
1831
			
1831
1832
			// #i68597#
1832
			// #i68597#
1833
			DLPostPaint2();
1833
			DLPostPaint2();
1834
		}
1834
		}
Lines 2442-2447 Link Here
2442
    return nRet;
2442
    return nRet;
2443
}
2443
}
2444
// <--
2444
// <--
2445
void ViewShell::StartAction()
2446
{
2447
    if ( !nStartAction++ )
2448
        ImplStartAction();
2449
}
2450
void ViewShell::EndAction( const sal_Bool bIdleEnd )
2451
{
2452
    if( 0 == (nStartAction - 1) )
2453
        ImplEndAction( bIdleEnd );
2454
    --nStartAction;
2455
}
2445
2456
2446
/*
2457
/*
2447
 * Document Interface Access
2458
 * Document Interface Access
(-)source/filter/ww1/w1filter.cxx (-5 / +7 lines)
Lines 972-982 Link Here
972
			// das Ignorieren des Bookmarks ist nicht implementiert
972
			// das Ignorieren des Bookmarks ist nicht implementiert
973
		}
973
		}
974
		case 39: // fillin command
974
		case 39: // fillin command
975
			pField = new SwInputField(
975
            //TODO insert via API
976
				(SwInputFieldType*)rOut.GetSysFldType( RES_INPUTFLD ),
976
// TODO - SwInputField needs to be replaced by SwInputFieldBookmark
977
				aEmptyStr, sFormel,
977
//            pField = new SwInputField(
978
				INP_TXT, 0 );		// sichtbar ( geht z.Zt. nicht anders )
978
//              (SwInputFieldType*)rOut.GetSysFldType( RES_INPUTFLD ),
979
		break;
979
//              aEmptyStr, sFormel,
980
//              INP_TXT, 0 );       // sichtbar ( geht z.Zt. nicht anders )
981
        break;
980
		case 51: // macro button
982
		case 51: // macro button
981
		{
983
		{
982
			pos = aStr.Search(' ');
984
			pos = aStr.Search(' ');
(-)source/filter/ww8/ww8par3.cxx (-4 / +4 lines)
Lines 255-264 Link Here
255
        String(static_cast< sal_Unicode >(0x2002)),
255
        String(static_cast< sal_Unicode >(0x2002)),
256
        CREATE_CONST_ASC("  "));
256
        CREATE_CONST_ASC("  "));
257
257
258
    SwInputField aFld((SwInputFieldType*)rDoc.GetSysFldType( RES_INPUTFLD ),
258
//TODO: create inputfield via API
259
        aFormula.sDefault , aFormula.sTitle , INP_TXT, 0 );
259
//    SwInputField aFld((SwInputFieldType*)rDoc.GetSysFldType( RES_INPUTFLD ),
260
    rDoc.Insert(*pPaM, SwFmtFld(aFld), 0);
260
//        aFormula.sDefault , aFormula.sTitle , INP_TXT, 0 );
261
261
//    rDoc.Insert(*pPaM, SwFmtFld(aFld), 0);
262
    return FLD_OK;
262
    return FLD_OK;
263
}
263
}
264
264
(-)source/filter/ww8/ww8par5.cxx (-4 / +4 lines)
Lines 1211-1220 Link Here
1211
    if( !aDef.Len() )
1211
    if( !aDef.Len() )
1212
        aDef = GetFieldResult( pF );
1212
        aDef = GetFieldResult( pF );
1213
1213
1214
    SwInputField aFld( (SwInputFieldType*)rDoc.GetSysFldType( RES_INPUTFLD ),
1214
//TODO: create inputfield via API
1215
                        aDef, aQ, INP_TXT, 0 ); // sichtbar ( geht z.Zt. nicht anders )
1215
//    SwInputField aFld( (SwInputFieldType*)rDoc.GetSysFldType( RES_INPUTFLD ),
1216
    rDoc.Insert( *pPaM, SwFmtFld( aFld ), 0 );
1216
//                        aDef, aQ, INP_TXT, 0 ); // sichtbar ( geht z.Zt. nicht anders )
1217
1217
//    rDoc.Insert( *pPaM, SwFmtFld( aFld ), 0 );
1218
    return FLD_OK;
1218
    return FLD_OK;
1219
}
1219
}
1220
1220
(-)source/ui/fldui/fldmgr.cxx (-21 / +49 lines)
Lines 71-76 Link Here
71
#ifndef _COM_SUN_STAR_SDBC_XDATASOURCE_HPP_
71
#ifndef _COM_SUN_STAR_SDBC_XDATASOURCE_HPP_
72
#include <com/sun/star/sdbc/XDataSource.hpp>
72
#include <com/sun/star/sdbc/XDataSource.hpp>
73
#endif
73
#endif
74
#ifndef _COM_SUN_STAR_TEXT_XTEXTVIEWCURSORSUPPLIER_HPP_
75
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
76
#endif
74
#ifndef _COM_SUN_STAR_URI_XURIREFERENCEFACTORY_HPP_
77
#ifndef _COM_SUN_STAR_URI_XURIREFERENCEFACTORY_HPP_
75
#include <com/sun/star/uri/XUriReferenceFactory.hpp>
78
#include <com/sun/star/uri/XUriReferenceFactory.hpp>
76
#endif
79
#endif
Lines 86-91 Link Here
86
#ifndef _UNOTOOLS_LOCALEDATAWRAPPER_HXX
89
#ifndef _UNOTOOLS_LOCALEDATAWRAPPER_HXX
87
#include <unotools/localedatawrapper.hxx>
90
#include <unotools/localedatawrapper.hxx>
88
#endif
91
#endif
92
#ifndef _UNOPRNMS_HXX
93
#include <unoprnms.hxx>
94
#endif
89
95
90
#ifndef _SFXDISPATCH_HXX //autogen
96
#ifndef _SFXDISPATCH_HXX //autogen
91
#include <sfx2/dispatch.hxx>
97
#include <sfx2/dispatch.hxx>
Lines 206-211 Link Here
206
#endif
212
#endif
207
213
208
using namespace rtl;
214
using namespace rtl;
215
using namespace com::sun::star;
209
using namespace com::sun::star::uno;
216
using namespace com::sun::star::uno;
210
using namespace com::sun::star::container;
217
using namespace com::sun::star::container;
211
using namespace com::sun::star::lang;
218
using namespace com::sun::star::lang;
Lines 825-831 Link Here
825
				if(nCurrent > NumberingType::CHARS_LOWER_LETTER_N)
832
				if(nCurrent > NumberingType::CHARS_LOWER_LETTER_N)
826
				{
833
				{
827
                    if(nValidEntry == ((sal_Int32)nFormatId) - nOffset)
834
                    if(nValidEntry == ((sal_Int32)nFormatId) - nOffset)
828
                    {        
835
                    {
829
                        aRet = xNumberingInfo->getNumberingIdentifier( pTypes[nType] );
836
                        aRet = xNumberingInfo->getNumberingIdentifier( pTypes[nType] );
830
                        break;
837
                        break;
831
                    }
838
                    }
Lines 895-901 Link Here
895
                if(nCurrent > NumberingType::CHARS_LOWER_LETTER_N)
902
                if(nCurrent > NumberingType::CHARS_LOWER_LETTER_N)
896
                {
903
                {
897
                    if(nValidEntry == ((sal_Int32)nFormatId) - nOffset)
904
                    if(nValidEntry == ((sal_Int32)nFormatId) - nOffset)
898
                    {        
905
                    {
899
                        nId = pTypes[nType];
906
                        nId = pTypes[nType];
900
                        break;
907
                        break;
901
                    }
908
                    }
Lines 1361-1377 Link Here
1361
			}
1368
			}
1362
			else
1369
			else
1363
			{
1370
			{
1364
				SwInputFieldType* pTyp =
1371
                try
1365
                    (SwInputFieldType*)pCurShell->GetFldType(0, RES_INPUTFLD);
1372
                {
1366
1373
                    uno::Reference< frame::XModel > xModel = pCurShell->GetView().GetDocShell()->GetModel();
1367
				SwInputField* pInpFld =
1374
                    uno::Reference< lang::XMultiServiceFactory > xFactory( xModel, uno::UNO_QUERY );
1368
                    new SwInputField(pTyp, rData.sPar1, rData.sPar2, nSubType|SUB_INVISIBLE, nFormatId);
1375
                    uno::Reference< text::XTextContent > xTextField (
1369
				pFld = pInpFld;
1376
                        xFactory->createInstance(
1370
			}
1377
                        (nSubType & 0xff) == INP_TXT ?
1378
                            C2U( "com.sun.star.text.TextField.Input" ) :
1379
                            C2U( "com.sun.star.text.TextField.InputUser" )),
1380
                            uno::UNO_QUERY_THROW );
1381
                    uno::Reference< beans::XPropertySet > xTextFieldProps( xTextField, uno::UNO_QUERY );
1382
                    xTextFieldProps->setPropertyValue(
1383
                        ::rtl::OUString(SW_PROP_NAME( UNO_NAME_CONTENT), RTL_TEXTENCODING_ASCII_US ),
1384
                        uno::makeAny( ::rtl::OUString( rData.sPar1 ) ) );
1385
                    xTextFieldProps->setPropertyValue(
1386
                        ::rtl::OUString(SW_PROP_NAME( UNO_NAME_HINT ), RTL_TEXTENCODING_ASCII_US ),
1387
                        uno::makeAny( ::rtl::OUString( rData.sPar2 )));
1388
                    uno::Reference< text::XTextViewCursorSupplier > xViewCursorSupplier(
1389
                        pCurShell->GetView().GetController(), uno::UNO_QUERY );
1390
                    uno::Reference< text::XTextRange >  xTextViewCursor(
1391
                                xViewCursorSupplier->getViewCursor(), uno::UNO_QUERY_THROW );
1392
                    xTextViewCursor->getText()->insertTextContent(xTextViewCursor, xTextField, false);
1371
1393
1372
			// Dialog starten
1394
                }
1373
			//
1395
                catch( const uno::Exception& )
1374
            pCurShell->StartInputFldDlg(pFld, FALSE, rData.pParent);
1396
                {
1397
                }
1398
            }
1399
            //todo make input field dialog work again - for insertion only
1400
//            pCurShell->StartInputFldDlg(pFld, FALSE, rData.pParent);
1375
			break;
1401
			break;
1376
		}
1402
		}
1377
		case TYP_SETFLD:
1403
		case TYP_SETFLD:
Lines 1501-1519 Link Here
1501
			return FALSE;
1527
			return FALSE;
1502
		}
1528
		}
1503
	}
1529
	}
1504
	ASSERT(pFld, "Feld nicht vorhanden");
1530
    // Einfuegen
1505
1531
    pCurShell->StartAllAction();
1532
	if( pFld )
1533
    {
1534
        ASSERT(pFld, "Feld nicht vorhanden");
1506
1535
1507
     //the auto language flag has to be set prior to the language!
1508
     pFld->SetAutomaticLanguage(rData.bIsAutomaticLanguage);
1509
     USHORT nLang = GetCurrLanguage();
1510
     pFld->SetLanguage(nLang);
1511
1536
1512
	// Einfuegen
1537
         //the auto language flag has to be set prior to the language!
1513
    pCurShell->StartAllAction();
1538
         pFld->SetAutomaticLanguage(rData.bIsAutomaticLanguage);
1539
         USHORT nLang = GetCurrLanguage();
1540
         pFld->SetLanguage(nLang);
1514
1541
1515
    pCurShell->Insert(*pFld);
1516
1542
1543
        pCurShell->Insert(*pFld);
1544
    }
1517
	if(bExp && bEvalExp)
1545
	if(bExp && bEvalExp)
1518
        pCurShell->UpdateExpFlds(TRUE);
1546
        pCurShell->UpdateExpFlds(TRUE);
1519
1547
(-)source/ui/fldui/inpdlg.cxx (-23 / +25 lines)
Lines 125-147 Link Here
125
	if( RES_INPUTFLD == pField->GetTyp()->Which() )
125
	if( RES_INPUTFLD == pField->GetTyp()->Which() )
126
	{	// Es ist eine Eingabefeld
126
	{	// Es ist eine Eingabefeld
127
		//
127
		//
128
		pInpFld = (SwInputField*)pField;
128
        //TODO: Handling of bookmark base inputfields
129
		aLabelED.SetText( pInpFld->GetPar2() );
129
//      pInpFld = (SwInputField*)pField;
130
		USHORT nSubType = pInpFld->GetSubType();
130
//      aLabelED.SetText( pInpFld->GetPar2() );
131
131
//      USHORT nSubType = pInpFld->GetSubType();
132
		switch(nSubType & 0xff)
132
133
		{
133
//      switch(nSubType & 0xff)
134
			case INP_TXT:
134
//      {
135
				aStr = pInpFld->GetPar1();
135
//          case INP_TXT:
136
				break;
136
//              aStr = pInpFld->GetPar1();
137
137
//              break;
138
			case INP_USR:
138
139
				// Benutzerfeld
139
//          case INP_USR:
140
				if( 0 != ( pUsrType = (SwUserFieldType*)rSh.GetFldType(
140
//              // Benutzerfeld
141
							RES_USERFLD, pInpFld->GetPar1() ) ) )
141
//              if( 0 != ( pUsrType = (SwUserFieldType*)rSh.GetFldType(
142
					aStr = pUsrType->GetContent();
142
//                          RES_USERFLD, pInpFld->GetPar1() ) ) )
143
				break;
143
//                  aStr = pUsrType->GetContent();
144
		}
144
//              break;
145
//      }
145
	}
146
	}
146
	else
147
	else
147
	{
148
	{
Lines 202-213 Link Here
202
				bModified = TRUE;
203
				bModified = TRUE;
203
			}
204
			}
204
		}
205
		}
205
		else if( aTmp != pInpFld->GetPar1() )
206
// TODO - SwInputField replaced by SwInputFieldBookmark
206
		{
207
//        else if( aTmp != pInpFld->GetPar1() )
207
			pInpFld->SetPar1(aTmp);
208
//      {
208
			rSh.SwEditShell::UpdateFlds(*pInpFld);
209
//          pInpFld->SetPar1(aTmp);
209
			bModified = TRUE;
210
//          rSh.SwEditShell::UpdateFlds(*pInpFld);
210
		}
211
//          bModified = TRUE;
212
//      }
211
	}
213
	}
212
	else if( aTmp != pSetFld->GetPar2() )
214
	else if( aTmp != pSetFld->GetPar2() )
213
	{
215
	{
(-)source/ui/fldui/makefile.mk (+1 lines)
Lines 81-86 Link Here
81
81
82
82
83
EXCEPTIONSFILES =  \
83
EXCEPTIONSFILES =  \
84
        $(SLO)$/fldmgr.obj \
84
		$(SLO)$/xfldui.obj
85
		$(SLO)$/xfldui.obj
85
86
86
LIB1TARGET = $(SLB)$/$(TARGET).lib
87
LIB1TARGET = $(SLB)$/$(TARGET).lib
(-)source/ui/shells/textfld.cxx (+4 lines)
Lines 247-252 Link Here
247
					}
247
					}
248
				}
248
				}
249
			}
249
			}
250
            else
251
            {
252
                //find bookmark field
253
            }
250
			break;
254
			break;
251
		}
255
		}
252
		case FN_EXECUTE_MACROFIELD:
256
		case FN_EXECUTE_MACROFIELD:

Return to issue 33737