xref: /trunk/main/sw/source/core/layout/atrfrm.cxx (revision cf6516809c57e1bb0a940545cca99cdad54d4ce2)
1efeef26fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3efeef26fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4efeef26fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5efeef26fSAndrew Rist  * distributed with this work for additional information
6efeef26fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7efeef26fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8efeef26fSAndrew Rist  * "License"); you may not use this file except in compliance
9efeef26fSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11efeef26fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13efeef26fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14efeef26fSAndrew Rist  * software distributed under the License is distributed on an
15efeef26fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16efeef26fSAndrew Rist  * KIND, either express or implied.  See the License for the
17efeef26fSAndrew Rist  * specific language governing permissions and limitations
18efeef26fSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20efeef26fSAndrew Rist  *************************************************************/
21efeef26fSAndrew Rist 
22efeef26fSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sw.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <hintids.hxx>
29cdf0e10cSrcweir #include <com/sun/star/text/RelOrientation.hpp>
30cdf0e10cSrcweir #include <com/sun/star/text/VertOrientation.hpp>
31cdf0e10cSrcweir #include <com/sun/star/text/HorizontalAdjust.hpp>
32cdf0e10cSrcweir #include <com/sun/star/text/DocumentStatistic.hpp>
33cdf0e10cSrcweir #include <com/sun/star/text/HoriOrientation.hpp>
34cdf0e10cSrcweir #include <com/sun/star/text/HoriOrientationFormat.hpp>
35cdf0e10cSrcweir #include <com/sun/star/text/NotePrintMode.hpp>
36cdf0e10cSrcweir #include <com/sun/star/text/SizeType.hpp>
37cdf0e10cSrcweir #include <com/sun/star/text/VertOrientationFormat.hpp>
38cdf0e10cSrcweir #include <com/sun/star/text/WrapTextMode.hpp>
39cdf0e10cSrcweir #include <com/sun/star/text/XTextFrame.hpp>
40cdf0e10cSrcweir #include <com/sun/star/text/TextContentAnchorType.hpp>
41cdf0e10cSrcweir #include <com/sun/star/text/InvalidTextContentException.hpp>
42cdf0e10cSrcweir #include <com/sun/star/container/XIndexContainer.hpp>
43cdf0e10cSrcweir #include <com/sun/star/text/TextGridMode.hpp>
44cdf0e10cSrcweir #include <com/sun/star/awt/Size.hpp>
45cdf0e10cSrcweir #include <svtools/unoimap.hxx>
46cdf0e10cSrcweir #include <svtools/unoevent.hxx>
47cdf0e10cSrcweir #include <basic/sbxvar.hxx>
48cdf0e10cSrcweir #include <svtools/imap.hxx>
49cdf0e10cSrcweir #include <svtools/imapobj.hxx>
50cdf0e10cSrcweir #include <editeng/ulspitem.hxx>
51cdf0e10cSrcweir #include <editeng/lrspitem.hxx>
52cdf0e10cSrcweir #include <svx/svdmodel.hxx>
53cdf0e10cSrcweir #include <svx/svdpage.hxx>
543f09c2ceSJürgen Schmidt #include <svl/itemiter.hxx>
55cdf0e10cSrcweir #include <unosett.hxx>
56cdf0e10cSrcweir #include <unostyle.hxx>
57cdf0e10cSrcweir #include <fmtclds.hxx>
58cdf0e10cSrcweir #include <fmtornt.hxx>
59cdf0e10cSrcweir #include <fmthdft.hxx>
60cdf0e10cSrcweir #include <fmtpdsc.hxx>
61cdf0e10cSrcweir #include <fmtcntnt.hxx>
62cdf0e10cSrcweir #include <fmtfsize.hxx>
63cdf0e10cSrcweir #include <fmtfordr.hxx>
64cdf0e10cSrcweir #include <fmtsrnd.hxx>
65cdf0e10cSrcweir #include <fmtanchr.hxx>
66cdf0e10cSrcweir #include <fmtlsplt.hxx>
67cdf0e10cSrcweir #include <fmtrowsplt.hxx>
68cdf0e10cSrcweir #include <fmtftntx.hxx>
69cdf0e10cSrcweir #include <fmteiro.hxx>
70cdf0e10cSrcweir #include <fmturl.hxx>
71cdf0e10cSrcweir #include <fmtcnct.hxx>
72cdf0e10cSrcweir #include <node.hxx>
73cdf0e10cSrcweir #include <section.hxx>
74cdf0e10cSrcweir #include <fmtline.hxx>
75cdf0e10cSrcweir #include <tgrditem.hxx>
76cdf0e10cSrcweir #include <hfspacingitem.hxx>
77cdf0e10cSrcweir #include <doc.hxx>
78cdf0e10cSrcweir #include <IDocumentUndoRedo.hxx>
79cdf0e10cSrcweir #include <pagefrm.hxx>
80cdf0e10cSrcweir #include <rootfrm.hxx>
81cdf0e10cSrcweir #include <cntfrm.hxx>
82cdf0e10cSrcweir #include <crsrsh.hxx>
83cdf0e10cSrcweir #include <pam.hxx>
84cdf0e10cSrcweir #include <dflyobj.hxx>
85cdf0e10cSrcweir #include <dcontact.hxx>
86cdf0e10cSrcweir #include <flyfrm.hxx>
87cdf0e10cSrcweir #include <frmtool.hxx>
88cdf0e10cSrcweir #include <flyfrms.hxx>
89cdf0e10cSrcweir #include <pagedesc.hxx>
90cdf0e10cSrcweir #include <grfatr.hxx>
91cdf0e10cSrcweir #include <ndnotxt.hxx>
92cdf0e10cSrcweir #include <docary.hxx>
93cdf0e10cSrcweir #include <node2lay.hxx>
94cdf0e10cSrcweir #include <fmtclbl.hxx>
95cdf0e10cSrcweir #include <swunohelper.hxx>
96cdf0e10cSrcweir #include <unoframe.hxx>
97cdf0e10cSrcweir #include <unotextbodyhf.hxx>
98cdf0e10cSrcweir #include <SwStyleNameMapper.hxx>
99cdf0e10cSrcweir #include <editeng/brshitem.hxx>
100cdf0e10cSrcweir #include <svtools/grfmgr.hxx>
101cdf0e10cSrcweir #include <cmdid.h>
102cdf0e10cSrcweir #include <unomid.h>
103cdf0e10cSrcweir #include <comcore.hrc>
104cdf0e10cSrcweir #include <svx/svdundo.hxx> // #111827#
105cdf0e10cSrcweir #include <sortedobjs.hxx>
106cdf0e10cSrcweir #include <HandleAnchorNodeChg.hxx>
107cdf0e10cSrcweir #include <svl/cjkoptions.hxx>
108cdf0e10cSrcweir #include <switerator.hxx>
109cdf0e10cSrcweir #include <pagedeschint.hxx>
11064b14621SArmin Le Grand 
11164b14621SArmin Le Grand //UUUU
11256b35d86SArmin Le Grand #include <svx/sdr/attribute/sdrallfillattributeshelper.hxx>
11364b14621SArmin Le Grand #include <svx/xfillit0.hxx>
114cdf0e10cSrcweir 
115cdf0e10cSrcweir using namespace ::com::sun::star;
116cdf0e10cSrcweir using ::rtl::OUString;
117cdf0e10cSrcweir 
118cdf0e10cSrcweir SV_IMPL_PTRARR(SwColumns,SwColumn*)
119cdf0e10cSrcweir 
120cdf0e10cSrcweir TYPEINIT1(SwFmtVertOrient, SfxPoolItem);
121cdf0e10cSrcweir TYPEINIT1(SwFmtHoriOrient, SfxPoolItem);
122cdf0e10cSrcweir TYPEINIT2(SwFmtHeader,  SfxPoolItem, SwClient );
123cdf0e10cSrcweir TYPEINIT2(SwFmtFooter,  SfxPoolItem, SwClient );
124cdf0e10cSrcweir TYPEINIT2(SwFmtPageDesc,  SfxPoolItem, SwClient );
125cdf0e10cSrcweir TYPEINIT1_AUTOFACTORY(SwFmtLineNumber, SfxPoolItem);
126cdf0e10cSrcweir 
127cdf0e10cSrcweir /* -----------------19.05.98 09:26-------------------
128cdf0e10cSrcweir  *  Umwandlung fuer QueryValue
129cdf0e10cSrcweir  * --------------------------------------------------*/
lcl_RelToINT(sal_Int16 eRelation)130cdf0e10cSrcweir sal_Int16 lcl_RelToINT(sal_Int16 eRelation)
131cdf0e10cSrcweir {
132cdf0e10cSrcweir     sal_Int16 nRet = text::RelOrientation::FRAME;
133cdf0e10cSrcweir     switch(eRelation)
134cdf0e10cSrcweir     {
135cdf0e10cSrcweir     case  text::RelOrientation::PRINT_AREA:           nRet = text::RelOrientation::PRINT_AREA; break;
136cdf0e10cSrcweir     case  text::RelOrientation::CHAR:         nRet = text::RelOrientation::CHAR; break;
137cdf0e10cSrcweir     case  text::RelOrientation::PAGE_LEFT:        nRet = text::RelOrientation::PAGE_LEFT; break;
138cdf0e10cSrcweir     case  text::RelOrientation::PAGE_RIGHT:       nRet = text::RelOrientation::PAGE_RIGHT; break;
139cdf0e10cSrcweir     case  text::RelOrientation::FRAME_LEFT:       nRet = text::RelOrientation::FRAME_LEFT; break;
140cdf0e10cSrcweir     case  text::RelOrientation::FRAME_RIGHT:  nRet = text::RelOrientation::FRAME_RIGHT; break;
141cdf0e10cSrcweir     case  text::RelOrientation::PAGE_FRAME:       nRet = text::RelOrientation::PAGE_FRAME; break;
142cdf0e10cSrcweir     case  text::RelOrientation::PAGE_PRINT_AREA:  nRet = text::RelOrientation::PAGE_PRINT_AREA; break;
143cdf0e10cSrcweir     // OD 13.11.2003 #i22341#
144cdf0e10cSrcweir     case  text::RelOrientation::TEXT_LINE:    nRet = text::RelOrientation::TEXT_LINE; break;
145cdf0e10cSrcweir     default: break;
146cdf0e10cSrcweir     }
147cdf0e10cSrcweir     return nRet;
148cdf0e10cSrcweir }
149cdf0e10cSrcweir 
lcl_IntToRelation(const uno::Any & rVal)150cdf0e10cSrcweir sal_Int16 lcl_IntToRelation(const uno::Any& rVal)
151cdf0e10cSrcweir {
152cdf0e10cSrcweir     sal_Int16 eRet = text::RelOrientation::FRAME;
153cdf0e10cSrcweir     sal_Int16 nVal = 0;
154cdf0e10cSrcweir     rVal >>= nVal;
155cdf0e10cSrcweir     switch(nVal)
156cdf0e10cSrcweir     {
157cdf0e10cSrcweir         case  text::RelOrientation::PRINT_AREA:         eRet =   text::RelOrientation::PRINT_AREA           ; break;
158cdf0e10cSrcweir         case  text::RelOrientation::CHAR:               eRet =   text::RelOrientation::CHAR          ; break;
159cdf0e10cSrcweir         case  text::RelOrientation::PAGE_LEFT:          eRet =   text::RelOrientation::PAGE_LEFT       ; break;
160cdf0e10cSrcweir         case  text::RelOrientation::PAGE_RIGHT:         eRet =   text::RelOrientation::PAGE_RIGHT      ; break;
161cdf0e10cSrcweir         case  text::RelOrientation::FRAME_LEFT:         eRet =   text::RelOrientation::FRAME_LEFT      ; break;
162cdf0e10cSrcweir         case  text::RelOrientation::FRAME_RIGHT:        eRet =   text::RelOrientation::FRAME_RIGHT     ; break;
163cdf0e10cSrcweir         case  text::RelOrientation::PAGE_FRAME:         eRet =   text::RelOrientation::PAGE_FRAME      ; break;
164cdf0e10cSrcweir         case  text::RelOrientation::PAGE_PRINT_AREA:    eRet =   text::RelOrientation::PAGE_PRINT_AREA    ; break;
165cdf0e10cSrcweir         // OD 13.11.2003 #i22341#
166cdf0e10cSrcweir         case  text::RelOrientation::TEXT_LINE: eRet = text::RelOrientation::TEXT_LINE; break;
167cdf0e10cSrcweir     }
168cdf0e10cSrcweir     return eRet;
169cdf0e10cSrcweir }
170cdf0e10cSrcweir 
DelHFFormat(SwClient * pToRemove,SwFrmFmt * pFmt)171cdf0e10cSrcweir void DelHFFormat( SwClient *pToRemove, SwFrmFmt *pFmt )
172cdf0e10cSrcweir {
173cdf0e10cSrcweir     //Wenn der Client der letzte ist der das Format benutzt, so muss dieses
174cdf0e10cSrcweir     //vernichtet werden. Zuvor muss jedoch ggf. die Inhaltssection vernichtet
175cdf0e10cSrcweir     //werden.
176cdf0e10cSrcweir     SwDoc* pDoc = pFmt->GetDoc();
177cdf0e10cSrcweir     pFmt->Remove( pToRemove );
178cdf0e10cSrcweir     if( pDoc->IsInDtor() )
179cdf0e10cSrcweir     {
180cdf0e10cSrcweir         delete pFmt;
181cdf0e10cSrcweir         return;
182cdf0e10cSrcweir     }
183cdf0e10cSrcweir 
184cdf0e10cSrcweir     //Nur noch Frms angemeldet?
185cdf0e10cSrcweir     sal_Bool bDel = sal_True;
186cdf0e10cSrcweir     {
187cdf0e10cSrcweir         // Klammer, weil im DTOR SwClientIter das Flag bTreeChg zurueck
188cdf0e10cSrcweir         // gesetzt wird. Unguenstig, wenn das Format vorher zerstoert wird.
189cdf0e10cSrcweir         SwClientIter aIter( *pFmt );        // TODO
190cdf0e10cSrcweir         SwClient *pLast = aIter.GoStart();
191cdf0e10cSrcweir         if( pLast )
192cdf0e10cSrcweir             do {
193cdf0e10cSrcweir                 bDel = pLast->IsA( TYPE(SwFrm) )
194cdf0e10cSrcweir                     || SwXHeadFootText::IsXHeadFootText(pLast);
1952f121198SMathias Bauer             } while( bDel && 0 != ( pLast = ++aIter ));
196cdf0e10cSrcweir     }
197cdf0e10cSrcweir 
198cdf0e10cSrcweir     if ( bDel )
199cdf0e10cSrcweir     {
200cdf0e10cSrcweir         //Wenn in einem der Nodes noch ein Crsr angemeldet ist, muss das
201cdf0e10cSrcweir         //ParkCrsr einer (beliebigen) Shell gerufen werden.
202cdf0e10cSrcweir         SwFmtCntnt& rCnt = (SwFmtCntnt&)pFmt->GetCntnt();
203cdf0e10cSrcweir         if ( rCnt.GetCntntIdx() )
204cdf0e10cSrcweir         {
205cdf0e10cSrcweir             SwNode *pNode = 0;
206cdf0e10cSrcweir             {
207cdf0e10cSrcweir                 // --> OD 2008-10-07 #i92993#
208cdf0e10cSrcweir                 // Begin with start node of page header/footer to assure that
209cdf0e10cSrcweir                 // complete content is checked for cursors and the complete content
210cdf0e10cSrcweir                 // is deleted on below made method call <pDoc->DeleteSection(pNode)>
211cdf0e10cSrcweir //                SwNodeIndex aIdx( *rCnt.GetCntntIdx(), 1 );
212cdf0e10cSrcweir                 SwNodeIndex aIdx( *rCnt.GetCntntIdx(), 0 );
213cdf0e10cSrcweir                 // <--
214cdf0e10cSrcweir                 //Wenn in einem der Nodes noch ein Crsr angemeldet ist, muss das
215cdf0e10cSrcweir                 //ParkCrsr einer (beliebigen) Shell gerufen werden.
216cdf0e10cSrcweir                 pNode = & aIdx.GetNode();
217cdf0e10cSrcweir                 sal_uInt32 nEnd = pNode->EndOfSectionIndex();
218cdf0e10cSrcweir                 while ( aIdx < nEnd )
219cdf0e10cSrcweir                 {
220cdf0e10cSrcweir                     if ( pNode->IsCntntNode() &&
221cdf0e10cSrcweir                          ((SwCntntNode*)pNode)->GetDepends() )
222cdf0e10cSrcweir                     {
223cdf0e10cSrcweir                         SwCrsrShell *pShell = SwIterator<SwCrsrShell,SwCntntNode>::FirstElement( *(SwCntntNode*)pNode );
224cdf0e10cSrcweir                         if( pShell )
225cdf0e10cSrcweir                         {
226cdf0e10cSrcweir                             pShell->ParkCrsr( aIdx );
227cdf0e10cSrcweir                                 aIdx = nEnd-1;
228cdf0e10cSrcweir                         }
229cdf0e10cSrcweir                     }
230cdf0e10cSrcweir                     aIdx++;
231cdf0e10cSrcweir                     pNode = & aIdx.GetNode();
232cdf0e10cSrcweir                 }
233cdf0e10cSrcweir             }
234cdf0e10cSrcweir             rCnt.SetNewCntntIdx( (const SwNodeIndex*)0 );
235cdf0e10cSrcweir 
236cdf0e10cSrcweir             // beim Loeschen von Header/Footer-Formaten IMMER das Undo
237cdf0e10cSrcweir             // abschalten! (Bug 31069)
238cdf0e10cSrcweir             ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
239cdf0e10cSrcweir 
240cdf0e10cSrcweir             ASSERT( pNode, "Ein grosses Problem." );
241cdf0e10cSrcweir             pDoc->DeleteSection( pNode );
242cdf0e10cSrcweir         }
243cdf0e10cSrcweir         delete pFmt;
244cdf0e10cSrcweir     }
245cdf0e10cSrcweir }
246cdf0e10cSrcweir 
247cdf0e10cSrcweir //  class SwFmtFrmSize
248cdf0e10cSrcweir //  Implementierung teilweise inline im hxx
249cdf0e10cSrcweir 
SwFmtFrmSize(SwFrmSize eSize,SwTwips nWidth,SwTwips nHeight)250cdf0e10cSrcweir SwFmtFrmSize::SwFmtFrmSize( SwFrmSize eSize, SwTwips nWidth, SwTwips nHeight )
251cdf0e10cSrcweir     : SfxPoolItem( RES_FRM_SIZE ),
252cdf0e10cSrcweir     aSize( nWidth, nHeight ),
253cdf0e10cSrcweir     eFrmHeightType( eSize ),
254cdf0e10cSrcweir     eFrmWidthType( ATT_FIX_SIZE )
255cdf0e10cSrcweir {
256cdf0e10cSrcweir     nWidthPercent = nHeightPercent = 0;
257cdf0e10cSrcweir }
258cdf0e10cSrcweir 
operator =(const SwFmtFrmSize & rCpy)259cdf0e10cSrcweir SwFmtFrmSize& SwFmtFrmSize::operator=( const SwFmtFrmSize& rCpy )
260cdf0e10cSrcweir {
261cdf0e10cSrcweir     aSize = rCpy.GetSize();
262cdf0e10cSrcweir     eFrmHeightType = rCpy.GetHeightSizeType();
263cdf0e10cSrcweir     eFrmWidthType = rCpy.GetWidthSizeType();
264cdf0e10cSrcweir     nHeightPercent = rCpy.GetHeightPercent();
265cdf0e10cSrcweir     nWidthPercent  = rCpy.GetWidthPercent();
266cdf0e10cSrcweir     return *this;
267cdf0e10cSrcweir }
268cdf0e10cSrcweir 
operator ==(const SfxPoolItem & rAttr) const269cdf0e10cSrcweir int  SwFmtFrmSize::operator==( const SfxPoolItem& rAttr ) const
270cdf0e10cSrcweir {
271cdf0e10cSrcweir     ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
272cdf0e10cSrcweir     return( eFrmHeightType  == ((SwFmtFrmSize&)rAttr).eFrmHeightType &&
273cdf0e10cSrcweir             eFrmWidthType  == ((SwFmtFrmSize&)rAttr).eFrmWidthType &&
274cdf0e10cSrcweir             aSize           == ((SwFmtFrmSize&)rAttr).GetSize()&&
275cdf0e10cSrcweir             nWidthPercent   == ((SwFmtFrmSize&)rAttr).GetWidthPercent() &&
276cdf0e10cSrcweir             nHeightPercent  == ((SwFmtFrmSize&)rAttr).GetHeightPercent() );
277cdf0e10cSrcweir }
278cdf0e10cSrcweir 
Clone(SfxItemPool *) const279cdf0e10cSrcweir SfxPoolItem*  SwFmtFrmSize::Clone( SfxItemPool* ) const
280cdf0e10cSrcweir {
281cdf0e10cSrcweir     return new SwFmtFrmSize( *this );
282cdf0e10cSrcweir }
283cdf0e10cSrcweir 
284cdf0e10cSrcweir 
285cdf0e10cSrcweir /* -----------------24.04.98 11:36-------------------
286cdf0e10cSrcweir  *
287cdf0e10cSrcweir  * --------------------------------------------------*/
QueryValue(uno::Any & rVal,sal_uInt8 nMemberId) const288cdf0e10cSrcweir sal_Bool SwFmtFrmSize::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
289cdf0e10cSrcweir {
290cdf0e10cSrcweir     // hier wird immer konvertiert!
291cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
292cdf0e10cSrcweir     switch ( nMemberId )
293cdf0e10cSrcweir     {
294cdf0e10cSrcweir         case MID_FRMSIZE_SIZE:
295cdf0e10cSrcweir         {
296cdf0e10cSrcweir             awt::Size aTmp;
297cdf0e10cSrcweir             aTmp.Height = TWIP_TO_MM100(aSize.Height());
298cdf0e10cSrcweir             aTmp.Width = TWIP_TO_MM100(aSize.Width());
299cdf0e10cSrcweir             rVal.setValue(&aTmp, ::getCppuType((const awt::Size*)0));
300cdf0e10cSrcweir         }
301cdf0e10cSrcweir         break;
302cdf0e10cSrcweir         case MID_FRMSIZE_REL_HEIGHT:
303cdf0e10cSrcweir             rVal <<= (sal_Int16)(GetHeightPercent() != 0xFF ? GetHeightPercent() : 0);
304cdf0e10cSrcweir         break;
305cdf0e10cSrcweir         case MID_FRMSIZE_REL_WIDTH:
306cdf0e10cSrcweir             rVal <<= (sal_Int16)(GetWidthPercent() != 0xFF ? GetWidthPercent() : 0);
307cdf0e10cSrcweir         break;
308cdf0e10cSrcweir         case MID_FRMSIZE_IS_SYNC_HEIGHT_TO_WIDTH:
309cdf0e10cSrcweir         {
310cdf0e10cSrcweir             sal_Bool bTmp = 0xFF == GetHeightPercent();
311cdf0e10cSrcweir             rVal.setValue(&bTmp, ::getBooleanCppuType());
312cdf0e10cSrcweir         }
313cdf0e10cSrcweir         break;
314cdf0e10cSrcweir         case MID_FRMSIZE_IS_SYNC_WIDTH_TO_HEIGHT:
315cdf0e10cSrcweir         {
316cdf0e10cSrcweir             sal_Bool bTmp = 0xFF == GetWidthPercent();
317cdf0e10cSrcweir             rVal.setValue(&bTmp, ::getBooleanCppuType());
318cdf0e10cSrcweir         }
319cdf0e10cSrcweir         break;
320cdf0e10cSrcweir         case MID_FRMSIZE_WIDTH :
321cdf0e10cSrcweir             rVal <<= (sal_Int32)TWIP_TO_MM100(aSize.Width());
322cdf0e10cSrcweir         break;
323cdf0e10cSrcweir         case MID_FRMSIZE_HEIGHT:
324cdf0e10cSrcweir             // #95848# returned size should never be zero.
325cdf0e10cSrcweir             // (there was a bug that allowed for setting height to 0.
326cdf0e10cSrcweir             // Thus there some documents existing with that not allowed
327cdf0e10cSrcweir             // attribut value which may cause problems on import.)
328cdf0e10cSrcweir             rVal <<= (sal_Int32)TWIP_TO_MM100(aSize.Height() < MINLAY ? MINLAY : aSize.Height() );
329cdf0e10cSrcweir         break;
330cdf0e10cSrcweir         case MID_FRMSIZE_SIZE_TYPE:
331cdf0e10cSrcweir             rVal <<= (sal_Int16)GetHeightSizeType();
332cdf0e10cSrcweir         break;
333cdf0e10cSrcweir         case MID_FRMSIZE_IS_AUTO_HEIGHT:
334cdf0e10cSrcweir         {
335cdf0e10cSrcweir             sal_Bool bTmp = ATT_FIX_SIZE != GetHeightSizeType();
336cdf0e10cSrcweir             rVal.setValue(&bTmp, ::getBooleanCppuType());
337cdf0e10cSrcweir         }
338cdf0e10cSrcweir         break;
339cdf0e10cSrcweir         case MID_FRMSIZE_WIDTH_TYPE:
340cdf0e10cSrcweir             rVal <<= (sal_Int16)GetWidthSizeType();
341cdf0e10cSrcweir         break;
342cdf0e10cSrcweir     }
343cdf0e10cSrcweir     return sal_True;
344cdf0e10cSrcweir }
345cdf0e10cSrcweir 
346cdf0e10cSrcweir /* -----------------24.04.98 11:36-------------------
347cdf0e10cSrcweir  *
348cdf0e10cSrcweir  * --------------------------------------------------*/
PutValue(const uno::Any & rVal,sal_uInt8 nMemberId)349cdf0e10cSrcweir sal_Bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
350cdf0e10cSrcweir {
351cdf0e10cSrcweir     sal_Bool bConvert = 0 != (nMemberId&CONVERT_TWIPS);
352cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
353cdf0e10cSrcweir     sal_Bool bRet = sal_True;
354cdf0e10cSrcweir     switch ( nMemberId )
355cdf0e10cSrcweir     {
356cdf0e10cSrcweir         case MID_FRMSIZE_SIZE:
357cdf0e10cSrcweir         {
358cdf0e10cSrcweir             awt::Size aVal;
359cdf0e10cSrcweir             if(!(rVal >>= aVal))
360cdf0e10cSrcweir                 bRet = sal_False;
361cdf0e10cSrcweir             else
362cdf0e10cSrcweir             {
363cdf0e10cSrcweir                 Size aTmp(aVal.Width, aVal.Height);
364cdf0e10cSrcweir                 if(bConvert)
365cdf0e10cSrcweir                 {
366cdf0e10cSrcweir                     aTmp.Height() = MM100_TO_TWIP(aTmp.Height());
367cdf0e10cSrcweir                     aTmp.Width() = MM100_TO_TWIP(aTmp.Width());
368cdf0e10cSrcweir                 }
369cdf0e10cSrcweir                 if(aTmp.Height() && aTmp.Width())
370cdf0e10cSrcweir                     aSize = aTmp;
371cdf0e10cSrcweir                 else
372cdf0e10cSrcweir                     bRet = sal_False;
373cdf0e10cSrcweir             }
374cdf0e10cSrcweir         }
375cdf0e10cSrcweir         break;
376cdf0e10cSrcweir         case MID_FRMSIZE_REL_HEIGHT:
377cdf0e10cSrcweir         {
378cdf0e10cSrcweir             sal_Int16 nSet = 0;
379cdf0e10cSrcweir             rVal >>= nSet;
380cdf0e10cSrcweir             if(nSet >= 0 && nSet <= 0xfe)
381cdf0e10cSrcweir                 SetHeightPercent((sal_uInt8)nSet);
382cdf0e10cSrcweir             else
383cdf0e10cSrcweir                 bRet = sal_False;
384cdf0e10cSrcweir         }
385cdf0e10cSrcweir         break;
386cdf0e10cSrcweir         case MID_FRMSIZE_REL_WIDTH:
387cdf0e10cSrcweir         {
388cdf0e10cSrcweir             sal_Int16 nSet = 0;
389cdf0e10cSrcweir             rVal >>= nSet;
390cdf0e10cSrcweir             if(nSet >= 0 && nSet <= 0xfe)
391cdf0e10cSrcweir                 SetWidthPercent((sal_uInt8)nSet);
392cdf0e10cSrcweir             else
393cdf0e10cSrcweir                 bRet = sal_False;
394cdf0e10cSrcweir         }
395cdf0e10cSrcweir         break;
396cdf0e10cSrcweir         case MID_FRMSIZE_IS_SYNC_HEIGHT_TO_WIDTH:
397cdf0e10cSrcweir         {
398cdf0e10cSrcweir             sal_Bool bSet = *(sal_Bool*)rVal.getValue();
399cdf0e10cSrcweir             if(bSet)
400cdf0e10cSrcweir                 SetHeightPercent(0xff);
401cdf0e10cSrcweir             else if( 0xff == GetHeightPercent() )
402cdf0e10cSrcweir                 SetHeightPercent( 0 );
403cdf0e10cSrcweir         }
404cdf0e10cSrcweir         break;
405cdf0e10cSrcweir         case MID_FRMSIZE_IS_SYNC_WIDTH_TO_HEIGHT:
406cdf0e10cSrcweir         {
407cdf0e10cSrcweir             sal_Bool bSet = *(sal_Bool*)rVal.getValue();
408cdf0e10cSrcweir             if(bSet)
409cdf0e10cSrcweir                 SetWidthPercent(0xff);
410cdf0e10cSrcweir             else if( 0xff == GetWidthPercent() )
411cdf0e10cSrcweir                 SetWidthPercent(0);
412cdf0e10cSrcweir         }
413cdf0e10cSrcweir         break;
414cdf0e10cSrcweir         case MID_FRMSIZE_WIDTH :
415cdf0e10cSrcweir         {
416cdf0e10cSrcweir             sal_Int32 nWd = 0;
417cdf0e10cSrcweir             if(rVal >>= nWd)
418cdf0e10cSrcweir             {
419cdf0e10cSrcweir                 if(bConvert)
420cdf0e10cSrcweir                     nWd = MM100_TO_TWIP(nWd);
421cdf0e10cSrcweir                 if(nWd < MINLAY)
422cdf0e10cSrcweir                    nWd = MINLAY;
423cdf0e10cSrcweir                 aSize.Width() = nWd;
424cdf0e10cSrcweir             }
425cdf0e10cSrcweir             else
426cdf0e10cSrcweir                 bRet = sal_False;
427cdf0e10cSrcweir         }
428cdf0e10cSrcweir         break;
429cdf0e10cSrcweir         case MID_FRMSIZE_HEIGHT:
430cdf0e10cSrcweir         {
431cdf0e10cSrcweir             sal_Int32 nHg = 0;
432cdf0e10cSrcweir             if(rVal >>= nHg)
433cdf0e10cSrcweir             {
434cdf0e10cSrcweir                 if(bConvert)
435cdf0e10cSrcweir                     nHg = MM100_TO_TWIP(nHg);
436cdf0e10cSrcweir                 if(nHg < MINLAY)
437cdf0e10cSrcweir                     nHg = MINLAY;
438cdf0e10cSrcweir                 aSize.Height() = nHg;
439cdf0e10cSrcweir             }
440cdf0e10cSrcweir             else
441cdf0e10cSrcweir                 bRet = sal_False;
442cdf0e10cSrcweir         }
443cdf0e10cSrcweir         break;
444cdf0e10cSrcweir         case MID_FRMSIZE_SIZE_TYPE:
445cdf0e10cSrcweir         {
446cdf0e10cSrcweir             sal_Int16 nType = 0;
447cdf0e10cSrcweir             if((rVal >>= nType) && nType >= 0 && nType <= ATT_MIN_SIZE )
448cdf0e10cSrcweir             {
449cdf0e10cSrcweir                 SetHeightSizeType((SwFrmSize)nType);
450cdf0e10cSrcweir             }
451cdf0e10cSrcweir             else
452cdf0e10cSrcweir                 bRet = sal_False;
453cdf0e10cSrcweir         }
454cdf0e10cSrcweir         break;
455cdf0e10cSrcweir         case MID_FRMSIZE_IS_AUTO_HEIGHT:
456cdf0e10cSrcweir         {
457cdf0e10cSrcweir             sal_Bool bSet = *(sal_Bool*)rVal.getValue();
458cdf0e10cSrcweir             SetHeightSizeType(bSet ? ATT_VAR_SIZE : ATT_FIX_SIZE);
459cdf0e10cSrcweir         }
460cdf0e10cSrcweir         break;
461cdf0e10cSrcweir         case MID_FRMSIZE_WIDTH_TYPE:
462cdf0e10cSrcweir         {
463cdf0e10cSrcweir             sal_Int16 nType = 0;
464cdf0e10cSrcweir             if((rVal >>= nType) && nType >= 0 && nType <= ATT_MIN_SIZE )
465cdf0e10cSrcweir             {
466cdf0e10cSrcweir                 SetWidthSizeType((SwFrmSize)nType);
467cdf0e10cSrcweir             }
468cdf0e10cSrcweir             else
469cdf0e10cSrcweir                 bRet = sal_False;
470cdf0e10cSrcweir         }
471cdf0e10cSrcweir         break;
472cdf0e10cSrcweir         default:
473cdf0e10cSrcweir             bRet = sal_False;
474cdf0e10cSrcweir     }
475cdf0e10cSrcweir     return bRet;
476cdf0e10cSrcweir }
477cdf0e10cSrcweir 
478cdf0e10cSrcweir //  class SwFmtFillOrder
479cdf0e10cSrcweir //  Implementierung teilweise inline im hxx
480cdf0e10cSrcweir 
SwFmtFillOrder(SwFillOrder nFO)481cdf0e10cSrcweir SwFmtFillOrder::SwFmtFillOrder( SwFillOrder nFO )
482cdf0e10cSrcweir     : SfxEnumItem( RES_FILL_ORDER, sal_uInt16(nFO) )
483cdf0e10cSrcweir {}
484cdf0e10cSrcweir 
Clone(SfxItemPool *) const485cdf0e10cSrcweir SfxPoolItem*  SwFmtFillOrder::Clone( SfxItemPool* ) const
486cdf0e10cSrcweir {
487cdf0e10cSrcweir     return new SwFmtFillOrder( GetFillOrder() );
488cdf0e10cSrcweir }
489cdf0e10cSrcweir 
GetValueCount() const490cdf0e10cSrcweir sal_uInt16  SwFmtFillOrder::GetValueCount() const
491cdf0e10cSrcweir {
492cdf0e10cSrcweir     return SW_FILL_ORDER_END - SW_FILL_ORDER_BEGIN;
493cdf0e10cSrcweir }
494cdf0e10cSrcweir 
495cdf0e10cSrcweir //  class SwFmtHeader
496cdf0e10cSrcweir //  Implementierung teilweise inline im hxx
497cdf0e10cSrcweir 
SwFmtHeader(SwFrmFmt * pHeaderFmt)498cdf0e10cSrcweir SwFmtHeader::SwFmtHeader( SwFrmFmt *pHeaderFmt )
499cdf0e10cSrcweir     : SfxPoolItem( RES_HEADER ),
500cdf0e10cSrcweir     SwClient( pHeaderFmt ),
501cdf0e10cSrcweir     bActive( pHeaderFmt ? sal_True : sal_False )
502cdf0e10cSrcweir {
503cdf0e10cSrcweir }
504cdf0e10cSrcweir 
SwFmtHeader(const SwFmtHeader & rCpy)505cdf0e10cSrcweir SwFmtHeader::SwFmtHeader( const SwFmtHeader &rCpy )
506cdf0e10cSrcweir     : SfxPoolItem( RES_HEADER ),
507cdf0e10cSrcweir     SwClient( (SwModify*)rCpy.GetRegisteredIn() ),
508cdf0e10cSrcweir     bActive( rCpy.IsActive() )
509cdf0e10cSrcweir {
510cdf0e10cSrcweir }
511cdf0e10cSrcweir 
SwFmtHeader(sal_Bool bOn)512cdf0e10cSrcweir SwFmtHeader::SwFmtHeader( sal_Bool bOn )
513cdf0e10cSrcweir     : SfxPoolItem( RES_HEADER ),
514cdf0e10cSrcweir     SwClient( 0 ),
515cdf0e10cSrcweir     bActive( bOn )
516cdf0e10cSrcweir {
517cdf0e10cSrcweir }
518cdf0e10cSrcweir 
~SwFmtHeader()519cdf0e10cSrcweir  SwFmtHeader::~SwFmtHeader()
520cdf0e10cSrcweir {
521cdf0e10cSrcweir     if ( GetHeaderFmt() )
522cdf0e10cSrcweir         DelHFFormat( this, GetHeaderFmt() );
523cdf0e10cSrcweir }
524cdf0e10cSrcweir 
operator ==(const SfxPoolItem & rAttr) const525cdf0e10cSrcweir int  SwFmtHeader::operator==( const SfxPoolItem& rAttr ) const
526cdf0e10cSrcweir {
527cdf0e10cSrcweir     ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
528cdf0e10cSrcweir     return ( GetRegisteredIn() == ((SwFmtHeader&)rAttr).GetRegisteredIn() &&
529cdf0e10cSrcweir              bActive == ((SwFmtHeader&)rAttr).IsActive() );
530cdf0e10cSrcweir }
531cdf0e10cSrcweir 
Clone(SfxItemPool *) const532cdf0e10cSrcweir SfxPoolItem*  SwFmtHeader::Clone( SfxItemPool* ) const
533cdf0e10cSrcweir {
534cdf0e10cSrcweir     return new SwFmtHeader( *this );
535cdf0e10cSrcweir }
536cdf0e10cSrcweir 
RegisterToFormat(SwFmt & rFmt)537cdf0e10cSrcweir void SwFmtHeader::RegisterToFormat( SwFmt& rFmt )
538cdf0e10cSrcweir {
539cdf0e10cSrcweir     rFmt.Add(this);
540cdf0e10cSrcweir }
541cdf0e10cSrcweir 
542cdf0e10cSrcweir //  class SwFmtFooter
543cdf0e10cSrcweir //  Implementierung teilweise inline im hxx
544cdf0e10cSrcweir 
SwFmtFooter(SwFrmFmt * pFooterFmt)545cdf0e10cSrcweir SwFmtFooter::SwFmtFooter( SwFrmFmt *pFooterFmt )
546cdf0e10cSrcweir     : SfxPoolItem( RES_FOOTER ),
547cdf0e10cSrcweir     SwClient( pFooterFmt ),
548cdf0e10cSrcweir     bActive( pFooterFmt ? sal_True : sal_False )
549cdf0e10cSrcweir {
550cdf0e10cSrcweir }
551cdf0e10cSrcweir 
SwFmtFooter(const SwFmtFooter & rCpy)552cdf0e10cSrcweir SwFmtFooter::SwFmtFooter( const SwFmtFooter &rCpy )
553cdf0e10cSrcweir     : SfxPoolItem( RES_FOOTER ),
554cdf0e10cSrcweir     SwClient( (SwModify*)rCpy.GetRegisteredIn() ),
555cdf0e10cSrcweir     bActive( rCpy.IsActive() )
556cdf0e10cSrcweir {
557cdf0e10cSrcweir }
558cdf0e10cSrcweir 
SwFmtFooter(sal_Bool bOn)559cdf0e10cSrcweir SwFmtFooter::SwFmtFooter( sal_Bool bOn )
560cdf0e10cSrcweir     : SfxPoolItem( RES_FOOTER ),
561cdf0e10cSrcweir     SwClient( 0 ),
562cdf0e10cSrcweir     bActive( bOn )
563cdf0e10cSrcweir {
564cdf0e10cSrcweir }
565cdf0e10cSrcweir 
~SwFmtFooter()566cdf0e10cSrcweir  SwFmtFooter::~SwFmtFooter()
567cdf0e10cSrcweir {
568cdf0e10cSrcweir     if ( GetFooterFmt() )
569cdf0e10cSrcweir         DelHFFormat( this, GetFooterFmt() );
570cdf0e10cSrcweir }
571cdf0e10cSrcweir 
RegisterToFormat(SwFmt & rFmt)572cdf0e10cSrcweir void SwFmtFooter::RegisterToFormat( SwFmt& rFmt )
573cdf0e10cSrcweir {
574cdf0e10cSrcweir     rFmt.Add(this);
575cdf0e10cSrcweir }
576cdf0e10cSrcweir 
operator ==(const SfxPoolItem & rAttr) const577cdf0e10cSrcweir int  SwFmtFooter::operator==( const SfxPoolItem& rAttr ) const
578cdf0e10cSrcweir {
579cdf0e10cSrcweir     ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
580cdf0e10cSrcweir     return ( GetRegisteredIn() == ((SwFmtFooter&)rAttr).GetRegisteredIn() &&
581cdf0e10cSrcweir              bActive == ((SwFmtFooter&)rAttr).IsActive() );
582cdf0e10cSrcweir }
583cdf0e10cSrcweir 
Clone(SfxItemPool *) const584cdf0e10cSrcweir SfxPoolItem*  SwFmtFooter::Clone( SfxItemPool* ) const
585cdf0e10cSrcweir {
586cdf0e10cSrcweir     return new SwFmtFooter( *this );
587cdf0e10cSrcweir }
588cdf0e10cSrcweir 
589cdf0e10cSrcweir //  class SwFmtCntnt
590cdf0e10cSrcweir //  Implementierung teilweise inline im hxx
591cdf0e10cSrcweir 
SwFmtCntnt(const SwFmtCntnt & rCpy)592cdf0e10cSrcweir SwFmtCntnt::SwFmtCntnt( const SwFmtCntnt &rCpy )
593cdf0e10cSrcweir     : SfxPoolItem( RES_CNTNT )
594cdf0e10cSrcweir {
595cdf0e10cSrcweir     pStartNode = rCpy.GetCntntIdx() ?
596cdf0e10cSrcweir                     new SwNodeIndex( *rCpy.GetCntntIdx() ) : 0;
597cdf0e10cSrcweir }
598cdf0e10cSrcweir 
SwFmtCntnt(const SwStartNode * pStartNd)599cdf0e10cSrcweir SwFmtCntnt::SwFmtCntnt( const SwStartNode *pStartNd )
600cdf0e10cSrcweir     : SfxPoolItem( RES_CNTNT )
601cdf0e10cSrcweir {
602cdf0e10cSrcweir     pStartNode = pStartNd ? new SwNodeIndex( *pStartNd ) : 0;
603cdf0e10cSrcweir }
604cdf0e10cSrcweir 
~SwFmtCntnt()605cdf0e10cSrcweir  SwFmtCntnt::~SwFmtCntnt()
606cdf0e10cSrcweir {
607cdf0e10cSrcweir     delete pStartNode;
608cdf0e10cSrcweir }
609cdf0e10cSrcweir 
SetNewCntntIdx(const SwNodeIndex * pIdx)610cdf0e10cSrcweir void SwFmtCntnt::SetNewCntntIdx( const SwNodeIndex *pIdx )
611cdf0e10cSrcweir {
612cdf0e10cSrcweir     delete pStartNode;
613cdf0e10cSrcweir     pStartNode = pIdx ? new SwNodeIndex( *pIdx ) : 0;
614cdf0e10cSrcweir }
615cdf0e10cSrcweir 
operator ==(const SfxPoolItem & rAttr) const616cdf0e10cSrcweir int  SwFmtCntnt::operator==( const SfxPoolItem& rAttr ) const
617cdf0e10cSrcweir {
618cdf0e10cSrcweir     ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
619cdf0e10cSrcweir     if( (long)pStartNode ^ (long)((SwFmtCntnt&)rAttr).pStartNode )
620cdf0e10cSrcweir         return 0;
621cdf0e10cSrcweir     if( pStartNode )
622cdf0e10cSrcweir         return ( *pStartNode == *((SwFmtCntnt&)rAttr).GetCntntIdx() );
623cdf0e10cSrcweir     return 1;
624cdf0e10cSrcweir }
625cdf0e10cSrcweir 
Clone(SfxItemPool *) const626cdf0e10cSrcweir SfxPoolItem*  SwFmtCntnt::Clone( SfxItemPool* ) const
627cdf0e10cSrcweir {
628cdf0e10cSrcweir     return new SwFmtCntnt( *this );
629cdf0e10cSrcweir }
630cdf0e10cSrcweir 
631cdf0e10cSrcweir //  class SwFmtPageDesc
632cdf0e10cSrcweir //  Implementierung teilweise inline im hxx
633cdf0e10cSrcweir 
SwFmtPageDesc(const SwFmtPageDesc & rCpy)634cdf0e10cSrcweir SwFmtPageDesc::SwFmtPageDesc( const SwFmtPageDesc &rCpy )
635cdf0e10cSrcweir     : SfxPoolItem( RES_PAGEDESC ),
636cdf0e10cSrcweir     SwClient( (SwPageDesc*)rCpy.GetPageDesc() ),
637cdf0e10cSrcweir     nNumOffset( rCpy.nNumOffset ),
638cdf0e10cSrcweir     nDescNameIdx( rCpy.nDescNameIdx ),
639cdf0e10cSrcweir     pDefinedIn( 0 )
640cdf0e10cSrcweir {
641cdf0e10cSrcweir }
642cdf0e10cSrcweir 
SwFmtPageDesc(const SwPageDesc * pDesc)643cdf0e10cSrcweir SwFmtPageDesc::SwFmtPageDesc( const SwPageDesc *pDesc )
644cdf0e10cSrcweir     : SfxPoolItem( RES_PAGEDESC ),
645cdf0e10cSrcweir     SwClient( (SwPageDesc*)pDesc ),
646cdf0e10cSrcweir     nNumOffset( 0 ),
647cdf0e10cSrcweir     nDescNameIdx( 0xFFFF ), // IDX_NO_VALUE
648cdf0e10cSrcweir     pDefinedIn( 0 )
649cdf0e10cSrcweir {
650cdf0e10cSrcweir }
651cdf0e10cSrcweir 
~SwFmtPageDesc()652cdf0e10cSrcweir  SwFmtPageDesc::~SwFmtPageDesc() {}
653cdf0e10cSrcweir 
KnowsPageDesc() const654cdf0e10cSrcweir bool SwFmtPageDesc::KnowsPageDesc() const
655cdf0e10cSrcweir {
656cdf0e10cSrcweir     return (GetRegisteredIn() != 0);
657cdf0e10cSrcweir }
658cdf0e10cSrcweir 
operator ==(const SfxPoolItem & rAttr) const659cdf0e10cSrcweir int  SwFmtPageDesc::operator==( const SfxPoolItem& rAttr ) const
660cdf0e10cSrcweir {
661cdf0e10cSrcweir     ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
662cdf0e10cSrcweir     return  ( pDefinedIn == ((SwFmtPageDesc&)rAttr).pDefinedIn ) &&
663cdf0e10cSrcweir             ( nNumOffset == ((SwFmtPageDesc&)rAttr).nNumOffset ) &&
664cdf0e10cSrcweir             ( GetPageDesc() == ((SwFmtPageDesc&)rAttr).GetPageDesc() );
665cdf0e10cSrcweir }
666cdf0e10cSrcweir 
Clone(SfxItemPool *) const667cdf0e10cSrcweir SfxPoolItem*  SwFmtPageDesc::Clone( SfxItemPool* ) const
668cdf0e10cSrcweir {
669cdf0e10cSrcweir     return new SwFmtPageDesc( *this );
670cdf0e10cSrcweir }
671cdf0e10cSrcweir 
SwClientNotify(const SwModify &,const SfxHint & rHint)672cdf0e10cSrcweir void SwFmtPageDesc::SwClientNotify( const SwModify&, const SfxHint& rHint )
673cdf0e10cSrcweir {
674cdf0e10cSrcweir     const SwPageDescHint* pHint = dynamic_cast<const SwPageDescHint*>(&rHint);
675cdf0e10cSrcweir     if ( pHint )
676cdf0e10cSrcweir     {
677cdf0e10cSrcweir         // mba: shouldn't that be broadcasted also?
678cdf0e10cSrcweir         SwFmtPageDesc aDfltDesc( pHint->GetPageDesc() );
679cdf0e10cSrcweir         SwPageDesc* pDesc = pHint->GetPageDesc();
680cdf0e10cSrcweir         const SwModify* pMod = GetDefinedIn();
681cdf0e10cSrcweir         if ( pMod )
682cdf0e10cSrcweir         {
683cdf0e10cSrcweir             if( pMod->ISA( SwCntntNode ) )
684cdf0e10cSrcweir                 ((SwCntntNode*)pMod)->SetAttr( aDfltDesc );
685cdf0e10cSrcweir             else if( pMod->ISA( SwFmt ))
686cdf0e10cSrcweir                 ((SwFmt*)pMod)->SetFmtAttr( aDfltDesc );
687cdf0e10cSrcweir             else
688cdf0e10cSrcweir             {
689cdf0e10cSrcweir                 DBG_ERROR( "What kind of SwModify is this?" );
690cdf0e10cSrcweir                 RegisterToPageDesc( *pDesc );
691cdf0e10cSrcweir             }
692cdf0e10cSrcweir         }
693cdf0e10cSrcweir         else
694cdf0e10cSrcweir             // there could be an Undo-copy
695cdf0e10cSrcweir             RegisterToPageDesc( *pDesc );
696cdf0e10cSrcweir     }
697cdf0e10cSrcweir }
698cdf0e10cSrcweir 
RegisterToPageDesc(SwPageDesc & rDesc)699cdf0e10cSrcweir void SwFmtPageDesc::RegisterToPageDesc( SwPageDesc& rDesc )
700cdf0e10cSrcweir {
701cdf0e10cSrcweir     rDesc.Add( this );
702cdf0e10cSrcweir }
703cdf0e10cSrcweir 
Modify(const SfxPoolItem * pOld,const SfxPoolItem * pNew)704cdf0e10cSrcweir void SwFmtPageDesc::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
705cdf0e10cSrcweir {
706cdf0e10cSrcweir     if( !pDefinedIn )
707cdf0e10cSrcweir         return;
708cdf0e10cSrcweir 
709cdf0e10cSrcweir     const sal_uInt16 nWhichId = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
710cdf0e10cSrcweir     switch( nWhichId )
711cdf0e10cSrcweir     {
712cdf0e10cSrcweir         case RES_OBJECTDYING:
713cdf0e10cSrcweir                 //Der Pagedesc, bei dem ich angemeldet bin stirbt, ich trage
714cdf0e10cSrcweir                 //mich also bei meinem Format aus.
715cdf0e10cSrcweir                 //Dabei werden ich Deletet!!!
716cdf0e10cSrcweir             if( IS_TYPE( SwFmt, pDefinedIn ))
717cdf0e10cSrcweir #ifdef DBG_UTIL
718cdf0e10cSrcweir             {
719cdf0e10cSrcweir                 sal_Bool bDel = ((SwFmt*)pDefinedIn)->ResetFmtAttr( RES_PAGEDESC );
720cdf0e10cSrcweir                 ASSERT( bDel, ";-) FmtPageDesc nicht zerstoert." );
721cdf0e10cSrcweir             }
722cdf0e10cSrcweir #else
723cdf0e10cSrcweir                 ((SwFmt*)pDefinedIn)->ResetFmtAttr( RES_PAGEDESC );
724cdf0e10cSrcweir #endif
725cdf0e10cSrcweir             else if( IS_TYPE( SwCntntNode, pDefinedIn ))
726cdf0e10cSrcweir #ifdef DBG_UTIL
727cdf0e10cSrcweir             {
728cdf0e10cSrcweir                 sal_Bool bDel = ((SwCntntNode*)pDefinedIn)->ResetAttr( RES_PAGEDESC );
729cdf0e10cSrcweir                 ASSERT( bDel, ";-) FmtPageDesc nicht zerstoert." );
730cdf0e10cSrcweir             }
731cdf0e10cSrcweir #else
732cdf0e10cSrcweir                 ((SwCntntNode*)pDefinedIn)->ResetAttr( RES_PAGEDESC );
733cdf0e10cSrcweir #endif
734cdf0e10cSrcweir             break;
735cdf0e10cSrcweir 
736cdf0e10cSrcweir         default:
737cdf0e10cSrcweir             /* do nothing */;
738cdf0e10cSrcweir     }
739cdf0e10cSrcweir }
740cdf0e10cSrcweir 
QueryValue(uno::Any & rVal,sal_uInt8 nMemberId) const741cdf0e10cSrcweir sal_Bool SwFmtPageDesc::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
742cdf0e10cSrcweir {
743cdf0e10cSrcweir     // hier wird immer konvertiert!
744cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
745cdf0e10cSrcweir     sal_Bool    bRet = sal_True;
746cdf0e10cSrcweir     switch ( nMemberId )
747cdf0e10cSrcweir     {
748cdf0e10cSrcweir         case MID_PAGEDESC_PAGENUMOFFSET:
749cdf0e10cSrcweir             rVal <<= (sal_Int16)GetNumOffset();
750cdf0e10cSrcweir             break;
751cdf0e10cSrcweir 
752cdf0e10cSrcweir         case MID_PAGEDESC_PAGEDESCNAME:
753cdf0e10cSrcweir             {
754cdf0e10cSrcweir                 const SwPageDesc* pDesc = GetPageDesc();
755cdf0e10cSrcweir                 if( pDesc )
756cdf0e10cSrcweir                 {
757cdf0e10cSrcweir                     String aString;
758cdf0e10cSrcweir                     SwStyleNameMapper::FillProgName(pDesc->GetName(), aString, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, sal_True );
759cdf0e10cSrcweir                     rVal <<= OUString( aString );
760cdf0e10cSrcweir                 }
761cdf0e10cSrcweir                 else
762cdf0e10cSrcweir                     rVal.clear();
763cdf0e10cSrcweir             }
764cdf0e10cSrcweir             break;
765cdf0e10cSrcweir         default:
766*870262e3SDon Lewis             ASSERT( sal_False, "unknown MemberId" );
767cdf0e10cSrcweir             bRet = sal_False;
768cdf0e10cSrcweir     }
769cdf0e10cSrcweir     return bRet;
770cdf0e10cSrcweir }
771cdf0e10cSrcweir 
PutValue(const uno::Any & rVal,sal_uInt8 nMemberId)772cdf0e10cSrcweir sal_Bool SwFmtPageDesc::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
773cdf0e10cSrcweir {
774cdf0e10cSrcweir     // hier wird immer konvertiert!
775cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
776cdf0e10cSrcweir     sal_Bool bRet = sal_True;
777cdf0e10cSrcweir     switch ( nMemberId )
778cdf0e10cSrcweir     {
779cdf0e10cSrcweir         case MID_PAGEDESC_PAGENUMOFFSET:
780cdf0e10cSrcweir         {
781cdf0e10cSrcweir             sal_Int16 nOffset = 0;
782cdf0e10cSrcweir             if(rVal >>= nOffset)
783cdf0e10cSrcweir                 SetNumOffset( nOffset );
784cdf0e10cSrcweir             else
785cdf0e10cSrcweir                 bRet = sal_False;
786cdf0e10cSrcweir         }
787cdf0e10cSrcweir         break;
788cdf0e10cSrcweir 
789cdf0e10cSrcweir         case MID_PAGEDESC_PAGEDESCNAME:
790cdf0e10cSrcweir             /* geht nicht, weil das Attribut eigentlich nicht den Namen
791cdf0e10cSrcweir              * sondern einen Pointer auf den PageDesc braucht (ist Client davon).
792cdf0e10cSrcweir              * Der Pointer waere aber ueber den Namen nur vom Dokument zu erfragen.
793cdf0e10cSrcweir              */
794cdf0e10cSrcweir         default:
795*870262e3SDon Lewis             ASSERT( sal_False, "unknown MemberId" );
796cdf0e10cSrcweir             bRet = sal_False;
797cdf0e10cSrcweir     }
798cdf0e10cSrcweir     return bRet;
799cdf0e10cSrcweir }
800cdf0e10cSrcweir 
801cdf0e10cSrcweir 
802cdf0e10cSrcweir //  class SwFmtCol
803cdf0e10cSrcweir //  Implementierung teilweise inline im hxx
804cdf0e10cSrcweir 
SwColumn()805cdf0e10cSrcweir SwColumn::SwColumn() :
806cdf0e10cSrcweir     nWish ( 0 ),
807cdf0e10cSrcweir     nUpper( 0 ),
808cdf0e10cSrcweir     nLower( 0 ),
809cdf0e10cSrcweir     nLeft ( 0 ),
810cdf0e10cSrcweir     nRight( 0 )
811cdf0e10cSrcweir {
812cdf0e10cSrcweir }
813cdf0e10cSrcweir 
operator ==(const SwColumn & rCmp)814cdf0e10cSrcweir sal_Bool SwColumn::operator==( const SwColumn &rCmp )
815cdf0e10cSrcweir {
816cdf0e10cSrcweir     return (nWish    == rCmp.GetWishWidth() &&
817cdf0e10cSrcweir             GetLeft()  == rCmp.GetLeft() &&
818cdf0e10cSrcweir             GetRight() == rCmp.GetRight() &&
819cdf0e10cSrcweir             GetUpper() == rCmp.GetUpper() &&
820cdf0e10cSrcweir             GetLower() == rCmp.GetLower()) ? sal_True : sal_False;
821cdf0e10cSrcweir }
822cdf0e10cSrcweir 
SwFmtCol(const SwFmtCol & rCpy)823cdf0e10cSrcweir SwFmtCol::SwFmtCol( const SwFmtCol& rCpy )
824cdf0e10cSrcweir     : SfxPoolItem( RES_COL ),
825cdf0e10cSrcweir     nLineWidth( rCpy.nLineWidth),
826cdf0e10cSrcweir     aLineColor( rCpy.aLineColor),
827cdf0e10cSrcweir     nLineHeight( rCpy.GetLineHeight() ),
828cdf0e10cSrcweir     eAdj( rCpy.GetLineAdj() ),
829cdf0e10cSrcweir     aColumns( (sal_Int8)rCpy.GetNumCols(), 1 ),
830cdf0e10cSrcweir     nWidth( rCpy.GetWishWidth() ),
831f4689e16SPavel Janík     aWidthAdjustValue( rCpy.aWidthAdjustValue ),
832f4689e16SPavel Janík     bOrtho( rCpy.IsOrtho() )
833cdf0e10cSrcweir {
834cdf0e10cSrcweir     for ( sal_uInt16 i = 0; i < rCpy.GetNumCols(); ++i )
835cdf0e10cSrcweir     {
836cdf0e10cSrcweir         SwColumn *pCol = new SwColumn( *rCpy.GetColumns()[i] );
837cdf0e10cSrcweir         aColumns.Insert( pCol, aColumns.Count() );
838cdf0e10cSrcweir     }
839cdf0e10cSrcweir }
840cdf0e10cSrcweir 
~SwFmtCol()841cdf0e10cSrcweir SwFmtCol::~SwFmtCol() {}
842cdf0e10cSrcweir 
operator =(const SwFmtCol & rCpy)843cdf0e10cSrcweir SwFmtCol& SwFmtCol::operator=( const SwFmtCol& rCpy )
844cdf0e10cSrcweir {
845cdf0e10cSrcweir     nLineWidth  = rCpy.nLineWidth;
846cdf0e10cSrcweir     aLineColor  = rCpy.aLineColor;
847cdf0e10cSrcweir     nLineHeight = rCpy.GetLineHeight();
848cdf0e10cSrcweir     eAdj        = rCpy.GetLineAdj();
849cdf0e10cSrcweir     nWidth      = rCpy.GetWishWidth();
850cdf0e10cSrcweir     bOrtho      = rCpy.IsOrtho();
8515825e24fSJian Hong Cheng     aWidthAdjustValue = rCpy.aWidthAdjustValue;
852cdf0e10cSrcweir 
853cdf0e10cSrcweir     if ( aColumns.Count() )
854cdf0e10cSrcweir         aColumns.DeleteAndDestroy( 0, aColumns.Count() );
855cdf0e10cSrcweir     for ( sal_uInt16 i = 0; i < rCpy.GetNumCols(); ++i )
856cdf0e10cSrcweir     {
857cdf0e10cSrcweir         SwColumn *pCol = new SwColumn( *rCpy.GetColumns()[i] );
858cdf0e10cSrcweir         aColumns.Insert( pCol, aColumns.Count() );
859cdf0e10cSrcweir     }
860cdf0e10cSrcweir     return *this;
861cdf0e10cSrcweir }
862cdf0e10cSrcweir 
SwFmtCol()863cdf0e10cSrcweir SwFmtCol::SwFmtCol()
864cdf0e10cSrcweir     : SfxPoolItem( RES_COL ),
865cdf0e10cSrcweir     nLineWidth(0),
866cdf0e10cSrcweir     nLineHeight( 100 ),
867cdf0e10cSrcweir     eAdj( COLADJ_NONE ),
868cdf0e10cSrcweir     nWidth( USHRT_MAX ),
869f4689e16SPavel Janík     aWidthAdjustValue( 0 ),
870f4689e16SPavel Janík     bOrtho( sal_True )
871cdf0e10cSrcweir {
872cdf0e10cSrcweir }
873cdf0e10cSrcweir 
operator ==(const SfxPoolItem & rAttr) const874cdf0e10cSrcweir int SwFmtCol::operator==( const SfxPoolItem& rAttr ) const
875cdf0e10cSrcweir {
876cdf0e10cSrcweir     ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
877cdf0e10cSrcweir     const SwFmtCol &rCmp = (const SwFmtCol&)rAttr;
878cdf0e10cSrcweir     if( !(nLineWidth        == rCmp.nLineWidth  &&
879cdf0e10cSrcweir           aLineColor        == rCmp.aLineColor  &&
880cdf0e10cSrcweir           nLineHeight        == rCmp.GetLineHeight() &&
881cdf0e10cSrcweir           eAdj               == rCmp.GetLineAdj() &&
882cdf0e10cSrcweir           nWidth             == rCmp.GetWishWidth() &&
883cdf0e10cSrcweir           bOrtho             == rCmp.IsOrtho() &&
8845825e24fSJian Hong Cheng           aColumns.Count() == rCmp.GetNumCols() &&
8855825e24fSJian Hong Cheng           aWidthAdjustValue == rCmp.GetAdjustValue()
8865825e24fSJian Hong Cheng          ) )
887cdf0e10cSrcweir         return 0;
888cdf0e10cSrcweir 
889cdf0e10cSrcweir     for ( sal_uInt16 i = 0; i < aColumns.Count(); ++i )
890cdf0e10cSrcweir         if ( !(*aColumns[i] == *rCmp.GetColumns()[i]) )
891cdf0e10cSrcweir             return 0;
892cdf0e10cSrcweir 
893cdf0e10cSrcweir     return 1;
894cdf0e10cSrcweir }
895cdf0e10cSrcweir 
Clone(SfxItemPool *) const896cdf0e10cSrcweir SfxPoolItem*  SwFmtCol::Clone( SfxItemPool* ) const
897cdf0e10cSrcweir {
898cdf0e10cSrcweir     return new SwFmtCol( *this );
899cdf0e10cSrcweir }
900cdf0e10cSrcweir 
GetGutterWidth(sal_Bool bMin) const901cdf0e10cSrcweir sal_uInt16 SwFmtCol::GetGutterWidth( sal_Bool bMin ) const
902cdf0e10cSrcweir {
903cdf0e10cSrcweir     sal_uInt16 nRet = 0;
904cdf0e10cSrcweir     if ( aColumns.Count() == 2 )
905cdf0e10cSrcweir         nRet = aColumns[0]->GetRight() + aColumns[1]->GetLeft();
906cdf0e10cSrcweir     else if ( aColumns.Count() > 2 )
907cdf0e10cSrcweir     {
908cdf0e10cSrcweir         sal_Bool bSet = sal_False;
909cdf0e10cSrcweir         for ( sal_uInt16 i = 1; i < aColumns.Count()-1; ++i )
910cdf0e10cSrcweir         {
911cdf0e10cSrcweir             const sal_uInt16 nTmp = aColumns[i]->GetRight() + aColumns[i+1]->GetLeft();
912cdf0e10cSrcweir             if ( bSet )
913cdf0e10cSrcweir             {
914cdf0e10cSrcweir                 if ( nTmp != nRet )
915cdf0e10cSrcweir                 {
916cdf0e10cSrcweir                     if ( !bMin )
917cdf0e10cSrcweir                         return USHRT_MAX;
918cdf0e10cSrcweir                     if ( nRet > nTmp )
919cdf0e10cSrcweir                         nRet = nTmp;
920cdf0e10cSrcweir                 }
921cdf0e10cSrcweir             }
922cdf0e10cSrcweir             else
923cdf0e10cSrcweir             {   bSet = sal_True;
924cdf0e10cSrcweir                 nRet = nTmp;
925cdf0e10cSrcweir             }
926cdf0e10cSrcweir         }
927cdf0e10cSrcweir     }
928cdf0e10cSrcweir     return nRet;
929cdf0e10cSrcweir }
930cdf0e10cSrcweir 
SetGutterWidth(sal_uInt16 nNew,sal_uInt16 nAct)931cdf0e10cSrcweir void SwFmtCol::SetGutterWidth( sal_uInt16 nNew, sal_uInt16 nAct )
932cdf0e10cSrcweir {
933cdf0e10cSrcweir     if ( bOrtho )
934cdf0e10cSrcweir         Calc( nNew, nAct );
935cdf0e10cSrcweir     else
936cdf0e10cSrcweir     {
937cdf0e10cSrcweir         sal_uInt16 nHalf = nNew / 2;
938cdf0e10cSrcweir         for ( sal_uInt16 i = 0; i < aColumns.Count(); ++i )
939cdf0e10cSrcweir         {   SwColumn *pCol = aColumns[i];
940cdf0e10cSrcweir             pCol->SetLeft ( nHalf );
941cdf0e10cSrcweir             pCol->SetRight( nHalf );
942cdf0e10cSrcweir             if ( i == 0 )
943cdf0e10cSrcweir                 pCol->SetLeft( 0 );
944cdf0e10cSrcweir             else if ( i == (aColumns.Count() - 1) )
945cdf0e10cSrcweir                 pCol->SetRight( 0 );
946cdf0e10cSrcweir         }
947cdf0e10cSrcweir     }
948cdf0e10cSrcweir }
949cdf0e10cSrcweir 
Init(sal_uInt16 nNumCols,sal_uInt16 nGutterWidth,sal_uInt16 nAct)950cdf0e10cSrcweir void SwFmtCol::Init( sal_uInt16 nNumCols, sal_uInt16 nGutterWidth, sal_uInt16 nAct )
951cdf0e10cSrcweir {
952cdf0e10cSrcweir     //Loeschen scheint hier auf den erste Blick vielleicht etwas zu heftig;
953cdf0e10cSrcweir     //anderfalls muessten allerdings alle Werte der verbleibenden SwColumn's
954cdf0e10cSrcweir     //initialisiert werden.
955cdf0e10cSrcweir     if ( aColumns.Count() )
956cdf0e10cSrcweir         aColumns.DeleteAndDestroy( 0, aColumns.Count() );
957cdf0e10cSrcweir     for ( sal_uInt16 i = 0; i < nNumCols; ++i )
958cdf0e10cSrcweir     {   SwColumn *pCol = new SwColumn;
959cdf0e10cSrcweir         aColumns.Insert( pCol, i );
960cdf0e10cSrcweir     }
961cdf0e10cSrcweir     bOrtho = sal_True;
962cdf0e10cSrcweir     nWidth = USHRT_MAX;
963cdf0e10cSrcweir     if( nNumCols )
964cdf0e10cSrcweir         Calc( nGutterWidth, nAct );
965cdf0e10cSrcweir }
966cdf0e10cSrcweir 
SetOrtho(sal_Bool bNew,sal_uInt16 nGutterWidth,sal_uInt16 nAct)967cdf0e10cSrcweir void SwFmtCol::SetOrtho( sal_Bool bNew, sal_uInt16 nGutterWidth, sal_uInt16 nAct )
968cdf0e10cSrcweir {
969cdf0e10cSrcweir     bOrtho = bNew;
970cdf0e10cSrcweir     if ( bNew && aColumns.Count() )
971cdf0e10cSrcweir         Calc( nGutterWidth, nAct );
972cdf0e10cSrcweir }
973cdf0e10cSrcweir 
CalcColWidth(sal_uInt16 nCol,sal_uInt16 nAct) const974cdf0e10cSrcweir sal_uInt16 SwFmtCol::CalcColWidth( sal_uInt16 nCol, sal_uInt16 nAct ) const
975cdf0e10cSrcweir {
976cdf0e10cSrcweir     ASSERT( nCol < aColumns.Count(), ":-( ColumnsArr ueberindiziert." );
977cdf0e10cSrcweir     if ( nWidth != nAct )
978cdf0e10cSrcweir     {
979cdf0e10cSrcweir         long nW = aColumns[nCol]->GetWishWidth();
980cdf0e10cSrcweir         nW *= nAct;
981cdf0e10cSrcweir         nW /= nWidth;
982cdf0e10cSrcweir         return sal_uInt16(nW);
983cdf0e10cSrcweir     }
984cdf0e10cSrcweir     else
985cdf0e10cSrcweir         return aColumns[nCol]->GetWishWidth();
986cdf0e10cSrcweir }
987cdf0e10cSrcweir 
CalcPrtColWidth(sal_uInt16 nCol,sal_uInt16 nAct) const988cdf0e10cSrcweir sal_uInt16 SwFmtCol::CalcPrtColWidth( sal_uInt16 nCol, sal_uInt16 nAct ) const
989cdf0e10cSrcweir {
990cdf0e10cSrcweir     ASSERT( nCol < aColumns.Count(), ":-( ColumnsArr ueberindiziert." );
991cdf0e10cSrcweir     sal_uInt16 nRet = CalcColWidth( nCol, nAct );
992cdf0e10cSrcweir     SwColumn *pCol = aColumns[nCol];
993cdf0e10cSrcweir     nRet = nRet - pCol->GetLeft();
994cdf0e10cSrcweir     nRet = nRet - pCol->GetRight();
995cdf0e10cSrcweir     return nRet;
996cdf0e10cSrcweir }
997cdf0e10cSrcweir 
Calc(sal_uInt16 nGutterWidth,sal_uInt16 nAct)998cdf0e10cSrcweir void SwFmtCol::Calc( sal_uInt16 nGutterWidth, sal_uInt16 nAct )
999cdf0e10cSrcweir {
1000cdf0e10cSrcweir     if(!GetNumCols())
1001cdf0e10cSrcweir         return;
1002cdf0e10cSrcweir     //Erstmal die Spalten mit der Aktuellen Breite einstellen, dann die
1003cdf0e10cSrcweir     //Wunschbreite der Spalten anhand der Gesamtwunschbreite hochrechnen.
1004cdf0e10cSrcweir 
1005cdf0e10cSrcweir     const sal_uInt16 nGutterHalf = nGutterWidth ? nGutterWidth / 2 : 0;
1006cdf0e10cSrcweir 
1007cdf0e10cSrcweir     //Breite der PrtAreas ist Gesamtbreite - Zwischenraeume / Anzahl
1008cdf0e10cSrcweir     const sal_uInt16 nPrtWidth =
1009cdf0e10cSrcweir                 (nAct - ((GetNumCols()-1) * nGutterWidth)) / GetNumCols();
1010cdf0e10cSrcweir     sal_uInt16 nAvail = nAct;
1011cdf0e10cSrcweir 
1012cdf0e10cSrcweir     //Die erste Spalte ist PrtBreite + (Zwischenraumbreite/2)
1013cdf0e10cSrcweir     const sal_uInt16 nLeftWidth = nPrtWidth + nGutterHalf;
1014cdf0e10cSrcweir     SwColumn *pCol = aColumns[0];
1015cdf0e10cSrcweir     pCol->SetWishWidth( nLeftWidth );
1016cdf0e10cSrcweir     pCol->SetRight( nGutterHalf );
1017cdf0e10cSrcweir     pCol->SetLeft ( 0 );
1018cdf0e10cSrcweir     nAvail = nAvail - nLeftWidth;
1019cdf0e10cSrcweir 
1020cdf0e10cSrcweir     //Spalte 2 bis n-1 ist PrtBreite + Zwischenraumbreite
1021cdf0e10cSrcweir     const sal_uInt16 nMidWidth = nPrtWidth + nGutterWidth;
1022cdf0e10cSrcweir     sal_uInt16 i;
1023cdf0e10cSrcweir 
1024cdf0e10cSrcweir     for ( i = 1; i < GetNumCols()-1; ++i )
1025cdf0e10cSrcweir     {
1026cdf0e10cSrcweir         pCol = aColumns[i];
1027cdf0e10cSrcweir         pCol->SetWishWidth( nMidWidth );
1028cdf0e10cSrcweir         pCol->SetLeft ( nGutterHalf );
1029cdf0e10cSrcweir         pCol->SetRight( nGutterHalf );
1030cdf0e10cSrcweir         nAvail = nAvail - nMidWidth;
1031cdf0e10cSrcweir     }
1032cdf0e10cSrcweir 
1033cdf0e10cSrcweir     //Die Letzte Spalte entspricht wieder der ersten, um Rundungsfehler
1034cdf0e10cSrcweir     //auszugleichen wird der letzten Spalte alles zugeschlagen was die
1035cdf0e10cSrcweir     //anderen nicht verbraucht haben.
1036cdf0e10cSrcweir     pCol = aColumns[aColumns.Count()-1];
1037cdf0e10cSrcweir     pCol->SetWishWidth( nAvail );
1038cdf0e10cSrcweir     pCol->SetLeft ( nGutterHalf );
1039cdf0e10cSrcweir     pCol->SetRight( 0 );
1040cdf0e10cSrcweir 
1041cdf0e10cSrcweir     //Umrechnen der aktuellen Breiten in Wunschbreiten.
1042cdf0e10cSrcweir     for ( i = 0; i < aColumns.Count(); ++i )
1043cdf0e10cSrcweir     {
1044cdf0e10cSrcweir         pCol = aColumns[i];
1045cdf0e10cSrcweir         long nTmp = pCol->GetWishWidth();
1046cdf0e10cSrcweir         nTmp *= GetWishWidth();
1047cdf0e10cSrcweir         nTmp /= nAct;
1048cdf0e10cSrcweir         pCol->SetWishWidth( sal_uInt16(nTmp) );
1049cdf0e10cSrcweir     }
1050cdf0e10cSrcweir }
1051cdf0e10cSrcweir 
QueryValue(uno::Any & rVal,sal_uInt8 nMemberId) const1052cdf0e10cSrcweir sal_Bool SwFmtCol::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1053cdf0e10cSrcweir {
1054cdf0e10cSrcweir     // hier wird immer konvertiert!
1055cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
1056cdf0e10cSrcweir     if(MID_COLUMN_SEPARATOR_LINE == nMemberId)
1057cdf0e10cSrcweir     {
1058cdf0e10cSrcweir         DBG_ERROR("not implemented");
1059cdf0e10cSrcweir     }
1060cdf0e10cSrcweir     else
1061cdf0e10cSrcweir     {
1062cdf0e10cSrcweir         uno::Reference< text::XTextColumns >  xCols = new SwXTextColumns(*this);
1063cdf0e10cSrcweir         rVal.setValue(&xCols, ::getCppuType((uno::Reference< text::XTextColumns>*)0));
1064cdf0e10cSrcweir     }
1065cdf0e10cSrcweir     return sal_True;
1066cdf0e10cSrcweir }
1067cdf0e10cSrcweir 
PutValue(const uno::Any & rVal,sal_uInt8 nMemberId)1068cdf0e10cSrcweir sal_Bool SwFmtCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1069cdf0e10cSrcweir {
1070cdf0e10cSrcweir     // hier wird immer konvertiert!
1071cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
1072cdf0e10cSrcweir     sal_Bool bRet = sal_False;
1073cdf0e10cSrcweir     if(MID_COLUMN_SEPARATOR_LINE == nMemberId)
1074cdf0e10cSrcweir     {
1075cdf0e10cSrcweir         DBG_ERROR("not implemented");
1076cdf0e10cSrcweir     }
1077cdf0e10cSrcweir     else
1078cdf0e10cSrcweir     {
1079cdf0e10cSrcweir         uno::Reference< text::XTextColumns > xCols;
1080cdf0e10cSrcweir         rVal >>= xCols;
1081cdf0e10cSrcweir         if(xCols.is())
1082cdf0e10cSrcweir         {
1083cdf0e10cSrcweir             uno::Sequence<text::TextColumn> aSetColumns = xCols->getColumns();
1084cdf0e10cSrcweir             const text::TextColumn* pArray = aSetColumns.getConstArray();
1085cdf0e10cSrcweir             aColumns.DeleteAndDestroy(0, aColumns.Count());
1086cdf0e10cSrcweir             //max. Count ist hier 64K - das kann das Array aber nicht
1087cdf0e10cSrcweir             sal_uInt16 nCount = Min( (sal_uInt16)aSetColumns.getLength(),
1088cdf0e10cSrcweir                                      (sal_uInt16) 0x3fff );
1089cdf0e10cSrcweir             sal_uInt16 nWidthSum = 0;
1090cdf0e10cSrcweir             // #101224# one column is no column
1091cdf0e10cSrcweir             //
1092cdf0e10cSrcweir             if(nCount > 1)
1093cdf0e10cSrcweir                 for(sal_uInt16 i = 0; i < nCount; i++)
1094cdf0e10cSrcweir                 {
1095cdf0e10cSrcweir                     SwColumn* pCol = new SwColumn;
1096cdf0e10cSrcweir                     pCol->SetWishWidth( static_cast<sal_uInt16>(pArray[i].Width) );
1097cdf0e10cSrcweir                     nWidthSum = static_cast<sal_uInt16>(nWidthSum + pArray[i].Width);
1098cdf0e10cSrcweir                     pCol->SetLeft ( static_cast<sal_uInt16>(MM100_TO_TWIP(pArray[i].LeftMargin)) );
1099cdf0e10cSrcweir                     pCol->SetRight( static_cast<sal_uInt16>(MM100_TO_TWIP(pArray[i].RightMargin)) );
1100cdf0e10cSrcweir                     aColumns.Insert(pCol, i);
1101cdf0e10cSrcweir                 }
1102cdf0e10cSrcweir             bRet = sal_True;
1103cdf0e10cSrcweir             nWidth = nWidthSum;
1104cdf0e10cSrcweir             bOrtho = sal_False;
1105cdf0e10cSrcweir 
1106cdf0e10cSrcweir             uno::Reference<lang::XUnoTunnel> xNumTunnel(xCols, uno::UNO_QUERY);
1107cdf0e10cSrcweir             SwXTextColumns* pSwColums = 0;
1108cdf0e10cSrcweir             if(xNumTunnel.is())
1109cdf0e10cSrcweir             {
1110cdf0e10cSrcweir                 pSwColums = reinterpret_cast< SwXTextColumns * >(
1111cdf0e10cSrcweir                     sal::static_int_cast< sal_IntPtr >(
1112cdf0e10cSrcweir                     xNumTunnel->getSomething( SwXTextColumns::getUnoTunnelId() )));
1113cdf0e10cSrcweir             }
1114cdf0e10cSrcweir             if(pSwColums)
1115cdf0e10cSrcweir             {
1116cdf0e10cSrcweir                 bOrtho = pSwColums->IsAutomaticWidth();
1117cdf0e10cSrcweir                 nLineWidth = pSwColums->GetSepLineWidth();
1118cdf0e10cSrcweir                 aLineColor.SetColor(pSwColums->GetSepLineColor());
1119cdf0e10cSrcweir                 nLineHeight = pSwColums->GetSepLineHeightRelative();
1120cdf0e10cSrcweir                 if(!pSwColums->GetSepLineIsOn())
1121cdf0e10cSrcweir                     eAdj = COLADJ_NONE;
1122cdf0e10cSrcweir                 else switch(pSwColums->GetSepLineVertAlign())
1123cdf0e10cSrcweir                 {
1124cdf0e10cSrcweir                     case 0: eAdj = COLADJ_TOP;  break;  //VerticalAlignment_TOP
1125cdf0e10cSrcweir                     case 1: eAdj = COLADJ_CENTER;break; //VerticalAlignment_MIDDLE
1126cdf0e10cSrcweir                     case 2: eAdj = COLADJ_BOTTOM;break; //VerticalAlignment_BOTTOM
1127*870262e3SDon Lewis                     default: ASSERT( sal_False, "unknown alignment" ); break;
1128cdf0e10cSrcweir                 }
1129cdf0e10cSrcweir             }
1130cdf0e10cSrcweir         }
1131cdf0e10cSrcweir     }
1132cdf0e10cSrcweir     return bRet;
1133cdf0e10cSrcweir }
1134cdf0e10cSrcweir 
1135cdf0e10cSrcweir 
1136cdf0e10cSrcweir //  class SwFmtSurround
1137cdf0e10cSrcweir //  Implementierung teilweise inline im hxx
1138cdf0e10cSrcweir 
SwFmtSurround(SwSurround eFly)1139cdf0e10cSrcweir SwFmtSurround::SwFmtSurround( SwSurround eFly ) :
1140cdf0e10cSrcweir     SfxEnumItem( RES_SURROUND, sal_uInt16( eFly ) )
1141cdf0e10cSrcweir {
1142cdf0e10cSrcweir     bAnchorOnly = bContour = bOutside = sal_False;
1143cdf0e10cSrcweir }
1144cdf0e10cSrcweir 
SwFmtSurround(const SwFmtSurround & rCpy)1145cdf0e10cSrcweir SwFmtSurround::SwFmtSurround( const SwFmtSurround &rCpy ) :
1146cdf0e10cSrcweir     SfxEnumItem( RES_SURROUND, rCpy.GetValue() )
1147cdf0e10cSrcweir {
1148cdf0e10cSrcweir     bAnchorOnly = rCpy.bAnchorOnly;
1149cdf0e10cSrcweir     bContour = rCpy.bContour;
1150cdf0e10cSrcweir     bOutside = rCpy.bOutside;
1151cdf0e10cSrcweir }
1152cdf0e10cSrcweir 
operator ==(const SfxPoolItem & rAttr) const1153cdf0e10cSrcweir int  SwFmtSurround::operator==( const SfxPoolItem& rAttr ) const
1154cdf0e10cSrcweir {
1155cdf0e10cSrcweir     ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
1156cdf0e10cSrcweir     return ( GetValue() == ((SwFmtSurround&)rAttr).GetValue() &&
1157cdf0e10cSrcweir              bAnchorOnly== ((SwFmtSurround&)rAttr).bAnchorOnly &&
1158cdf0e10cSrcweir              bContour== ((SwFmtSurround&)rAttr).bContour &&
1159cdf0e10cSrcweir              bOutside== ((SwFmtSurround&)rAttr).bOutside );
1160cdf0e10cSrcweir }
1161cdf0e10cSrcweir 
Clone(SfxItemPool *) const1162cdf0e10cSrcweir SfxPoolItem*  SwFmtSurround::Clone( SfxItemPool* ) const
1163cdf0e10cSrcweir {
1164cdf0e10cSrcweir     return new SwFmtSurround( *this );
1165cdf0e10cSrcweir }
1166cdf0e10cSrcweir 
GetValueCount() const1167cdf0e10cSrcweir sal_uInt16  SwFmtSurround::GetValueCount() const
1168cdf0e10cSrcweir {
1169cdf0e10cSrcweir     return SURROUND_END - SURROUND_BEGIN;
1170cdf0e10cSrcweir }
1171cdf0e10cSrcweir 
1172cdf0e10cSrcweir 
QueryValue(uno::Any & rVal,sal_uInt8 nMemberId) const1173cdf0e10cSrcweir sal_Bool SwFmtSurround::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1174cdf0e10cSrcweir {
1175cdf0e10cSrcweir     // hier wird immer konvertiert!
1176cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
1177cdf0e10cSrcweir     sal_Bool bRet = sal_True;
1178cdf0e10cSrcweir     switch ( nMemberId )
1179cdf0e10cSrcweir     {
1180cdf0e10cSrcweir         case MID_SURROUND_SURROUNDTYPE:
1181cdf0e10cSrcweir                 rVal <<= (text::WrapTextMode)GetSurround();
1182cdf0e10cSrcweir         break;
1183cdf0e10cSrcweir         case MID_SURROUND_ANCHORONLY:
1184cdf0e10cSrcweir         {
1185cdf0e10cSrcweir             sal_Bool bTmp = IsAnchorOnly();
1186cdf0e10cSrcweir             rVal.setValue(&bTmp, ::getBooleanCppuType());
1187cdf0e10cSrcweir         }
1188cdf0e10cSrcweir                 break;
1189cdf0e10cSrcweir         case MID_SURROUND_CONTOUR:
1190cdf0e10cSrcweir         {
1191cdf0e10cSrcweir             sal_Bool bTmp = IsContour();
1192cdf0e10cSrcweir             rVal.setValue(&bTmp, ::getBooleanCppuType());
1193cdf0e10cSrcweir         }
1194cdf0e10cSrcweir                 break;
1195cdf0e10cSrcweir         case MID_SURROUND_CONTOUROUTSIDE:
1196cdf0e10cSrcweir         {
1197cdf0e10cSrcweir             sal_Bool bTmp = IsOutside();
1198cdf0e10cSrcweir             rVal.setValue(&bTmp, ::getBooleanCppuType());
1199cdf0e10cSrcweir         }
1200cdf0e10cSrcweir                 break;
1201cdf0e10cSrcweir         default:
1202*870262e3SDon Lewis             ASSERT( sal_False, "unknown MemberId" );
1203cdf0e10cSrcweir             bRet = sal_False;
1204cdf0e10cSrcweir     }
1205cdf0e10cSrcweir     return bRet;
1206cdf0e10cSrcweir }
1207cdf0e10cSrcweir 
PutValue(const uno::Any & rVal,sal_uInt8 nMemberId)1208cdf0e10cSrcweir sal_Bool SwFmtSurround::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1209cdf0e10cSrcweir {
1210cdf0e10cSrcweir     // hier wird immer konvertiert!
1211cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
1212cdf0e10cSrcweir     sal_Bool bRet = sal_True;
1213cdf0e10cSrcweir     switch ( nMemberId )
1214cdf0e10cSrcweir     {
1215cdf0e10cSrcweir         case MID_SURROUND_SURROUNDTYPE:
1216cdf0e10cSrcweir         {
1217cdf0e10cSrcweir             sal_Int32 eVal = SWUnoHelper::GetEnumAsInt32( rVal );
1218cdf0e10cSrcweir             if( eVal >= 0 && eVal < (sal_Int16)SURROUND_END )
1219cdf0e10cSrcweir                 SetValue( static_cast<sal_uInt16>(eVal) );
1220cdf0e10cSrcweir             else {
1221cdf0e10cSrcweir                 //exception
1222cdf0e10cSrcweir                 ;
1223cdf0e10cSrcweir             }
1224cdf0e10cSrcweir         }
1225cdf0e10cSrcweir         break;
1226cdf0e10cSrcweir 
1227cdf0e10cSrcweir         case MID_SURROUND_ANCHORONLY:
1228cdf0e10cSrcweir             SetAnchorOnly( *(sal_Bool*)rVal.getValue() );
1229cdf0e10cSrcweir             break;
1230cdf0e10cSrcweir         case MID_SURROUND_CONTOUR:
1231cdf0e10cSrcweir             SetContour( *(sal_Bool*)rVal.getValue() );
1232cdf0e10cSrcweir             break;
1233cdf0e10cSrcweir         case MID_SURROUND_CONTOUROUTSIDE:
1234cdf0e10cSrcweir             SetOutside( *(sal_Bool*)rVal.getValue() );
1235cdf0e10cSrcweir             break;
1236cdf0e10cSrcweir         default:
1237*870262e3SDon Lewis             ASSERT( sal_False, "unknown MemberId" );
1238cdf0e10cSrcweir             bRet = sal_False;
1239cdf0e10cSrcweir     }
1240cdf0e10cSrcweir     return bRet;
1241cdf0e10cSrcweir }
1242cdf0e10cSrcweir 
1243cdf0e10cSrcweir //  class SwFmtVertOrient
1244cdf0e10cSrcweir //  Implementierung teilweise inline im hxx
1245cdf0e10cSrcweir 
SwFmtVertOrient(SwTwips nY,sal_Int16 eVert,sal_Int16 eRel)1246cdf0e10cSrcweir SwFmtVertOrient::SwFmtVertOrient( SwTwips nY, sal_Int16 eVert,
1247cdf0e10cSrcweir                                   sal_Int16 eRel )
1248cdf0e10cSrcweir     : SfxPoolItem( RES_VERT_ORIENT ),
1249cdf0e10cSrcweir     nYPos( nY ),
1250cdf0e10cSrcweir     eOrient( eVert ),
1251cdf0e10cSrcweir     eRelation( eRel )
1252cdf0e10cSrcweir {}
1253cdf0e10cSrcweir 
operator ==(const SfxPoolItem & rAttr) const1254cdf0e10cSrcweir int  SwFmtVertOrient::operator==( const SfxPoolItem& rAttr ) const
1255cdf0e10cSrcweir {
1256cdf0e10cSrcweir     ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
1257cdf0e10cSrcweir     return ( nYPos     == ((SwFmtVertOrient&)rAttr).nYPos &&
1258cdf0e10cSrcweir              eOrient   == ((SwFmtVertOrient&)rAttr).eOrient &&
1259cdf0e10cSrcweir              eRelation == ((SwFmtVertOrient&)rAttr).eRelation );
1260cdf0e10cSrcweir }
1261cdf0e10cSrcweir 
Clone(SfxItemPool *) const1262cdf0e10cSrcweir SfxPoolItem*  SwFmtVertOrient::Clone( SfxItemPool* ) const
1263cdf0e10cSrcweir {
1264cdf0e10cSrcweir     return new SwFmtVertOrient( nYPos, eOrient, eRelation );
1265cdf0e10cSrcweir }
1266cdf0e10cSrcweir 
QueryValue(uno::Any & rVal,sal_uInt8 nMemberId) const1267cdf0e10cSrcweir sal_Bool SwFmtVertOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1268cdf0e10cSrcweir {
1269cdf0e10cSrcweir     // hier wird immer konvertiert!
1270cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
1271cdf0e10cSrcweir     sal_Bool bRet = sal_True;
1272cdf0e10cSrcweir     switch ( nMemberId )
1273cdf0e10cSrcweir     {
1274cdf0e10cSrcweir         case MID_VERTORIENT_ORIENT:
1275cdf0e10cSrcweir         {
1276cdf0e10cSrcweir             sal_Int16 nRet = text::VertOrientation::NONE;
1277cdf0e10cSrcweir             switch( eOrient )
1278cdf0e10cSrcweir             {
1279cdf0e10cSrcweir                 case text::VertOrientation::TOP        :  nRet = text::VertOrientation::TOP        ;break;
1280cdf0e10cSrcweir                 case text::VertOrientation::CENTER     :  nRet = text::VertOrientation::CENTER     ;break;
1281cdf0e10cSrcweir                 case text::VertOrientation::BOTTOM     :  nRet = text::VertOrientation::BOTTOM     ;break;
1282cdf0e10cSrcweir                 case text::VertOrientation::CHAR_TOP   :  nRet = text::VertOrientation::CHAR_TOP   ;break;
1283cdf0e10cSrcweir                 case text::VertOrientation::CHAR_CENTER:  nRet = text::VertOrientation::CHAR_CENTER;break;
1284cdf0e10cSrcweir                 case text::VertOrientation::CHAR_BOTTOM:  nRet = text::VertOrientation::CHAR_BOTTOM;break;
1285cdf0e10cSrcweir                 case text::VertOrientation::LINE_TOP   :  nRet = text::VertOrientation::LINE_TOP   ;break;
1286cdf0e10cSrcweir                 case text::VertOrientation::LINE_CENTER:  nRet = text::VertOrientation::LINE_CENTER;break;
1287cdf0e10cSrcweir                 case text::VertOrientation::LINE_BOTTOM:  nRet = text::VertOrientation::LINE_BOTTOM;break;
1288cdf0e10cSrcweir                 default: break;
1289cdf0e10cSrcweir             }
1290cdf0e10cSrcweir             rVal <<= nRet;
1291cdf0e10cSrcweir         }
1292cdf0e10cSrcweir         break;
1293cdf0e10cSrcweir         case MID_VERTORIENT_RELATION:
1294cdf0e10cSrcweir                 rVal <<= lcl_RelToINT(eRelation);
1295cdf0e10cSrcweir         break;
1296cdf0e10cSrcweir         case MID_VERTORIENT_POSITION:
1297cdf0e10cSrcweir                 rVal <<= (sal_Int32)TWIP_TO_MM100(GetPos());
1298cdf0e10cSrcweir                 break;
1299cdf0e10cSrcweir         default:
1300*870262e3SDon Lewis             ASSERT( sal_False, "unknown MemberId" );
1301cdf0e10cSrcweir             bRet = sal_False;
1302cdf0e10cSrcweir     }
1303cdf0e10cSrcweir     return bRet;
1304cdf0e10cSrcweir }
1305cdf0e10cSrcweir 
PutValue(const uno::Any & rVal,sal_uInt8 nMemberId)1306cdf0e10cSrcweir sal_Bool SwFmtVertOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1307cdf0e10cSrcweir {
1308cdf0e10cSrcweir     sal_Bool bConvert = 0 != (nMemberId&CONVERT_TWIPS);
1309cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
1310cdf0e10cSrcweir     sal_Bool bRet = sal_True;
1311cdf0e10cSrcweir     switch ( nMemberId )
1312cdf0e10cSrcweir     {
1313cdf0e10cSrcweir         case MID_VERTORIENT_ORIENT:
1314cdf0e10cSrcweir         {
1315cdf0e10cSrcweir             sal_uInt16 nVal = 0;
1316cdf0e10cSrcweir             rVal >>= nVal;
1317cdf0e10cSrcweir             switch( nVal )
1318cdf0e10cSrcweir             {
1319cdf0e10cSrcweir                 case text::VertOrientation::NONE:           eOrient = text::VertOrientation::NONE;    break;
1320cdf0e10cSrcweir                 case text::VertOrientation::TOP        :    eOrient = text::VertOrientation::TOP;     break;
1321cdf0e10cSrcweir                 case text::VertOrientation::CENTER     :    eOrient = text::VertOrientation::CENTER;     break;
1322cdf0e10cSrcweir                 case text::VertOrientation::BOTTOM     :    eOrient = text::VertOrientation::BOTTOM;     break;
1323cdf0e10cSrcweir                 case text::VertOrientation::CHAR_TOP   :    eOrient = text::VertOrientation::CHAR_TOP;   break;
1324cdf0e10cSrcweir                 case text::VertOrientation::CHAR_CENTER:    eOrient = text::VertOrientation::CHAR_CENTER;break;
1325cdf0e10cSrcweir                 case text::VertOrientation::CHAR_BOTTOM:    eOrient = text::VertOrientation::CHAR_BOTTOM;break;
1326cdf0e10cSrcweir                 case text::VertOrientation::LINE_TOP   :    eOrient = text::VertOrientation::LINE_TOP;    break;
1327cdf0e10cSrcweir                 case text::VertOrientation::LINE_CENTER:    eOrient = text::VertOrientation::LINE_CENTER;break;
1328cdf0e10cSrcweir                 case text::VertOrientation::LINE_BOTTOM:    eOrient = text::VertOrientation::LINE_BOTTOM;break;
1329cdf0e10cSrcweir             }
1330cdf0e10cSrcweir         }
1331cdf0e10cSrcweir         break;
1332cdf0e10cSrcweir         case MID_VERTORIENT_RELATION:
1333cdf0e10cSrcweir         {
1334cdf0e10cSrcweir             eRelation = lcl_IntToRelation(rVal);
1335cdf0e10cSrcweir         }
1336cdf0e10cSrcweir         break;
1337cdf0e10cSrcweir         case MID_VERTORIENT_POSITION:
1338cdf0e10cSrcweir         {
1339cdf0e10cSrcweir             sal_Int32 nVal = 0;
1340cdf0e10cSrcweir             rVal >>= nVal;
1341cdf0e10cSrcweir             if(bConvert)
1342cdf0e10cSrcweir                 nVal = MM100_TO_TWIP(nVal);
1343cdf0e10cSrcweir             SetPos( nVal );
1344cdf0e10cSrcweir         }
1345cdf0e10cSrcweir         break;
1346cdf0e10cSrcweir         default:
1347*870262e3SDon Lewis             ASSERT( sal_False, "unknown MemberId" );
1348cdf0e10cSrcweir             bRet = sal_False;
1349cdf0e10cSrcweir     }
1350cdf0e10cSrcweir     return bRet;
1351cdf0e10cSrcweir }
1352cdf0e10cSrcweir 
1353cdf0e10cSrcweir 
1354cdf0e10cSrcweir 
1355cdf0e10cSrcweir //  class SwFmtHoriOrient
1356cdf0e10cSrcweir //  Implementierung teilweise inline im hxx
1357cdf0e10cSrcweir 
SwFmtHoriOrient(SwTwips nX,sal_Int16 eHori,sal_Int16 eRel,sal_Bool bPos)1358cdf0e10cSrcweir SwFmtHoriOrient::SwFmtHoriOrient( SwTwips nX, sal_Int16 eHori,
1359cdf0e10cSrcweir                               sal_Int16 eRel, sal_Bool bPos )
1360cdf0e10cSrcweir     : SfxPoolItem( RES_HORI_ORIENT ),
1361cdf0e10cSrcweir     nXPos( nX ),
1362cdf0e10cSrcweir     eOrient( eHori ),
1363cdf0e10cSrcweir     eRelation( eRel ),
1364cdf0e10cSrcweir     bPosToggle( bPos )
1365cdf0e10cSrcweir {}
1366cdf0e10cSrcweir 
operator ==(const SfxPoolItem & rAttr) const1367cdf0e10cSrcweir int  SwFmtHoriOrient::operator==( const SfxPoolItem& rAttr ) const
1368cdf0e10cSrcweir {
1369cdf0e10cSrcweir     ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
1370cdf0e10cSrcweir     return ( nXPos == ((SwFmtHoriOrient&)rAttr).nXPos &&
1371cdf0e10cSrcweir              eOrient == ((SwFmtHoriOrient&)rAttr).eOrient &&
1372cdf0e10cSrcweir              eRelation == ((SwFmtHoriOrient&)rAttr).eRelation &&
1373cdf0e10cSrcweir              bPosToggle == ((SwFmtHoriOrient&)rAttr).bPosToggle );
1374cdf0e10cSrcweir }
1375cdf0e10cSrcweir 
Clone(SfxItemPool *) const1376cdf0e10cSrcweir SfxPoolItem*  SwFmtHoriOrient::Clone( SfxItemPool* ) const
1377cdf0e10cSrcweir {
1378cdf0e10cSrcweir     return new SwFmtHoriOrient( nXPos, eOrient, eRelation, bPosToggle );
1379cdf0e10cSrcweir }
1380cdf0e10cSrcweir 
QueryValue(uno::Any & rVal,sal_uInt8 nMemberId) const1381cdf0e10cSrcweir sal_Bool SwFmtHoriOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1382cdf0e10cSrcweir {
1383cdf0e10cSrcweir     // hier wird immer konvertiert!
1384cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
1385cdf0e10cSrcweir     sal_Bool bRet = sal_True;
1386cdf0e10cSrcweir     switch ( nMemberId )
1387cdf0e10cSrcweir     {
1388cdf0e10cSrcweir         case MID_HORIORIENT_ORIENT:
1389cdf0e10cSrcweir         {
1390cdf0e10cSrcweir             sal_Int16 nRet = text::HoriOrientation::NONE;
1391cdf0e10cSrcweir             switch( eOrient )
1392cdf0e10cSrcweir             {
1393cdf0e10cSrcweir                 case text::HoriOrientation::RIGHT:    nRet = text::HoriOrientation::RIGHT; break;
1394cdf0e10cSrcweir                 case text::HoriOrientation::CENTER :  nRet = text::HoriOrientation::CENTER; break;
1395cdf0e10cSrcweir                 case text::HoriOrientation::LEFT   :  nRet = text::HoriOrientation::LEFT; break;
1396cdf0e10cSrcweir                 case text::HoriOrientation::INSIDE :  nRet = text::HoriOrientation::INSIDE; break;
1397cdf0e10cSrcweir                 case text::HoriOrientation::OUTSIDE:  nRet = text::HoriOrientation::OUTSIDE; break;
1398cdf0e10cSrcweir                 case text::HoriOrientation::FULL:     nRet = text::HoriOrientation::FULL; break;
1399cdf0e10cSrcweir                 case text::HoriOrientation::LEFT_AND_WIDTH :
1400cdf0e10cSrcweir                     nRet = text::HoriOrientation::LEFT_AND_WIDTH;
1401cdf0e10cSrcweir                     break;
1402cdf0e10cSrcweir                 default:
1403cdf0e10cSrcweir                     break;
1404cdf0e10cSrcweir 
1405cdf0e10cSrcweir             }
1406cdf0e10cSrcweir             rVal <<= nRet;
1407cdf0e10cSrcweir         }
1408cdf0e10cSrcweir         break;
1409cdf0e10cSrcweir         case MID_HORIORIENT_RELATION:
1410cdf0e10cSrcweir             rVal <<= lcl_RelToINT(eRelation);
1411cdf0e10cSrcweir         break;
1412cdf0e10cSrcweir         case MID_HORIORIENT_POSITION:
1413cdf0e10cSrcweir                 rVal <<= (sal_Int32)TWIP_TO_MM100(GetPos());
1414cdf0e10cSrcweir                 break;
1415cdf0e10cSrcweir         case MID_HORIORIENT_PAGETOGGLE:
1416cdf0e10cSrcweir         {
1417cdf0e10cSrcweir             sal_Bool bTmp = IsPosToggle();
1418cdf0e10cSrcweir             rVal.setValue(&bTmp, ::getBooleanCppuType());
1419cdf0e10cSrcweir         }
1420cdf0e10cSrcweir                 break;
1421cdf0e10cSrcweir         default:
1422*870262e3SDon Lewis             ASSERT( sal_False, "unknown MemberId" );
1423cdf0e10cSrcweir             bRet = sal_False;
1424cdf0e10cSrcweir     }
1425cdf0e10cSrcweir     return bRet;
1426cdf0e10cSrcweir }
1427cdf0e10cSrcweir 
PutValue(const uno::Any & rVal,sal_uInt8 nMemberId)1428cdf0e10cSrcweir sal_Bool SwFmtHoriOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1429cdf0e10cSrcweir {
1430cdf0e10cSrcweir     sal_Bool bConvert = 0 != (nMemberId&CONVERT_TWIPS);
1431cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
1432cdf0e10cSrcweir     sal_Bool bRet = sal_True;
1433cdf0e10cSrcweir     switch ( nMemberId )
1434cdf0e10cSrcweir     {
1435cdf0e10cSrcweir         case MID_HORIORIENT_ORIENT:
1436cdf0e10cSrcweir         {
1437cdf0e10cSrcweir             sal_Int16 nVal = 0;
1438cdf0e10cSrcweir             rVal >>= nVal;
1439cdf0e10cSrcweir             switch( nVal )
1440cdf0e10cSrcweir             {
1441cdf0e10cSrcweir                 case text::HoriOrientation::NONE:       eOrient = text::HoriOrientation::NONE ;   break;
1442cdf0e10cSrcweir                 case text::HoriOrientation::RIGHT:  eOrient = text::HoriOrientation::RIGHT;   break;
1443cdf0e10cSrcweir                 case text::HoriOrientation::CENTER :    eOrient = text::HoriOrientation::CENTER;  break;
1444cdf0e10cSrcweir                 case text::HoriOrientation::LEFT   :    eOrient = text::HoriOrientation::LEFT;    break;
1445cdf0e10cSrcweir                 case text::HoriOrientation::INSIDE :    eOrient = text::HoriOrientation::INSIDE;  break;
1446cdf0e10cSrcweir                 case text::HoriOrientation::OUTSIDE:    eOrient = text::HoriOrientation::OUTSIDE; break;
1447cdf0e10cSrcweir                 case text::HoriOrientation::FULL:      eOrient = text::HoriOrientation::FULL;     break;
1448cdf0e10cSrcweir                 case text::HoriOrientation::LEFT_AND_WIDTH:
1449cdf0e10cSrcweir                     eOrient = text::HoriOrientation::LEFT_AND_WIDTH;
1450cdf0e10cSrcweir                 break;
1451cdf0e10cSrcweir             }
1452cdf0e10cSrcweir         }
1453cdf0e10cSrcweir         break;
1454cdf0e10cSrcweir         case MID_HORIORIENT_RELATION:
1455cdf0e10cSrcweir         {
1456cdf0e10cSrcweir             eRelation = lcl_IntToRelation(rVal);
1457cdf0e10cSrcweir         }
1458cdf0e10cSrcweir         break;
1459cdf0e10cSrcweir         case MID_HORIORIENT_POSITION:
1460cdf0e10cSrcweir         {
1461cdf0e10cSrcweir             sal_Int32 nVal = 0;
1462cdf0e10cSrcweir             if(!(rVal >>= nVal))
1463cdf0e10cSrcweir                 bRet = sal_False;
1464cdf0e10cSrcweir             if(bConvert)
1465cdf0e10cSrcweir                 nVal = MM100_TO_TWIP(nVal);
1466cdf0e10cSrcweir             SetPos( nVal );
1467cdf0e10cSrcweir         }
1468cdf0e10cSrcweir         break;
1469cdf0e10cSrcweir         case MID_HORIORIENT_PAGETOGGLE:
1470cdf0e10cSrcweir                 SetPosToggle( *(sal_Bool*)rVal.getValue());
1471cdf0e10cSrcweir             break;
1472cdf0e10cSrcweir         default:
1473*870262e3SDon Lewis             ASSERT( sal_False, "unknown MemberId" );
1474cdf0e10cSrcweir             bRet = sal_False;
1475cdf0e10cSrcweir     }
1476cdf0e10cSrcweir     return bRet;
1477cdf0e10cSrcweir }
1478cdf0e10cSrcweir 
1479cdf0e10cSrcweir 
1480cdf0e10cSrcweir 
1481cdf0e10cSrcweir //  class SwFmtAnchor
1482cdf0e10cSrcweir //  Implementierung teilweise inline im hxx
1483cdf0e10cSrcweir 
SwFmtAnchor(RndStdIds nRnd,sal_uInt16 nPage)1484cdf0e10cSrcweir SwFmtAnchor::SwFmtAnchor( RndStdIds nRnd, sal_uInt16 nPage )
1485cdf0e10cSrcweir     : SfxPoolItem( RES_ANCHOR ),
1486cdf0e10cSrcweir     pCntntAnchor( 0 ),
1487cdf0e10cSrcweir     nAnchorId( nRnd ),
1488cdf0e10cSrcweir     nPageNum( nPage ),
1489cdf0e10cSrcweir     // OD 2004-05-05 #i28701# - get always new increased order number
1490cdf0e10cSrcweir     mnOrder( ++mnOrderCounter )
1491cdf0e10cSrcweir {}
1492cdf0e10cSrcweir 
SwFmtAnchor(const SwFmtAnchor & rCpy)1493cdf0e10cSrcweir SwFmtAnchor::SwFmtAnchor( const SwFmtAnchor &rCpy )
1494cdf0e10cSrcweir     : SfxPoolItem( RES_ANCHOR ),
1495cdf0e10cSrcweir     nAnchorId( rCpy.GetAnchorId() ),
1496cdf0e10cSrcweir     nPageNum( rCpy.GetPageNum() ),
1497cdf0e10cSrcweir     // OD 2004-05-05 #i28701# - get always new increased order number
1498cdf0e10cSrcweir     mnOrder( ++mnOrderCounter )
1499cdf0e10cSrcweir {
1500cdf0e10cSrcweir     pCntntAnchor = rCpy.GetCntntAnchor() ?
1501cdf0e10cSrcweir                         new SwPosition( *rCpy.GetCntntAnchor() ) : 0;
1502cdf0e10cSrcweir }
1503cdf0e10cSrcweir 
~SwFmtAnchor()1504cdf0e10cSrcweir  SwFmtAnchor::~SwFmtAnchor()
1505cdf0e10cSrcweir {
1506cdf0e10cSrcweir     delete pCntntAnchor;
1507cdf0e10cSrcweir }
1508cdf0e10cSrcweir 
SetAnchor(const SwPosition * pPos)1509cdf0e10cSrcweir void SwFmtAnchor::SetAnchor( const SwPosition *pPos )
1510cdf0e10cSrcweir {
1511cdf0e10cSrcweir     if ( pCntntAnchor )
1512cdf0e10cSrcweir         delete pCntntAnchor;
1513cdf0e10cSrcweir     pCntntAnchor = pPos ? new SwPosition( *pPos ) : 0;
1514cdf0e10cSrcweir         //AM Absatz gebundene Flys sollten nie in den Absatz hineinzeigen.
1515cdf0e10cSrcweir     if (pCntntAnchor &&
1516cdf0e10cSrcweir         ((FLY_AT_PARA == nAnchorId) || (FLY_AT_FLY == nAnchorId)))
1517cdf0e10cSrcweir     {
1518cdf0e10cSrcweir         pCntntAnchor->nContent.Assign( 0, 0 );
1519cdf0e10cSrcweir     }
1520cdf0e10cSrcweir }
1521cdf0e10cSrcweir 
operator =(const SwFmtAnchor & rAnchor)1522cdf0e10cSrcweir SwFmtAnchor& SwFmtAnchor::operator=(const SwFmtAnchor& rAnchor)
1523cdf0e10cSrcweir {
1524cdf0e10cSrcweir     nAnchorId  = rAnchor.GetAnchorId();
1525cdf0e10cSrcweir     nPageNum   = rAnchor.GetPageNum();
1526cdf0e10cSrcweir     // OD 2004-05-05 #i28701# - get always new increased order number
1527cdf0e10cSrcweir     mnOrder = ++mnOrderCounter;
1528cdf0e10cSrcweir 
1529cdf0e10cSrcweir     delete pCntntAnchor;
1530cdf0e10cSrcweir     pCntntAnchor = rAnchor.pCntntAnchor ?
1531cdf0e10cSrcweir                                     new SwPosition(*(rAnchor.pCntntAnchor)) : 0;
1532cdf0e10cSrcweir     return *this;
1533cdf0e10cSrcweir }
1534cdf0e10cSrcweir 
operator ==(const SfxPoolItem & rAttr) const1535cdf0e10cSrcweir int  SwFmtAnchor::operator==( const SfxPoolItem& rAttr ) const
1536cdf0e10cSrcweir {
1537cdf0e10cSrcweir     ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
1538cdf0e10cSrcweir     // OD 2004-05-05 #i28701# - Note: <mnOrder> hasn't to be considered.
1539cdf0e10cSrcweir     return ( nAnchorId == ((SwFmtAnchor&)rAttr).GetAnchorId() &&
1540cdf0e10cSrcweir              nPageNum == ((SwFmtAnchor&)rAttr).GetPageNum()   &&
1541cdf0e10cSrcweir                     //Anker vergleichen. Entweder zeigen beide auf das gleiche
1542cdf0e10cSrcweir                     //Attribut bzw. sind 0 oder die SwPosition* sind beide
1543cdf0e10cSrcweir                     //gueltig und die SwPositions sind gleich.
1544cdf0e10cSrcweir              (pCntntAnchor == ((SwFmtAnchor&)rAttr).GetCntntAnchor() ||
1545cdf0e10cSrcweir               (pCntntAnchor && ((SwFmtAnchor&)rAttr).GetCntntAnchor() &&
1546cdf0e10cSrcweir                *pCntntAnchor == *((SwFmtAnchor&)rAttr).GetCntntAnchor())));
1547cdf0e10cSrcweir }
1548cdf0e10cSrcweir 
Clone(SfxItemPool *) const1549cdf0e10cSrcweir SfxPoolItem*  SwFmtAnchor::Clone( SfxItemPool* ) const
1550cdf0e10cSrcweir {
1551cdf0e10cSrcweir     return new SwFmtAnchor( *this );
1552cdf0e10cSrcweir }
1553cdf0e10cSrcweir 
1554cdf0e10cSrcweir // OD 2004-05-05 #i28701#
1555cdf0e10cSrcweir sal_uInt32 SwFmtAnchor::mnOrderCounter = 0;
1556cdf0e10cSrcweir 
1557cdf0e10cSrcweir // OD 2004-05-05 #i28701#
GetOrder() const1558cdf0e10cSrcweir sal_uInt32 SwFmtAnchor::GetOrder() const
1559cdf0e10cSrcweir {
1560cdf0e10cSrcweir     return mnOrder;
1561cdf0e10cSrcweir }
1562cdf0e10cSrcweir 
1563cdf0e10cSrcweir /*-----------------16.02.98 15:21-------------------
1564cdf0e10cSrcweir 
1565cdf0e10cSrcweir --------------------------------------------------*/
QueryValue(uno::Any & rVal,sal_uInt8 nMemberId) const1566cdf0e10cSrcweir sal_Bool SwFmtAnchor::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1567cdf0e10cSrcweir {
1568cdf0e10cSrcweir     // hier wird immer konvertiert!
1569cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
1570cdf0e10cSrcweir     sal_Bool bRet = sal_True;
1571cdf0e10cSrcweir     switch ( nMemberId )
1572cdf0e10cSrcweir     {
1573cdf0e10cSrcweir         case MID_ANCHOR_ANCHORTYPE:
1574cdf0e10cSrcweir 
1575cdf0e10cSrcweir             text::TextContentAnchorType eRet;
1576cdf0e10cSrcweir             switch (GetAnchorId())
1577cdf0e10cSrcweir             {
1578cdf0e10cSrcweir                 case  FLY_AT_CHAR:
1579cdf0e10cSrcweir                     eRet = text::TextContentAnchorType_AT_CHARACTER;
1580cdf0e10cSrcweir                     break;
1581cdf0e10cSrcweir                 case  FLY_AT_PAGE:
1582cdf0e10cSrcweir                     eRet = text::TextContentAnchorType_AT_PAGE;
1583cdf0e10cSrcweir                     break;
1584cdf0e10cSrcweir                 case  FLY_AT_FLY:
1585cdf0e10cSrcweir                     eRet = text::TextContentAnchorType_AT_FRAME;
1586cdf0e10cSrcweir                     break;
1587cdf0e10cSrcweir                 case  FLY_AS_CHAR:
1588cdf0e10cSrcweir                     eRet = text::TextContentAnchorType_AS_CHARACTER;
1589cdf0e10cSrcweir                     break;
1590cdf0e10cSrcweir                 //case  FLY_AT_PARA:
1591cdf0e10cSrcweir                 default:
1592cdf0e10cSrcweir                     eRet = text::TextContentAnchorType_AT_PARAGRAPH;
1593cdf0e10cSrcweir             }
1594cdf0e10cSrcweir             rVal <<= eRet;
1595cdf0e10cSrcweir         break;
1596cdf0e10cSrcweir         case MID_ANCHOR_PAGENUM:
1597cdf0e10cSrcweir             rVal <<= (sal_Int16)GetPageNum();
1598cdf0e10cSrcweir         break;
1599cdf0e10cSrcweir         case MID_ANCHOR_ANCHORFRAME:
1600cdf0e10cSrcweir         {
1601cdf0e10cSrcweir             if(pCntntAnchor && FLY_AT_FLY == nAnchorId)
1602cdf0e10cSrcweir             {
1603cdf0e10cSrcweir                 SwFrmFmt* pFmt = pCntntAnchor->nNode.GetNode().GetFlyFmt();
1604cdf0e10cSrcweir                 if(pFmt)
1605cdf0e10cSrcweir                 {
1606cdf0e10cSrcweir                     uno::Reference<container::XNamed> xNamed = SwXFrames::GetObject( *pFmt, FLYCNTTYPE_FRM );
1607cdf0e10cSrcweir                     uno::Reference<text::XTextFrame> xRet(xNamed, uno::UNO_QUERY);
1608cdf0e10cSrcweir                     rVal <<= xRet;
1609cdf0e10cSrcweir                 }
1610cdf0e10cSrcweir             }
1611cdf0e10cSrcweir         }
1612cdf0e10cSrcweir         break;
1613cdf0e10cSrcweir         default:
1614*870262e3SDon Lewis             ASSERT( sal_False, "unknown MemberId" );
1615cdf0e10cSrcweir             bRet = sal_False;
1616cdf0e10cSrcweir     }
1617cdf0e10cSrcweir     return bRet;
1618cdf0e10cSrcweir }
1619cdf0e10cSrcweir 
PutValue(const uno::Any & rVal,sal_uInt8 nMemberId)1620cdf0e10cSrcweir sal_Bool SwFmtAnchor::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1621cdf0e10cSrcweir {
1622cdf0e10cSrcweir     // hier wird immer konvertiert!
1623cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
1624cdf0e10cSrcweir     sal_Bool bRet = sal_True;
1625cdf0e10cSrcweir     switch ( nMemberId )
1626cdf0e10cSrcweir     {
1627cdf0e10cSrcweir         case MID_ANCHOR_ANCHORTYPE:
1628cdf0e10cSrcweir         {
1629cdf0e10cSrcweir             RndStdIds   eAnchor;
1630cdf0e10cSrcweir             switch( SWUnoHelper::GetEnumAsInt32( rVal ) )
1631cdf0e10cSrcweir             {
1632cdf0e10cSrcweir                 case  text::TextContentAnchorType_AS_CHARACTER:
1633cdf0e10cSrcweir                     eAnchor = FLY_AS_CHAR;
1634cdf0e10cSrcweir                     break;
1635cdf0e10cSrcweir                 case  text::TextContentAnchorType_AT_PAGE:
1636cdf0e10cSrcweir                     eAnchor = FLY_AT_PAGE;
1637cdf0e10cSrcweir                     if( GetPageNum() > 0 && pCntntAnchor )
1638cdf0e10cSrcweir                     {
1639cdf0e10cSrcweir                         // If the anchor type is page and a valid page number
1640cdf0e10cSrcweir                         // has been set, the content position isn't required
1641cdf0e10cSrcweir                         // any longer.
1642cdf0e10cSrcweir                         delete pCntntAnchor;
1643cdf0e10cSrcweir                         pCntntAnchor = 0;
1644cdf0e10cSrcweir                     }
1645cdf0e10cSrcweir                     break;
1646cdf0e10cSrcweir                 case  text::TextContentAnchorType_AT_FRAME:
1647cdf0e10cSrcweir                     eAnchor = FLY_AT_FLY;
1648cdf0e10cSrcweir                     break;
1649cdf0e10cSrcweir                 case  text::TextContentAnchorType_AT_CHARACTER:
1650cdf0e10cSrcweir                     eAnchor = FLY_AT_CHAR;
1651cdf0e10cSrcweir                     break;
1652cdf0e10cSrcweir                 //case  text::TextContentAnchorType_AT_PARAGRAPH:
1653cdf0e10cSrcweir                 default:
1654cdf0e10cSrcweir                     eAnchor = FLY_AT_PARA;
1655cdf0e10cSrcweir                     break;
1656cdf0e10cSrcweir             }
1657cdf0e10cSrcweir             SetType( eAnchor );
1658cdf0e10cSrcweir         }
1659cdf0e10cSrcweir         break;
1660cdf0e10cSrcweir         case MID_ANCHOR_PAGENUM:
1661cdf0e10cSrcweir         {
1662cdf0e10cSrcweir             sal_Int16 nVal = 0;
1663cdf0e10cSrcweir             if((rVal >>= nVal) && nVal > 0)
1664cdf0e10cSrcweir             {
1665cdf0e10cSrcweir                 SetPageNum( nVal );
1666cdf0e10cSrcweir                 if ((FLY_AT_PAGE == GetAnchorId()) && pCntntAnchor)
1667cdf0e10cSrcweir                 {
1668cdf0e10cSrcweir                     // If the anchor type is page and a valid page number
1669cdf0e10cSrcweir                     // is set, the content paoition has to be deleted to not
1670cdf0e10cSrcweir                     // confuse the layout (frmtool.cxx). However, if the
1671cdf0e10cSrcweir                     // anchor type is not page, any content position will
1672cdf0e10cSrcweir                     // be kept.
1673cdf0e10cSrcweir                     delete pCntntAnchor;
1674cdf0e10cSrcweir                     pCntntAnchor = 0;
1675cdf0e10cSrcweir                 }
1676cdf0e10cSrcweir             }
1677cdf0e10cSrcweir             else
1678cdf0e10cSrcweir                 bRet = sal_False;
1679cdf0e10cSrcweir         }
1680cdf0e10cSrcweir         break;
1681cdf0e10cSrcweir         case MID_ANCHOR_ANCHORFRAME:
1682cdf0e10cSrcweir         //no break here!;
1683cdf0e10cSrcweir         default:
1684*870262e3SDon Lewis             ASSERT( sal_False, "unknown MemberId" );
1685cdf0e10cSrcweir             bRet = sal_False;
1686cdf0e10cSrcweir     }
1687cdf0e10cSrcweir     return bRet;
1688cdf0e10cSrcweir }
1689cdf0e10cSrcweir 
1690cdf0e10cSrcweir //  class SwFmtURL
1691cdf0e10cSrcweir //  Implementierung teilweise inline im hxx
1692cdf0e10cSrcweir 
SwFmtURL()1693cdf0e10cSrcweir SwFmtURL::SwFmtURL() :
1694cdf0e10cSrcweir     SfxPoolItem( RES_URL ),
1695cdf0e10cSrcweir     pMap( 0 ),
1696cdf0e10cSrcweir     bIsServerMap( sal_False )
1697cdf0e10cSrcweir {
1698cdf0e10cSrcweir }
1699cdf0e10cSrcweir 
SwFmtURL(const SwFmtURL & rURL)1700cdf0e10cSrcweir SwFmtURL::SwFmtURL( const SwFmtURL &rURL) :
1701cdf0e10cSrcweir     SfxPoolItem( RES_URL ),
1702cdf0e10cSrcweir     sTargetFrameName( rURL.GetTargetFrameName() ),
1703cdf0e10cSrcweir     sURL( rURL.GetURL() ),
1704cdf0e10cSrcweir     sName( rURL.GetName() ),
1705cdf0e10cSrcweir     bIsServerMap( rURL.IsServerMap() )
1706cdf0e10cSrcweir {
1707cdf0e10cSrcweir     pMap = rURL.GetMap() ? new ImageMap( *rURL.GetMap() ) : 0;
1708cdf0e10cSrcweir }
1709cdf0e10cSrcweir 
~SwFmtURL()1710cdf0e10cSrcweir SwFmtURL::~SwFmtURL()
1711cdf0e10cSrcweir {
1712cdf0e10cSrcweir     if ( pMap )
1713cdf0e10cSrcweir         delete pMap;
1714cdf0e10cSrcweir }
1715cdf0e10cSrcweir 
operator ==(const SfxPoolItem & rAttr) const1716cdf0e10cSrcweir int SwFmtURL::operator==( const SfxPoolItem &rAttr ) const
1717cdf0e10cSrcweir {
1718cdf0e10cSrcweir     ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
1719cdf0e10cSrcweir     const SwFmtURL &rCmp = (SwFmtURL&)rAttr;
1720cdf0e10cSrcweir     sal_Bool bRet = bIsServerMap     == rCmp.IsServerMap() &&
1721cdf0e10cSrcweir                 sURL             == rCmp.GetURL() &&
1722cdf0e10cSrcweir                 sTargetFrameName == rCmp.GetTargetFrameName() &&
1723cdf0e10cSrcweir                 sName            == rCmp.GetName();
1724cdf0e10cSrcweir     if ( bRet )
1725cdf0e10cSrcweir     {
1726cdf0e10cSrcweir         if ( pMap && rCmp.GetMap() )
1727cdf0e10cSrcweir             bRet = *pMap == *rCmp.GetMap();
1728cdf0e10cSrcweir         else
1729cdf0e10cSrcweir             bRet = pMap == rCmp.GetMap();
1730cdf0e10cSrcweir     }
1731cdf0e10cSrcweir     return bRet;
1732cdf0e10cSrcweir }
1733cdf0e10cSrcweir 
Clone(SfxItemPool *) const1734cdf0e10cSrcweir SfxPoolItem* SwFmtURL::Clone( SfxItemPool* ) const
1735cdf0e10cSrcweir {
1736cdf0e10cSrcweir     return new SwFmtURL( *this );
1737cdf0e10cSrcweir }
1738cdf0e10cSrcweir 
SetURL(const XubString & rURL,sal_Bool bServerMap)1739cdf0e10cSrcweir void SwFmtURL::SetURL( const XubString &rURL, sal_Bool bServerMap )
1740cdf0e10cSrcweir {
1741cdf0e10cSrcweir     sURL = rURL;
1742cdf0e10cSrcweir     bIsServerMap = bServerMap;
1743cdf0e10cSrcweir }
1744cdf0e10cSrcweir 
SetMap(const ImageMap * pM)1745cdf0e10cSrcweir void SwFmtURL::SetMap( const ImageMap *pM )
1746cdf0e10cSrcweir {
1747cdf0e10cSrcweir     if ( pMap )
1748cdf0e10cSrcweir         delete pMap;
1749cdf0e10cSrcweir     pMap = pM ? new ImageMap( *pM ) : 0;
1750cdf0e10cSrcweir }
1751cdf0e10cSrcweir extern const SvEventDescription* lcl_GetSupportedMacroItems();
1752cdf0e10cSrcweir 
QueryValue(uno::Any & rVal,sal_uInt8 nMemberId) const1753cdf0e10cSrcweir sal_Bool SwFmtURL::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1754cdf0e10cSrcweir {
1755cdf0e10cSrcweir     // hier wird immer konvertiert!
1756cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
1757cdf0e10cSrcweir     sal_Bool bRet = sal_True;
1758cdf0e10cSrcweir     switch ( nMemberId )
1759cdf0e10cSrcweir     {
1760cdf0e10cSrcweir         case MID_URL_URL:
1761cdf0e10cSrcweir         {
1762cdf0e10cSrcweir             OUString sRet = GetURL();
1763cdf0e10cSrcweir             rVal <<= sRet;
1764cdf0e10cSrcweir         }
1765cdf0e10cSrcweir         break;
1766cdf0e10cSrcweir         case MID_URL_TARGET:
1767cdf0e10cSrcweir         {
1768cdf0e10cSrcweir             OUString sRet = GetTargetFrameName();
1769cdf0e10cSrcweir             rVal <<= sRet;
1770cdf0e10cSrcweir         }
1771cdf0e10cSrcweir         break;
1772cdf0e10cSrcweir         case MID_URL_HYPERLINKNAME:
1773cdf0e10cSrcweir             rVal <<= OUString( GetName() );
1774cdf0e10cSrcweir             break;
1775cdf0e10cSrcweir         case MID_URL_CLIENTMAP:
1776cdf0e10cSrcweir         {
1777cdf0e10cSrcweir             uno::Reference< uno::XInterface > xInt;
1778cdf0e10cSrcweir             if(pMap)
1779cdf0e10cSrcweir             {
1780cdf0e10cSrcweir                 xInt = SvUnoImageMap_createInstance( *pMap, lcl_GetSupportedMacroItems() );
1781cdf0e10cSrcweir             }
1782cdf0e10cSrcweir             else
1783cdf0e10cSrcweir             {
1784cdf0e10cSrcweir                 ImageMap aEmptyMap;
1785cdf0e10cSrcweir                 xInt = SvUnoImageMap_createInstance( aEmptyMap, lcl_GetSupportedMacroItems() );
1786cdf0e10cSrcweir             }
1787cdf0e10cSrcweir             uno::Reference< container::XIndexContainer > xCont(xInt, uno::UNO_QUERY);
1788cdf0e10cSrcweir             rVal <<= xCont;
1789cdf0e10cSrcweir         }
1790cdf0e10cSrcweir         break;
1791cdf0e10cSrcweir         case MID_URL_SERVERMAP:
1792cdf0e10cSrcweir         {
1793cdf0e10cSrcweir             sal_Bool bTmp = IsServerMap();
1794cdf0e10cSrcweir             rVal.setValue(&bTmp, ::getBooleanCppuType());
1795cdf0e10cSrcweir         }
1796cdf0e10cSrcweir             break;
1797cdf0e10cSrcweir         default:
1798*870262e3SDon Lewis             ASSERT( sal_False, "unknown MemberId" );
1799cdf0e10cSrcweir             bRet = sal_False;
1800cdf0e10cSrcweir     }
1801cdf0e10cSrcweir     return bRet;
1802cdf0e10cSrcweir }
1803cdf0e10cSrcweir 
PutValue(const uno::Any & rVal,sal_uInt8 nMemberId)1804cdf0e10cSrcweir sal_Bool SwFmtURL::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1805cdf0e10cSrcweir {
1806cdf0e10cSrcweir     // hier wird immer konvertiert!
1807cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
1808cdf0e10cSrcweir     sal_Bool bRet = sal_True;
1809cdf0e10cSrcweir     switch ( nMemberId )
1810cdf0e10cSrcweir     {
1811cdf0e10cSrcweir         case MID_URL_URL:
1812cdf0e10cSrcweir         {
1813cdf0e10cSrcweir             OUString sTmp;
1814cdf0e10cSrcweir             rVal >>= sTmp;
1815cdf0e10cSrcweir             SetURL( sTmp, bIsServerMap );
1816cdf0e10cSrcweir         }
1817cdf0e10cSrcweir         break;
1818cdf0e10cSrcweir         case MID_URL_TARGET:
1819cdf0e10cSrcweir         {
1820cdf0e10cSrcweir             OUString sTmp;
1821cdf0e10cSrcweir             rVal >>= sTmp;
1822cdf0e10cSrcweir             SetTargetFrameName( sTmp );
1823cdf0e10cSrcweir         }
1824cdf0e10cSrcweir         break;
1825cdf0e10cSrcweir         case MID_URL_HYPERLINKNAME:
1826cdf0e10cSrcweir         {
1827cdf0e10cSrcweir             OUString sTmp;
1828cdf0e10cSrcweir             rVal >>= sTmp;
1829cdf0e10cSrcweir             SetName( sTmp );
1830cdf0e10cSrcweir         }
1831cdf0e10cSrcweir         break;
1832cdf0e10cSrcweir         case MID_URL_CLIENTMAP:
1833cdf0e10cSrcweir         {
1834cdf0e10cSrcweir             uno::Reference<container::XIndexContainer> xCont;
1835cdf0e10cSrcweir             if(!rVal.hasValue())
1836cdf0e10cSrcweir                 DELETEZ(pMap);
1837cdf0e10cSrcweir             else if(rVal >>= xCont)
1838cdf0e10cSrcweir             {
1839cdf0e10cSrcweir                 if(!pMap)
1840cdf0e10cSrcweir                     pMap = new ImageMap;
1841cdf0e10cSrcweir                 bRet = SvUnoImageMap_fillImageMap( xCont, *pMap );
1842cdf0e10cSrcweir             }
1843cdf0e10cSrcweir             else
1844cdf0e10cSrcweir                 bRet = sal_False;
1845cdf0e10cSrcweir         }
1846cdf0e10cSrcweir         break;
1847cdf0e10cSrcweir         case MID_URL_SERVERMAP:
1848cdf0e10cSrcweir             bIsServerMap = *(sal_Bool*)rVal.getValue();
1849cdf0e10cSrcweir             break;
1850cdf0e10cSrcweir         default:
1851*870262e3SDon Lewis             ASSERT( sal_False, "unknown MemberId" );
1852cdf0e10cSrcweir             bRet = sal_False;
1853cdf0e10cSrcweir     }
1854cdf0e10cSrcweir     return bRet;
1855cdf0e10cSrcweir }
1856cdf0e10cSrcweir 
1857cdf0e10cSrcweir 
1858cdf0e10cSrcweir // class SwNoReadOnly
1859cdf0e10cSrcweir 
Clone(SfxItemPool *) const1860cdf0e10cSrcweir SfxPoolItem* SwFmtEditInReadonly::Clone( SfxItemPool* ) const
1861cdf0e10cSrcweir {
1862cdf0e10cSrcweir     return new SwFmtEditInReadonly( Which(), GetValue() );
1863cdf0e10cSrcweir }
1864cdf0e10cSrcweir 
1865cdf0e10cSrcweir // class SwFmtLayoutSplit
1866cdf0e10cSrcweir 
Clone(SfxItemPool *) const1867cdf0e10cSrcweir SfxPoolItem* SwFmtLayoutSplit::Clone( SfxItemPool* ) const
1868cdf0e10cSrcweir {
1869cdf0e10cSrcweir     return new SwFmtLayoutSplit( GetValue() );
1870cdf0e10cSrcweir }
1871cdf0e10cSrcweir 
1872cdf0e10cSrcweir // class SwFmtRowSplit
1873cdf0e10cSrcweir 
Clone(SfxItemPool *) const1874cdf0e10cSrcweir SfxPoolItem* SwFmtRowSplit::Clone( SfxItemPool* ) const
1875cdf0e10cSrcweir {
1876cdf0e10cSrcweir     return new SwFmtRowSplit( GetValue() );
1877cdf0e10cSrcweir }
1878cdf0e10cSrcweir 
1879cdf0e10cSrcweir 
1880cdf0e10cSrcweir // class SwFmtNoBalancedColumns
1881cdf0e10cSrcweir 
Clone(SfxItemPool *) const1882cdf0e10cSrcweir SfxPoolItem* SwFmtNoBalancedColumns::Clone( SfxItemPool* ) const
1883cdf0e10cSrcweir {
1884cdf0e10cSrcweir     return new SwFmtNoBalancedColumns( GetValue() );
1885cdf0e10cSrcweir }
1886cdf0e10cSrcweir 
1887cdf0e10cSrcweir // class SwFmtFtnEndAtTxtEnd
1888cdf0e10cSrcweir 
GetValueCount() const1889cdf0e10cSrcweir sal_uInt16 SwFmtFtnEndAtTxtEnd::GetValueCount() const
1890cdf0e10cSrcweir {
1891cdf0e10cSrcweir     return sal_uInt16( FTNEND_ATTXTEND_END );
1892cdf0e10cSrcweir }
1893cdf0e10cSrcweir 
operator =(const SwFmtFtnEndAtTxtEnd & rAttr)1894cdf0e10cSrcweir SwFmtFtnEndAtTxtEnd& SwFmtFtnEndAtTxtEnd::operator=(
1895cdf0e10cSrcweir                         const SwFmtFtnEndAtTxtEnd& rAttr )
1896cdf0e10cSrcweir {
1897cdf0e10cSrcweir     SfxEnumItem::SetValue( rAttr.GetValue() );
1898cdf0e10cSrcweir     aFmt = rAttr.aFmt;
1899cdf0e10cSrcweir     nOffset = rAttr.nOffset;
1900cdf0e10cSrcweir     sPrefix = rAttr.sPrefix;
1901cdf0e10cSrcweir     sSuffix = rAttr.sSuffix;
1902cdf0e10cSrcweir     return *this;
1903cdf0e10cSrcweir }
1904cdf0e10cSrcweir 
operator ==(const SfxPoolItem & rItem) const1905cdf0e10cSrcweir int SwFmtFtnEndAtTxtEnd::operator==( const SfxPoolItem& rItem ) const
1906cdf0e10cSrcweir {
1907cdf0e10cSrcweir     const SwFmtFtnEndAtTxtEnd& rAttr = (SwFmtFtnEndAtTxtEnd&)rItem;
1908cdf0e10cSrcweir     return SfxEnumItem::operator==( rAttr ) &&
1909cdf0e10cSrcweir             aFmt.GetNumberingType() == rAttr.aFmt.GetNumberingType() &&
1910cdf0e10cSrcweir             nOffset == rAttr.nOffset &&
1911cdf0e10cSrcweir             sPrefix == rAttr.sPrefix &&
1912cdf0e10cSrcweir             sSuffix == rAttr.sSuffix;
1913cdf0e10cSrcweir }
1914cdf0e10cSrcweir 
QueryValue(uno::Any & rVal,sal_uInt8 nMemberId) const1915cdf0e10cSrcweir sal_Bool SwFmtFtnEndAtTxtEnd::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1916cdf0e10cSrcweir {
1917cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
1918cdf0e10cSrcweir     switch(nMemberId)
1919cdf0e10cSrcweir     {
1920cdf0e10cSrcweir         case MID_COLLECT     :
1921cdf0e10cSrcweir         {
1922cdf0e10cSrcweir             sal_Bool bVal = GetValue() >= FTNEND_ATTXTEND;
1923cdf0e10cSrcweir             rVal.setValue(&bVal, ::getBooleanCppuType());
1924cdf0e10cSrcweir         }
1925cdf0e10cSrcweir         break;
1926cdf0e10cSrcweir         case MID_RESTART_NUM :
1927cdf0e10cSrcweir         {
1928cdf0e10cSrcweir             sal_Bool bVal = GetValue() >= FTNEND_ATTXTEND_OWNNUMSEQ;
1929cdf0e10cSrcweir             rVal.setValue(&bVal, ::getBooleanCppuType());
1930cdf0e10cSrcweir         }
1931cdf0e10cSrcweir         break;
1932cdf0e10cSrcweir         case MID_NUM_START_AT: rVal <<= (sal_Int16) nOffset; break;
1933cdf0e10cSrcweir         case MID_OWN_NUM     :
1934cdf0e10cSrcweir         {
1935cdf0e10cSrcweir             sal_Bool bVal = GetValue() >= FTNEND_ATTXTEND_OWNNUMANDFMT;
1936cdf0e10cSrcweir             rVal.setValue(&bVal, ::getBooleanCppuType());
1937cdf0e10cSrcweir         }
1938cdf0e10cSrcweir         break;
1939cdf0e10cSrcweir         case MID_NUM_TYPE    : rVal <<= aFmt.GetNumberingType(); break;
1940cdf0e10cSrcweir         case MID_PREFIX      : rVal <<= OUString(sPrefix); break;
1941cdf0e10cSrcweir         case MID_SUFFIX      : rVal <<= OUString(sSuffix); break;
1942cdf0e10cSrcweir         default: return sal_False;
1943cdf0e10cSrcweir     }
1944cdf0e10cSrcweir     return sal_True;
1945cdf0e10cSrcweir }
1946cdf0e10cSrcweir 
PutValue(const uno::Any & rVal,sal_uInt8 nMemberId)1947cdf0e10cSrcweir sal_Bool SwFmtFtnEndAtTxtEnd::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1948cdf0e10cSrcweir {
1949cdf0e10cSrcweir     sal_Bool bRet = sal_True;
1950cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
1951cdf0e10cSrcweir     switch(nMemberId)
1952cdf0e10cSrcweir     {
1953cdf0e10cSrcweir         case MID_COLLECT     :
1954cdf0e10cSrcweir         {
1955cdf0e10cSrcweir             sal_Bool bVal = *(sal_Bool*)rVal.getValue();
1956cdf0e10cSrcweir             if(!bVal && GetValue() >= FTNEND_ATTXTEND)
1957cdf0e10cSrcweir                 SetValue(FTNEND_ATPGORDOCEND);
1958cdf0e10cSrcweir             else if(bVal && GetValue() < FTNEND_ATTXTEND)
1959cdf0e10cSrcweir                 SetValue(FTNEND_ATTXTEND);
1960cdf0e10cSrcweir         }
1961cdf0e10cSrcweir         break;
1962cdf0e10cSrcweir         case MID_RESTART_NUM :
1963cdf0e10cSrcweir         {
1964cdf0e10cSrcweir             sal_Bool bVal = *(sal_Bool*)rVal.getValue();
1965cdf0e10cSrcweir             if(!bVal && GetValue() >= FTNEND_ATTXTEND_OWNNUMSEQ)
1966cdf0e10cSrcweir                 SetValue(FTNEND_ATTXTEND);
1967cdf0e10cSrcweir             else if(bVal && GetValue() < FTNEND_ATTXTEND_OWNNUMSEQ)
1968cdf0e10cSrcweir                 SetValue(FTNEND_ATTXTEND_OWNNUMSEQ);
1969cdf0e10cSrcweir         }
1970cdf0e10cSrcweir         break;
1971cdf0e10cSrcweir         case MID_NUM_START_AT:
1972cdf0e10cSrcweir         {
1973cdf0e10cSrcweir             sal_Int16 nVal = 0;
1974cdf0e10cSrcweir             rVal >>= nVal;
1975cdf0e10cSrcweir             if(nVal >= 0)
1976cdf0e10cSrcweir                 nOffset = nVal;
1977cdf0e10cSrcweir             else
1978cdf0e10cSrcweir                 bRet = sal_False;
1979cdf0e10cSrcweir         }
1980cdf0e10cSrcweir         break;
1981cdf0e10cSrcweir         case MID_OWN_NUM     :
1982cdf0e10cSrcweir         {
1983cdf0e10cSrcweir             sal_Bool bVal = *(sal_Bool*)rVal.getValue();
1984cdf0e10cSrcweir             if(!bVal && GetValue() >= FTNEND_ATTXTEND_OWNNUMANDFMT)
1985cdf0e10cSrcweir                 SetValue(FTNEND_ATTXTEND_OWNNUMSEQ);
1986cdf0e10cSrcweir             else if(bVal && GetValue() < FTNEND_ATTXTEND_OWNNUMANDFMT)
1987cdf0e10cSrcweir                 SetValue(FTNEND_ATTXTEND_OWNNUMANDFMT);
1988cdf0e10cSrcweir         }
1989cdf0e10cSrcweir         break;
1990cdf0e10cSrcweir         case MID_NUM_TYPE    :
1991cdf0e10cSrcweir         {
1992cdf0e10cSrcweir             sal_Int16 nVal = 0;
1993cdf0e10cSrcweir             rVal >>= nVal;
1994cdf0e10cSrcweir             if(nVal >= 0 &&
1995cdf0e10cSrcweir                 (nVal <= SVX_NUM_ARABIC ||
1996cdf0e10cSrcweir                     SVX_NUM_CHARS_UPPER_LETTER_N == nVal ||
1997cdf0e10cSrcweir                         SVX_NUM_CHARS_LOWER_LETTER_N == nVal ))
1998cdf0e10cSrcweir                 aFmt.SetNumberingType(nVal);
1999cdf0e10cSrcweir             else
2000cdf0e10cSrcweir                 bRet = sal_False;
2001cdf0e10cSrcweir         }
2002cdf0e10cSrcweir         break;
2003cdf0e10cSrcweir         case MID_PREFIX      :
2004cdf0e10cSrcweir         {
2005cdf0e10cSrcweir             OUString sVal; rVal >>= sVal;
2006cdf0e10cSrcweir             sPrefix = sVal;
2007cdf0e10cSrcweir         }
2008cdf0e10cSrcweir         break;
2009cdf0e10cSrcweir         case MID_SUFFIX      :
2010cdf0e10cSrcweir         {
2011cdf0e10cSrcweir             OUString sVal; rVal >>= sVal;
2012cdf0e10cSrcweir             sSuffix = sVal;
2013cdf0e10cSrcweir         }
2014cdf0e10cSrcweir         break;
2015cdf0e10cSrcweir         default: bRet = sal_False;
2016cdf0e10cSrcweir     }
2017cdf0e10cSrcweir     return bRet;
2018cdf0e10cSrcweir }
2019cdf0e10cSrcweir 
2020cdf0e10cSrcweir 
2021cdf0e10cSrcweir // class SwFmtFtnAtTxtEnd
2022cdf0e10cSrcweir 
Clone(SfxItemPool *) const2023cdf0e10cSrcweir SfxPoolItem* SwFmtFtnAtTxtEnd::Clone( SfxItemPool* ) const
2024cdf0e10cSrcweir {
2025cdf0e10cSrcweir     SwFmtFtnAtTxtEnd* pNew = new SwFmtFtnAtTxtEnd;
2026cdf0e10cSrcweir     *pNew = *this;
2027cdf0e10cSrcweir     return pNew;
2028cdf0e10cSrcweir }
2029cdf0e10cSrcweir 
2030cdf0e10cSrcweir // class SwFmtEndAtTxtEnd
2031cdf0e10cSrcweir 
Clone(SfxItemPool *) const2032cdf0e10cSrcweir SfxPoolItem* SwFmtEndAtTxtEnd::Clone( SfxItemPool* ) const
2033cdf0e10cSrcweir {
2034cdf0e10cSrcweir     SwFmtEndAtTxtEnd* pNew = new SwFmtEndAtTxtEnd;
2035cdf0e10cSrcweir     *pNew = *this;
2036cdf0e10cSrcweir     return pNew;
2037cdf0e10cSrcweir }
2038cdf0e10cSrcweir 
2039cdf0e10cSrcweir //class SwFmtChain
2040cdf0e10cSrcweir 
2041cdf0e10cSrcweir 
operator ==(const SfxPoolItem & rAttr) const2042cdf0e10cSrcweir int SwFmtChain::operator==( const SfxPoolItem &rAttr ) const
2043cdf0e10cSrcweir {
2044cdf0e10cSrcweir     ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
2045cdf0e10cSrcweir 
2046cdf0e10cSrcweir     return GetPrev() == ((SwFmtChain&)rAttr).GetPrev() &&
2047cdf0e10cSrcweir            GetNext() == ((SwFmtChain&)rAttr).GetNext();
2048cdf0e10cSrcweir }
2049cdf0e10cSrcweir 
SwFmtChain(const SwFmtChain & rCpy)2050cdf0e10cSrcweir SwFmtChain::SwFmtChain( const SwFmtChain &rCpy ) :
2051cdf0e10cSrcweir     SfxPoolItem( RES_CHAIN )
2052cdf0e10cSrcweir {
2053cdf0e10cSrcweir     SetPrev( rCpy.GetPrev() );
2054cdf0e10cSrcweir     SetNext( rCpy.GetNext() );
2055cdf0e10cSrcweir }
2056cdf0e10cSrcweir 
Clone(SfxItemPool *) const2057cdf0e10cSrcweir SfxPoolItem* SwFmtChain::Clone( SfxItemPool* ) const
2058cdf0e10cSrcweir {
2059cdf0e10cSrcweir     SwFmtChain *pRet = new SwFmtChain;
2060cdf0e10cSrcweir     pRet->SetPrev( GetPrev() );
2061cdf0e10cSrcweir     pRet->SetNext( GetNext() );
2062cdf0e10cSrcweir     return pRet;
2063cdf0e10cSrcweir }
2064cdf0e10cSrcweir 
SetPrev(SwFlyFrmFmt * pFmt)2065cdf0e10cSrcweir void SwFmtChain::SetPrev( SwFlyFrmFmt *pFmt )
2066cdf0e10cSrcweir {
2067cdf0e10cSrcweir     if ( pFmt )
2068cdf0e10cSrcweir         pFmt->Add( &aPrev );
2069cdf0e10cSrcweir     else if ( aPrev.GetRegisteredIn() )
2070cdf0e10cSrcweir         ((SwModify*)aPrev.GetRegisteredIn())->Remove( &aPrev );
2071cdf0e10cSrcweir }
2072cdf0e10cSrcweir 
SetNext(SwFlyFrmFmt * pFmt)2073cdf0e10cSrcweir void SwFmtChain::SetNext( SwFlyFrmFmt *pFmt )
2074cdf0e10cSrcweir {
2075cdf0e10cSrcweir     if ( pFmt )
2076cdf0e10cSrcweir         pFmt->Add( &aNext );
2077cdf0e10cSrcweir     else if ( aNext.GetRegisteredIn() )
2078cdf0e10cSrcweir         ((SwModify*)aNext.GetRegisteredIn())->Remove( &aNext );
2079cdf0e10cSrcweir }
2080cdf0e10cSrcweir 
QueryValue(uno::Any & rVal,sal_uInt8 nMemberId) const2081cdf0e10cSrcweir sal_Bool SwFmtChain::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
2082cdf0e10cSrcweir {
2083cdf0e10cSrcweir     // hier wird immer konvertiert!
2084cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
2085cdf0e10cSrcweir     sal_Bool   bRet = sal_True;
2086cdf0e10cSrcweir     XubString aRet;
2087cdf0e10cSrcweir     switch ( nMemberId )
2088cdf0e10cSrcweir     {
2089cdf0e10cSrcweir         case MID_CHAIN_PREVNAME:
2090cdf0e10cSrcweir             if ( GetPrev() )
2091cdf0e10cSrcweir                 aRet = GetPrev()->GetName();
2092cdf0e10cSrcweir             break;
2093cdf0e10cSrcweir         case MID_CHAIN_NEXTNAME:
2094cdf0e10cSrcweir             if ( GetNext() )
2095cdf0e10cSrcweir                 aRet = GetNext()->GetName();
2096cdf0e10cSrcweir             break;
2097cdf0e10cSrcweir         default:
2098*870262e3SDon Lewis             ASSERT( sal_False, "unknown MemberId" );
2099cdf0e10cSrcweir             bRet = sal_False;
2100cdf0e10cSrcweir     }
2101cdf0e10cSrcweir     rVal <<= OUString(aRet);
2102cdf0e10cSrcweir     return bRet;
2103cdf0e10cSrcweir }
2104cdf0e10cSrcweir 
2105cdf0e10cSrcweir 
2106cdf0e10cSrcweir 
2107cdf0e10cSrcweir 
2108cdf0e10cSrcweir //class SwFmtLineNumber
2109cdf0e10cSrcweir 
SwFmtLineNumber()2110cdf0e10cSrcweir SwFmtLineNumber::SwFmtLineNumber() :
2111cdf0e10cSrcweir     SfxPoolItem( RES_LINENUMBER )
2112cdf0e10cSrcweir {
2113cdf0e10cSrcweir     nStartValue = 0;
2114cdf0e10cSrcweir     bCountLines = sal_True;
2115cdf0e10cSrcweir }
2116cdf0e10cSrcweir 
~SwFmtLineNumber()2117cdf0e10cSrcweir SwFmtLineNumber::~SwFmtLineNumber()
2118cdf0e10cSrcweir {
2119cdf0e10cSrcweir }
2120cdf0e10cSrcweir 
operator ==(const SfxPoolItem & rAttr) const2121cdf0e10cSrcweir int SwFmtLineNumber::operator==( const SfxPoolItem &rAttr ) const
2122cdf0e10cSrcweir {
2123cdf0e10cSrcweir     ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
2124cdf0e10cSrcweir 
2125cdf0e10cSrcweir     return nStartValue  == ((SwFmtLineNumber&)rAttr).GetStartValue() &&
2126cdf0e10cSrcweir            bCountLines  == ((SwFmtLineNumber&)rAttr).IsCount();
2127cdf0e10cSrcweir }
2128cdf0e10cSrcweir 
Clone(SfxItemPool *) const2129cdf0e10cSrcweir SfxPoolItem* SwFmtLineNumber::Clone( SfxItemPool* ) const
2130cdf0e10cSrcweir {
2131cdf0e10cSrcweir     return new SwFmtLineNumber( *this );
2132cdf0e10cSrcweir }
2133cdf0e10cSrcweir 
QueryValue(uno::Any & rVal,sal_uInt8 nMemberId) const2134cdf0e10cSrcweir sal_Bool SwFmtLineNumber::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
2135cdf0e10cSrcweir {
2136cdf0e10cSrcweir     // hier wird immer konvertiert!
2137cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
2138cdf0e10cSrcweir     sal_Bool bRet = sal_True;
2139cdf0e10cSrcweir     switch ( nMemberId )
2140cdf0e10cSrcweir     {
2141cdf0e10cSrcweir         case MID_LINENUMBER_COUNT:
2142cdf0e10cSrcweir         {
2143cdf0e10cSrcweir             sal_Bool bTmp = IsCount();
2144cdf0e10cSrcweir             rVal.setValue(&bTmp, ::getBooleanCppuType());
2145cdf0e10cSrcweir         }
2146cdf0e10cSrcweir         break;
2147cdf0e10cSrcweir         case MID_LINENUMBER_STARTVALUE:
2148cdf0e10cSrcweir             rVal <<= (sal_Int32)GetStartValue();
2149cdf0e10cSrcweir             break;
2150cdf0e10cSrcweir         default:
2151*870262e3SDon Lewis             ASSERT( sal_False, "unknown MemberId" );
2152cdf0e10cSrcweir             bRet = sal_False;
2153cdf0e10cSrcweir     }
2154cdf0e10cSrcweir     return bRet;
2155cdf0e10cSrcweir }
2156cdf0e10cSrcweir 
PutValue(const uno::Any & rVal,sal_uInt8 nMemberId)2157cdf0e10cSrcweir sal_Bool SwFmtLineNumber::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
2158cdf0e10cSrcweir {
2159cdf0e10cSrcweir     // hier wird immer konvertiert!
2160cdf0e10cSrcweir     nMemberId &= ~CONVERT_TWIPS;
2161cdf0e10cSrcweir     sal_Bool bRet = sal_True;
2162cdf0e10cSrcweir     switch ( nMemberId )
2163cdf0e10cSrcweir     {
2164cdf0e10cSrcweir         case MID_LINENUMBER_COUNT:
2165cdf0e10cSrcweir             SetCountLines( *(sal_Bool*)rVal.getValue() );
2166cdf0e10cSrcweir             break;
2167cdf0e10cSrcweir         case MID_LINENUMBER_STARTVALUE:
2168cdf0e10cSrcweir         {
2169cdf0e10cSrcweir             sal_Int32 nVal = 0;
2170cdf0e10cSrcweir             if(rVal >>= nVal)
2171cdf0e10cSrcweir                 SetStartValue( nVal );
2172cdf0e10cSrcweir             else
2173cdf0e10cSrcweir                 bRet = sal_False;
2174cdf0e10cSrcweir         }
2175cdf0e10cSrcweir         break;
2176cdf0e10cSrcweir         default:
2177*870262e3SDon Lewis             ASSERT( sal_False, "unknown MemberId" );
2178cdf0e10cSrcweir             bRet = sal_False;
2179cdf0e10cSrcweir     }
2180cdf0e10cSrcweir     return bRet;
2181cdf0e10cSrcweir }
2182cdf0e10cSrcweir 
2183cdf0e10cSrcweir /*************************************************************************
2184cdf0e10cSrcweir  *    class SwTextGridItem
2185cdf0e10cSrcweir  *************************************************************************/
2186cdf0e10cSrcweir 
SwTextGridItem()2187cdf0e10cSrcweir SwTextGridItem::SwTextGridItem()
21884cd218abSOliver-Rainer Wittmann     : SfxPoolItem( RES_TEXTGRID )
21894cd218abSOliver-Rainer Wittmann     , aColor( COL_LIGHTGRAY )
21904cd218abSOliver-Rainer Wittmann     , nLines( 20 )
21914cd218abSOliver-Rainer Wittmann     , nBaseHeight( 400 )
21924cd218abSOliver-Rainer Wittmann     , nRubyHeight( 200 )
21934cd218abSOliver-Rainer Wittmann     , eGridType( GRID_NONE )
21944cd218abSOliver-Rainer Wittmann     , bRubyTextBelow( 0 )
21954cd218abSOliver-Rainer Wittmann     , bPrintGrid( 1 )
21964cd218abSOliver-Rainer Wittmann     , bDisplayGrid( 1 )
21974cd218abSOliver-Rainer Wittmann     , nBaseWidth( 400 )
21984cd218abSOliver-Rainer Wittmann     , bSnapToChars( 1 )
21994cd218abSOliver-Rainer Wittmann     , bSquaredMode( 1 )
2200cdf0e10cSrcweir {
2201cdf0e10cSrcweir }
2202cdf0e10cSrcweir 
~SwTextGridItem()2203cdf0e10cSrcweir SwTextGridItem::~SwTextGridItem()
2204cdf0e10cSrcweir {
2205cdf0e10cSrcweir }
2206cdf0e10cSrcweir 
operator ==(const SfxPoolItem & rAttr) const2207cdf0e10cSrcweir int SwTextGridItem::operator==( const SfxPoolItem& rAttr ) const
2208cdf0e10cSrcweir {
2209cdf0e10cSrcweir     ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
2210cdf0e10cSrcweir     return eGridType == ((SwTextGridItem&)rAttr).GetGridType() &&
2211cdf0e10cSrcweir            nLines == ((SwTextGridItem&)rAttr).GetLines() &&
2212cdf0e10cSrcweir            nBaseHeight == ((SwTextGridItem&)rAttr).GetBaseHeight() &&
2213cdf0e10cSrcweir            nRubyHeight == ((SwTextGridItem&)rAttr).GetRubyHeight() &&
2214cdf0e10cSrcweir            bRubyTextBelow == ((SwTextGridItem&)rAttr).GetRubyTextBelow() &&
2215cdf0e10cSrcweir            bDisplayGrid == ((SwTextGridItem&)rAttr).GetDisplayGrid() &&
2216cdf0e10cSrcweir            bPrintGrid == ((SwTextGridItem&)rAttr).GetPrintGrid() &&
2217cdf0e10cSrcweir            aColor == ((SwTextGridItem&)rAttr).GetColor() &&
2218cdf0e10cSrcweir            nBaseWidth == ((SwTextGridItem&)rAttr).GetBaseWidth() &&
2219cdf0e10cSrcweir            bSnapToChars == ((SwTextGridItem&)rAttr).GetSnapToChars() &&
2220cdf0e10cSrcweir            bSquaredMode == ((SwTextGridItem&)rAttr).GetSquaredMode();
2221cdf0e10cSrcweir }
2222cdf0e10cSrcweir 
Clone(SfxItemPool *) const2223cdf0e10cSrcweir SfxPoolItem* SwTextGridItem::Clone( SfxItemPool* ) const
2224cdf0e10cSrcweir {
2225cdf0e10cSrcweir     return new SwTextGridItem( *this );
2226cdf0e10cSrcweir }
2227cdf0e10cSrcweir 
operator =(const SwTextGridItem & rCpy)2228cdf0e10cSrcweir SwTextGridItem& SwTextGridItem::operator=( const SwTextGridItem& rCpy )
2229cdf0e10cSrcweir {
2230cdf0e10cSrcweir     aColor = rCpy.GetColor();
2231cdf0e10cSrcweir     nLines = rCpy.GetLines();
2232cdf0e10cSrcweir     nBaseHeight = rCpy.GetBaseHeight();
2233cdf0e10cSrcweir     nRubyHeight = rCpy.GetRubyHeight();
2234cdf0e10cSrcweir     eGridType = rCpy.GetGridType();
2235cdf0e10cSrcweir     bRubyTextBelow = rCpy.GetRubyTextBelow();
2236cdf0e10cSrcweir     bPrintGrid = rCpy.GetPrintGrid();
2237cdf0e10cSrcweir     bDisplayGrid = rCpy.GetDisplayGrid();
2238cdf0e10cSrcweir     nBaseWidth = rCpy.GetBaseWidth();
2239cdf0e10cSrcweir     bSnapToChars = rCpy.GetSnapToChars();
2240cdf0e10cSrcweir     bSquaredMode = rCpy.GetSquaredMode();
2241cdf0e10cSrcweir 
2242cdf0e10cSrcweir     return *this;
2243cdf0e10cSrcweir }
2244cdf0e10cSrcweir 
QueryValue(uno::Any & rVal,sal_uInt8 nMemberId) const2245cdf0e10cSrcweir sal_Bool SwTextGridItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
2246cdf0e10cSrcweir {
2247cdf0e10cSrcweir     sal_Bool bRet = sal_True;
2248cdf0e10cSrcweir 
2249cdf0e10cSrcweir     switch( nMemberId & ~CONVERT_TWIPS )
2250cdf0e10cSrcweir     {
2251cdf0e10cSrcweir         case MID_GRID_COLOR:
2252cdf0e10cSrcweir             rVal <<= GetColor().GetColor();
2253cdf0e10cSrcweir             break;
2254cdf0e10cSrcweir         case MID_GRID_LINES:
2255cdf0e10cSrcweir             rVal <<= GetLines();
2256cdf0e10cSrcweir             break;
2257cdf0e10cSrcweir         case MID_GRID_RUBY_BELOW:
2258cdf0e10cSrcweir             rVal.setValue( &bRubyTextBelow, ::getBooleanCppuType() );
2259cdf0e10cSrcweir             break;
2260cdf0e10cSrcweir         case MID_GRID_PRINT:
2261cdf0e10cSrcweir             rVal.setValue( &bPrintGrid, ::getBooleanCppuType() );
2262cdf0e10cSrcweir             break;
2263cdf0e10cSrcweir         case MID_GRID_DISPLAY:
2264cdf0e10cSrcweir             rVal.setValue( &bDisplayGrid, ::getBooleanCppuType() );
2265cdf0e10cSrcweir             break;
2266cdf0e10cSrcweir         case MID_GRID_BASEHEIGHT:
2267cdf0e10cSrcweir             DBG_ASSERT( (nMemberId & CONVERT_TWIPS) != 0,
2268cdf0e10cSrcweir                         "This value needs TWIPS-MM100 conversion" );
2269cdf0e10cSrcweir             rVal <<= (sal_Int32) TWIP_TO_MM100_UNSIGNED(nBaseHeight);
2270cdf0e10cSrcweir             break;
2271cdf0e10cSrcweir         case MID_GRID_BASEWIDTH:
2272cdf0e10cSrcweir             DBG_ASSERT( (nMemberId & CONVERT_TWIPS) != 0,
2273cdf0e10cSrcweir                         "This value needs TWIPS-MM100 conversion" );
2274cdf0e10cSrcweir             rVal <<= (sal_Int32) TWIP_TO_MM100_UNSIGNED(nBaseWidth);
2275cdf0e10cSrcweir             break;
2276cdf0e10cSrcweir         case MID_GRID_RUBYHEIGHT:
2277cdf0e10cSrcweir             DBG_ASSERT( (nMemberId & CONVERT_TWIPS) != 0,
2278cdf0e10cSrcweir                         "This value needs TWIPS-MM100 conversion" );
2279cdf0e10cSrcweir             rVal <<= (sal_Int32)TWIP_TO_MM100_UNSIGNED(nRubyHeight);
2280cdf0e10cSrcweir             break;
2281cdf0e10cSrcweir         case MID_GRID_TYPE:
2282cdf0e10cSrcweir             switch( GetGridType() )
2283cdf0e10cSrcweir             {
2284cdf0e10cSrcweir                 case GRID_NONE:
2285cdf0e10cSrcweir                     rVal <<= text::TextGridMode::NONE;
2286cdf0e10cSrcweir                     break;
2287cdf0e10cSrcweir                 case GRID_LINES_ONLY:
2288cdf0e10cSrcweir                     rVal <<= text::TextGridMode::LINES;
2289cdf0e10cSrcweir                     break;
2290cdf0e10cSrcweir                 case GRID_LINES_CHARS:
2291cdf0e10cSrcweir                     rVal <<= text::TextGridMode::LINES_AND_CHARS;
2292cdf0e10cSrcweir                     break;
2293cdf0e10cSrcweir                 default:
2294cdf0e10cSrcweir                     DBG_ERROR("unknown SwTextGrid value");
2295cdf0e10cSrcweir                     bRet = sal_False;
2296cdf0e10cSrcweir                     break;
2297cdf0e10cSrcweir             }
2298cdf0e10cSrcweir             break;
2299cdf0e10cSrcweir         case MID_GRID_SNAPTOCHARS:
2300cdf0e10cSrcweir             rVal.setValue( &bSnapToChars, ::getBooleanCppuType() );
2301cdf0e10cSrcweir             break;
2302cdf0e10cSrcweir         case MID_GRID_STANDARD_MODE:
2303cdf0e10cSrcweir             {
2304cdf0e10cSrcweir                 sal_Bool bStandardMode = !bSquaredMode;
2305cdf0e10cSrcweir                 rVal.setValue( &bStandardMode, ::getBooleanCppuType() );
2306cdf0e10cSrcweir             }
2307cdf0e10cSrcweir             break;
2308cdf0e10cSrcweir         default:
2309cdf0e10cSrcweir             DBG_ERROR("Unknown SwTextGridItem member");
2310cdf0e10cSrcweir             bRet = sal_False;
2311cdf0e10cSrcweir             break;
2312cdf0e10cSrcweir     }
2313cdf0e10cSrcweir 
2314cdf0e10cSrcweir     return bRet;
2315cdf0e10cSrcweir }
2316cdf0e10cSrcweir 
PutValue(const uno::Any & rVal,sal_uInt8 nMemberId)2317cdf0e10cSrcweir sal_Bool SwTextGridItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
2318cdf0e10cSrcweir {
2319cdf0e10cSrcweir     sal_Bool bRet = sal_True;
2320cdf0e10cSrcweir     switch( nMemberId & ~CONVERT_TWIPS )
2321cdf0e10cSrcweir     {
2322cdf0e10cSrcweir         case MID_GRID_COLOR:
2323cdf0e10cSrcweir         {
2324cdf0e10cSrcweir             sal_Int32 nTmp = 0;
2325cdf0e10cSrcweir             bRet = (rVal >>= nTmp);
2326cdf0e10cSrcweir             if( bRet )
2327cdf0e10cSrcweir                 SetColor( Color(nTmp) );
2328cdf0e10cSrcweir         }
2329cdf0e10cSrcweir         break;
2330cdf0e10cSrcweir         case MID_GRID_LINES:
2331cdf0e10cSrcweir         {
2332cdf0e10cSrcweir             sal_Int16 nTmp = 0;
2333cdf0e10cSrcweir             bRet = (rVal >>= nTmp);
2334cdf0e10cSrcweir             if( bRet && (nTmp >= 0) )
2335cdf0e10cSrcweir                 SetLines( (sal_uInt16)nTmp );
2336cdf0e10cSrcweir             else
2337cdf0e10cSrcweir                 bRet = sal_False;
2338cdf0e10cSrcweir         }
2339cdf0e10cSrcweir         break;
2340cdf0e10cSrcweir         case MID_GRID_RUBY_BELOW:
2341cdf0e10cSrcweir             SetRubyTextBelow( *(sal_Bool*)rVal.getValue() );
2342cdf0e10cSrcweir             break;
2343cdf0e10cSrcweir         case MID_GRID_PRINT:
2344cdf0e10cSrcweir             SetPrintGrid( *(sal_Bool*)rVal.getValue() );
2345cdf0e10cSrcweir             break;
2346cdf0e10cSrcweir         case MID_GRID_DISPLAY:
2347cdf0e10cSrcweir             SetDisplayGrid( *(sal_Bool*)rVal.getValue() );
2348cdf0e10cSrcweir             break;
2349cdf0e10cSrcweir         case MID_GRID_BASEHEIGHT:
2350cdf0e10cSrcweir         case MID_GRID_BASEWIDTH:
2351cdf0e10cSrcweir         case MID_GRID_RUBYHEIGHT:
2352cdf0e10cSrcweir         {
2353cdf0e10cSrcweir             DBG_ASSERT( (nMemberId & CONVERT_TWIPS) != 0,
2354cdf0e10cSrcweir                         "This value needs TWIPS-MM100 conversion" );
2355cdf0e10cSrcweir             sal_Int32 nTmp = 0;
2356cdf0e10cSrcweir             bRet = (rVal >>= nTmp);
2357cdf0e10cSrcweir             nTmp = MM100_TO_TWIP( nTmp );
2358cdf0e10cSrcweir             if( bRet && (nTmp >= 0) && ( nTmp <= USHRT_MAX) )
2359cdf0e10cSrcweir                 if( (nMemberId & ~CONVERT_TWIPS) == MID_GRID_BASEHEIGHT )
2360cdf0e10cSrcweir                     SetBaseHeight( (sal_uInt16)nTmp );
2361cdf0e10cSrcweir                 else if( (nMemberId & ~CONVERT_TWIPS) == MID_GRID_BASEWIDTH )
2362cdf0e10cSrcweir                     SetBaseWidth( (sal_uInt16)nTmp );
2363cdf0e10cSrcweir                 else
2364cdf0e10cSrcweir                     SetRubyHeight( (sal_uInt16)nTmp );
2365cdf0e10cSrcweir             else
2366cdf0e10cSrcweir                 bRet = sal_False;
2367cdf0e10cSrcweir         }
2368cdf0e10cSrcweir         break;
2369cdf0e10cSrcweir         case MID_GRID_TYPE:
2370cdf0e10cSrcweir         {
2371cdf0e10cSrcweir             sal_Int16 nTmp = 0;
2372cdf0e10cSrcweir             bRet = (rVal >>= nTmp);
2373cdf0e10cSrcweir             if( bRet )
2374cdf0e10cSrcweir             {
2375cdf0e10cSrcweir                 switch( nTmp )
2376cdf0e10cSrcweir                 {
2377cdf0e10cSrcweir                     case text::TextGridMode::NONE:
2378cdf0e10cSrcweir                         SetGridType( GRID_NONE );
2379cdf0e10cSrcweir                         break;
2380cdf0e10cSrcweir                     case text::TextGridMode::LINES:
2381cdf0e10cSrcweir                         SetGridType( GRID_LINES_ONLY );
2382cdf0e10cSrcweir                         break;
2383cdf0e10cSrcweir                     case text::TextGridMode::LINES_AND_CHARS:
2384cdf0e10cSrcweir                         SetGridType( GRID_LINES_CHARS );
2385cdf0e10cSrcweir                         break;
2386cdf0e10cSrcweir                     default:
2387cdf0e10cSrcweir                         bRet = sal_False;
2388cdf0e10cSrcweir                         break;
2389cdf0e10cSrcweir                 }
2390cdf0e10cSrcweir             }
2391cdf0e10cSrcweir             break;
2392cdf0e10cSrcweir         }
2393cdf0e10cSrcweir         case MID_GRID_SNAPTOCHARS:
2394cdf0e10cSrcweir             SetSnapToChars( *(sal_Bool*)rVal.getValue() );
2395cdf0e10cSrcweir             break;
2396cdf0e10cSrcweir         case MID_GRID_STANDARD_MODE:
2397cdf0e10cSrcweir         {
2398cdf0e10cSrcweir             sal_Bool bStandard = *(sal_Bool*)rVal.getValue();
2399cdf0e10cSrcweir             SetSquaredMode( !bStandard );
2400cdf0e10cSrcweir             break;
2401cdf0e10cSrcweir         }
2402cdf0e10cSrcweir         default:
2403cdf0e10cSrcweir             DBG_ERROR("Unknown SwTextGridItem member");
2404cdf0e10cSrcweir             bRet = sal_False;
2405cdf0e10cSrcweir     }
2406cdf0e10cSrcweir 
2407cdf0e10cSrcweir     return bRet;
2408cdf0e10cSrcweir }
2409cdf0e10cSrcweir 
SwitchPaperMode(sal_Bool bNew)2410cdf0e10cSrcweir void SwTextGridItem::SwitchPaperMode(sal_Bool bNew)
2411cdf0e10cSrcweir {
2412cdf0e10cSrcweir     if( bNew == bSquaredMode )
2413cdf0e10cSrcweir     {
2414cdf0e10cSrcweir         //same paper mode, not switch
2415cdf0e10cSrcweir         return;
2416cdf0e10cSrcweir     }
2417cdf0e10cSrcweir 
2418cdf0e10cSrcweir     // use default value when grid is disable
2419cdf0e10cSrcweir     if( eGridType == GRID_NONE )
2420cdf0e10cSrcweir     {
2421cdf0e10cSrcweir         bSquaredMode = bNew;
2422cdf0e10cSrcweir         Init();
2423cdf0e10cSrcweir         return;
2424cdf0e10cSrcweir     }
2425cdf0e10cSrcweir 
2426cdf0e10cSrcweir     if( bSquaredMode )
2427cdf0e10cSrcweir     {
2428cdf0e10cSrcweir         //switch from "squared mode" to "standard mode"
2429cdf0e10cSrcweir         nBaseWidth = nBaseHeight;
2430cdf0e10cSrcweir         nBaseHeight = nBaseHeight + nRubyHeight;
2431cdf0e10cSrcweir         nRubyHeight = 0;
2432cdf0e10cSrcweir     }
2433cdf0e10cSrcweir     else
2434cdf0e10cSrcweir     {
2435cdf0e10cSrcweir         //switch from "standard mode" to "squared mode"
2436cdf0e10cSrcweir         nRubyHeight = nBaseHeight/3;
2437cdf0e10cSrcweir         nBaseHeight = nBaseHeight - nRubyHeight;
2438cdf0e10cSrcweir         nBaseWidth = nBaseHeight;
2439cdf0e10cSrcweir     }
2440cdf0e10cSrcweir     bSquaredMode = !bSquaredMode;
2441cdf0e10cSrcweir }
2442cdf0e10cSrcweir 
Init()2443cdf0e10cSrcweir void SwTextGridItem::Init()
2444cdf0e10cSrcweir {
2445cdf0e10cSrcweir     if( bSquaredMode )
2446cdf0e10cSrcweir     {
2447cdf0e10cSrcweir         nLines = 20;
2448cdf0e10cSrcweir         nBaseHeight = 400;
2449cdf0e10cSrcweir         nRubyHeight = 200;
2450cdf0e10cSrcweir         eGridType = GRID_NONE;
2451cdf0e10cSrcweir         bRubyTextBelow = 0;
2452cdf0e10cSrcweir         bPrintGrid = 1;
2453cdf0e10cSrcweir         bDisplayGrid = 1;
2454cdf0e10cSrcweir         bSnapToChars = 1;
2455cdf0e10cSrcweir         nBaseWidth = 400;
2456cdf0e10cSrcweir     }
2457cdf0e10cSrcweir     else
2458cdf0e10cSrcweir     {
2459cdf0e10cSrcweir         nLines = 44;
2460cdf0e10cSrcweir         nBaseHeight = 312;
2461cdf0e10cSrcweir         nRubyHeight = 0;
2462cdf0e10cSrcweir         eGridType = GRID_NONE;
2463cdf0e10cSrcweir         bRubyTextBelow = 0;
2464cdf0e10cSrcweir         bPrintGrid = 1;
2465cdf0e10cSrcweir         bDisplayGrid = 1;
2466cdf0e10cSrcweir         nBaseWidth = 210;
2467cdf0e10cSrcweir         bSnapToChars = 1;
2468cdf0e10cSrcweir 
2469cdf0e10cSrcweir         //default grid type is line only in CJK env
2470cdf0e10cSrcweir         //disable this function due to type area change
2471cdf0e10cSrcweir         //if grid type change.
2472cdf0e10cSrcweir         //if(SvtCJKOptions().IsAsianTypographyEnabled())
2473cdf0e10cSrcweir         //{
2474cdf0e10cSrcweir         //  bDisplayGrid = 0;
2475cdf0e10cSrcweir         //  eGridType = GRID_LINES_ONLY;
2476cdf0e10cSrcweir         //}
2477cdf0e10cSrcweir     }
2478cdf0e10cSrcweir }
2479cdf0e10cSrcweir // class SwHeaderAndFooterEatSpacingItem
2480cdf0e10cSrcweir 
Clone(SfxItemPool *) const2481cdf0e10cSrcweir SfxPoolItem* SwHeaderAndFooterEatSpacingItem::Clone( SfxItemPool* ) const
2482cdf0e10cSrcweir {
2483cdf0e10cSrcweir     return new SwHeaderAndFooterEatSpacingItem( Which(), GetValue() );
2484cdf0e10cSrcweir }
2485cdf0e10cSrcweir 
248664b14621SArmin Le Grand //////////////////////////////////////////////////////////////////////////////
2487cdf0e10cSrcweir //  class SwFrmFmt
2488cdf0e10cSrcweir //  Implementierung teilweise inline im hxx
2489cdf0e10cSrcweir 
2490cdf0e10cSrcweir TYPEINIT1( SwFrmFmt, SwFmt );
2491cdf0e10cSrcweir IMPL_FIXEDMEMPOOL_NEWDEL_DLL( SwFrmFmt, 20, 20 )
2492cdf0e10cSrcweir 
SwFrmFmt(SwAttrPool & rPool,const sal_Char * pFmtNm,SwFrmFmt * pDrvdFrm,sal_uInt16 nFmtWhich,const sal_uInt16 * pWhichRange)249364b14621SArmin Le Grand SwFrmFmt::SwFrmFmt(
249464b14621SArmin Le Grand     SwAttrPool& rPool,
249564b14621SArmin Le Grand     const sal_Char* pFmtNm,
249664b14621SArmin Le Grand     SwFrmFmt *pDrvdFrm,
249764b14621SArmin Le Grand     sal_uInt16 nFmtWhich,
249864b14621SArmin Le Grand     const sal_uInt16* pWhichRange)
249964b14621SArmin Le Grand :   SwFmt(rPool, pFmtNm, (pWhichRange ? pWhichRange : aFrmFmtSetRange), pDrvdFrm, nFmtWhich),
250064b14621SArmin Le Grand     m_wXObject(),
250164b14621SArmin Le Grand     maFillAttributes(),
250264b14621SArmin Le Grand     pCaptionFmt(0)
250364b14621SArmin Le Grand {
250464b14621SArmin Le Grand }
250564b14621SArmin Le Grand 
SwFrmFmt(SwAttrPool & rPool,const String & rFmtNm,SwFrmFmt * pDrvdFrm,sal_uInt16 nFmtWhich,const sal_uInt16 * pWhichRange)250664b14621SArmin Le Grand SwFrmFmt::SwFrmFmt(
250764b14621SArmin Le Grand     SwAttrPool& rPool,
250864b14621SArmin Le Grand     const String &rFmtNm,
250964b14621SArmin Le Grand     SwFrmFmt *pDrvdFrm,
251064b14621SArmin Le Grand     sal_uInt16 nFmtWhich,
251164b14621SArmin Le Grand     const sal_uInt16* pWhichRange)
251264b14621SArmin Le Grand :   SwFmt(rPool, rFmtNm, (pWhichRange ? pWhichRange : aFrmFmtSetRange), pDrvdFrm, nFmtWhich),
251364b14621SArmin Le Grand     m_wXObject(),
251464b14621SArmin Le Grand     maFillAttributes(),
251564b14621SArmin Le Grand     pCaptionFmt(0)
251664b14621SArmin Le Grand {
251764b14621SArmin Le Grand }
251864b14621SArmin Le Grand 
251928160478SArmin Le Grand //UUUU
~SwFrmFmt()252028160478SArmin Le Grand SwFrmFmt::~SwFrmFmt()
252128160478SArmin Le Grand {
252228160478SArmin Le Grand }
252328160478SArmin Le Grand 
Modify(const SfxPoolItem * pOld,const SfxPoolItem * pNew)2524cdf0e10cSrcweir void SwFrmFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
2525cdf0e10cSrcweir {
2526cdf0e10cSrcweir     SwFmtHeader *pH = 0;
2527cdf0e10cSrcweir     SwFmtFooter *pF = 0;
2528cdf0e10cSrcweir 
2529cdf0e10cSrcweir     sal_uInt16 nWhich = pNew ? pNew->Which() : 0;
2530cdf0e10cSrcweir 
2531cdf0e10cSrcweir     if( RES_ATTRSET_CHG == nWhich )
2532cdf0e10cSrcweir     {
2533cdf0e10cSrcweir         ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState(
2534cdf0e10cSrcweir             RES_HEADER, sal_False, (const SfxPoolItem**)&pH );
2535cdf0e10cSrcweir         ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState(
2536cdf0e10cSrcweir             RES_FOOTER, sal_False, (const SfxPoolItem**)&pF );
253764b14621SArmin Le Grand 
253864b14621SArmin Le Grand         //UUUU reset fill information
253928160478SArmin Le Grand         if(maFillAttributes.get() && supportsFullDrawingLayerFillAttributeSet())
254064b14621SArmin Le Grand         {
254164b14621SArmin Le Grand             SfxItemIter aIter(*((SwAttrSetChg*)pNew)->GetChgSet());
254264b14621SArmin Le Grand             bool bReset(false);
254364b14621SArmin Le Grand 
254464b14621SArmin Le Grand             for(const SfxPoolItem* pItem = aIter.FirstItem(); pItem && !bReset; pItem = aIter.NextItem())
254564b14621SArmin Le Grand             {
254664b14621SArmin Le Grand                 bReset = !IsInvalidItem(pItem) && pItem->Which() >= XATTR_FILL_FIRST && pItem->Which() <= XATTR_FILL_LAST;
254764b14621SArmin Le Grand             }
254864b14621SArmin Le Grand 
254964b14621SArmin Le Grand             if(bReset)
255064b14621SArmin Le Grand             {
255164b14621SArmin Le Grand                 maFillAttributes.reset();
255264b14621SArmin Le Grand             }
255364b14621SArmin Le Grand         }
255464b14621SArmin Le Grand     }
255556b35d86SArmin Le Grand     else if(RES_FMT_CHG == nWhich)
255664b14621SArmin Le Grand     {
25577624f10dSArmin Le Grand         //UUUU reset fill information on format change (e.g. style changed)
255828160478SArmin Le Grand         if(maFillAttributes.get() && supportsFullDrawingLayerFillAttributeSet())
25597624f10dSArmin Le Grand         {
256064b14621SArmin Le Grand             maFillAttributes.reset();
2561cdf0e10cSrcweir         }
25627624f10dSArmin Le Grand     }
2563cdf0e10cSrcweir     else if( RES_HEADER == nWhich )
2564cdf0e10cSrcweir         pH = (SwFmtHeader*)pNew;
2565cdf0e10cSrcweir     else if( RES_FOOTER == nWhich )
2566cdf0e10cSrcweir         pF = (SwFmtFooter*)pNew;
2567cdf0e10cSrcweir 
2568cdf0e10cSrcweir     if( pH && pH->IsActive() && !pH->GetHeaderFmt() )
2569cdf0e10cSrcweir     {   //Hat er keinen, mach ich ihm einen
2570cdf0e10cSrcweir         SwFrmFmt *pFmt = GetDoc()->MakeLayoutFmt( RND_STD_HEADER, 0 );
2571cdf0e10cSrcweir         pH->RegisterToFormat( *pFmt );
2572cdf0e10cSrcweir     }
2573cdf0e10cSrcweir 
2574cdf0e10cSrcweir     if( pF && pF->IsActive() && !pF->GetFooterFmt() )
2575cdf0e10cSrcweir     {   //Hat er keinen, mach ich ihm einen
2576cdf0e10cSrcweir         SwFrmFmt *pFmt = GetDoc()->MakeLayoutFmt( RND_STD_FOOTER, 0 );
2577cdf0e10cSrcweir         pF->RegisterToFormat( *pFmt );
2578cdf0e10cSrcweir     }
2579cdf0e10cSrcweir 
2580cdf0e10cSrcweir     // MIB 24.3.98: Modify der Basisklasse muss immer gerufen werden, z.B.
2581cdf0e10cSrcweir     // wegen RESET_FMTWRITTEN.
2582cdf0e10cSrcweir //  if ( GetDepends() )
2583cdf0e10cSrcweir         SwFmt::Modify( pOld, pNew );
2584cdf0e10cSrcweir 
2585cdf0e10cSrcweir     if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which()))
2586cdf0e10cSrcweir     {   // invalidate cached uno object
2587cdf0e10cSrcweir         SetXObject(uno::Reference<uno::XInterface>(0));
2588cdf0e10cSrcweir     }
2589cdf0e10cSrcweir }
2590cdf0e10cSrcweir 
RegisterToFormat(SwFmt & rFmt)2591cdf0e10cSrcweir void SwFrmFmt::RegisterToFormat( SwFmt& rFmt )
2592cdf0e10cSrcweir {
2593cdf0e10cSrcweir     rFmt.Add( this );
2594cdf0e10cSrcweir }
2595cdf0e10cSrcweir 
2596cdf0e10cSrcweir //Vernichtet alle Frms, die in aDepend angemeldet sind.
2597cdf0e10cSrcweir 
DelFrms()2598cdf0e10cSrcweir void SwFrmFmt::DelFrms()
2599cdf0e10cSrcweir {
2600cdf0e10cSrcweir     SwIterator<SwFrm,SwFmt> aIter( *this );
2601cdf0e10cSrcweir     SwFrm * pLast = aIter.First();
2602cdf0e10cSrcweir     if( pLast )
2603cdf0e10cSrcweir         do {
2604cdf0e10cSrcweir                 pLast->Cut();
2605cdf0e10cSrcweir                 delete pLast;
2606cdf0e10cSrcweir         } while( 0 != ( pLast = aIter.Next() ));
2607cdf0e10cSrcweir }
2608cdf0e10cSrcweir 
MakeFrms()2609cdf0e10cSrcweir void SwFrmFmt::MakeFrms()
2610cdf0e10cSrcweir {
2611*870262e3SDon Lewis     ASSERT( sal_False, "Sorry not implemented." );
2612cdf0e10cSrcweir }
2613cdf0e10cSrcweir 
2614cdf0e10cSrcweir 
2615cdf0e10cSrcweir 
FindLayoutRect(const sal_Bool bPrtArea,const Point * pPoint,const sal_Bool bCalcFrm) const2616cdf0e10cSrcweir SwRect SwFrmFmt::FindLayoutRect( const sal_Bool bPrtArea, const Point* pPoint,
2617cdf0e10cSrcweir                                  const sal_Bool bCalcFrm ) const
2618cdf0e10cSrcweir {
2619cdf0e10cSrcweir     SwRect aRet;
2620cdf0e10cSrcweir     SwFrm *pFrm = 0;
2621cdf0e10cSrcweir     if( ISA( SwSectionFmt ) )
2622cdf0e10cSrcweir     {
2623cdf0e10cSrcweir         // dann den frame::Frame per Node2Layout besorgen
2624cdf0e10cSrcweir         SwSectionNode* pSectNd = ((SwSectionFmt*)this)->GetSectionNode();
2625cdf0e10cSrcweir         if( pSectNd )
2626cdf0e10cSrcweir         {
2627cdf0e10cSrcweir             SwNode2Layout aTmp( *pSectNd, pSectNd->GetIndex() - 1 );
2628cdf0e10cSrcweir             pFrm = aTmp.NextFrm();
2629cdf0e10cSrcweir 
2630cdf0e10cSrcweir             if( pFrm && !pFrm->KnowsFormat(*this) )
2631cdf0e10cSrcweir             {
2632cdf0e10cSrcweir                 // die Section hat keinen eigenen frame::Frame, also falls
2633cdf0e10cSrcweir                 // jemand die tatsaechliche Groe?e braucht, so muss das
2634cdf0e10cSrcweir                 // noch implementier werden, in dem sich vom Ende noch
2635cdf0e10cSrcweir                 // der entsprechende frame::Frame besorgt wird.
2636cdf0e10cSrcweir                 // PROBLEM: was passiert bei SectionFrames, die auf unter-
2637cdf0e10cSrcweir                 //          schiedlichen Seiten stehen??
2638cdf0e10cSrcweir                 if( bPrtArea )
2639cdf0e10cSrcweir                     aRet = pFrm->Prt();
2640cdf0e10cSrcweir                 else
2641cdf0e10cSrcweir                 {
2642cdf0e10cSrcweir                     aRet = pFrm->Frm();
2643cdf0e10cSrcweir                     --aRet.Pos().Y();
2644cdf0e10cSrcweir                 }
2645cdf0e10cSrcweir                 pFrm = 0;       // das Rect ist ja jetzt fertig
2646cdf0e10cSrcweir             }
2647cdf0e10cSrcweir         }
2648cdf0e10cSrcweir     }
2649cdf0e10cSrcweir     else
2650cdf0e10cSrcweir     {
2651cdf0e10cSrcweir         sal_uInt16 nFrmType = RES_FLYFRMFMT == Which() ? FRM_FLY : USHRT_MAX;
2652cdf0e10cSrcweir         pFrm = ::GetFrmOfModify( 0, *(SwModify*)this, nFrmType, pPoint,
2653cdf0e10cSrcweir                                     0, bCalcFrm );
2654cdf0e10cSrcweir     }
2655cdf0e10cSrcweir 
2656cdf0e10cSrcweir     if( pFrm )
2657cdf0e10cSrcweir     {
2658cdf0e10cSrcweir         if( bPrtArea )
2659cdf0e10cSrcweir             aRet = pFrm->Prt();
2660cdf0e10cSrcweir         else
2661cdf0e10cSrcweir             aRet = pFrm->Frm();
2662cdf0e10cSrcweir     }
2663cdf0e10cSrcweir     return aRet;
2664cdf0e10cSrcweir }
2665cdf0e10cSrcweir 
FindContactObj()2666cdf0e10cSrcweir SwContact* SwFrmFmt::FindContactObj()
2667cdf0e10cSrcweir {
2668cdf0e10cSrcweir     return SwIterator<SwContact,SwFmt>::FirstElement( *this );
2669cdf0e10cSrcweir }
2670cdf0e10cSrcweir 
FindSdrObject()2671cdf0e10cSrcweir SdrObject* SwFrmFmt::FindSdrObject()
2672cdf0e10cSrcweir {
2673cdf0e10cSrcweir     // --> OD 2005-01-06 #i30669# - use method <FindContactObj()> instead of
2674cdf0e10cSrcweir     // duplicated code.
2675cdf0e10cSrcweir     SwContact* pFoundContact = FindContactObj();
2676cdf0e10cSrcweir     return pFoundContact ? pFoundContact->GetMaster() : 0;
2677cdf0e10cSrcweir     // <--
2678cdf0e10cSrcweir }
2679cdf0e10cSrcweir 
FindRealSdrObject()2680cdf0e10cSrcweir SdrObject* SwFrmFmt::FindRealSdrObject()
2681cdf0e10cSrcweir {
2682cdf0e10cSrcweir     if( RES_FLYFRMFMT == Which() )
2683cdf0e10cSrcweir     {
2684cdf0e10cSrcweir         Point aNullPt;
2685cdf0e10cSrcweir         SwFlyFrm* pFly = (SwFlyFrm*)::GetFrmOfModify( 0, *this, FRM_FLY,
2686cdf0e10cSrcweir                                                     &aNullPt, 0, sal_False );
2687cdf0e10cSrcweir         return pFly ? pFly->GetVirtDrawObj() : 0;
2688cdf0e10cSrcweir     }
2689cdf0e10cSrcweir     return FindSdrObject();
2690cdf0e10cSrcweir }
2691cdf0e10cSrcweir 
2692cdf0e10cSrcweir 
IsLowerOf(const SwFrmFmt & rFmt) const2693cdf0e10cSrcweir sal_Bool SwFrmFmt::IsLowerOf( const SwFrmFmt& rFmt ) const
2694cdf0e10cSrcweir {
2695cdf0e10cSrcweir     //Auch eine Verkettung von Innen nach aussen oder von aussen
2696cdf0e10cSrcweir     //nach innen ist nicht zulaessig.
2697cdf0e10cSrcweir     SwFlyFrm *pSFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement(*this);
2698cdf0e10cSrcweir     if( pSFly )
2699cdf0e10cSrcweir     {
2700cdf0e10cSrcweir         SwFlyFrm *pAskFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement(rFmt);
2701cdf0e10cSrcweir         if( pAskFly )
2702cdf0e10cSrcweir             return pSFly->IsLowerOf( pAskFly );
2703cdf0e10cSrcweir     }
2704cdf0e10cSrcweir 
2705cdf0e10cSrcweir     // dann mal ueber die Node-Positionen versuchen
2706cdf0e10cSrcweir     const SwFmtAnchor* pAnchor = &rFmt.GetAnchor();
2707cdf0e10cSrcweir     if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) && pAnchor->GetCntntAnchor())
2708cdf0e10cSrcweir     {
2709cdf0e10cSrcweir         const SwSpzFrmFmts& rFmts = *GetDoc()->GetSpzFrmFmts();
2710cdf0e10cSrcweir         const SwNode* pFlyNd = pAnchor->GetCntntAnchor()->nNode.GetNode().
2711cdf0e10cSrcweir                                 FindFlyStartNode();
2712cdf0e10cSrcweir         while( pFlyNd )
2713cdf0e10cSrcweir         {
2714cdf0e10cSrcweir             // dann ueber den Anker nach oben "hangeln"
2715cdf0e10cSrcweir             sal_uInt16 n;
2716cdf0e10cSrcweir             for( n = 0; n < rFmts.Count(); ++n )
2717cdf0e10cSrcweir             {
2718cdf0e10cSrcweir                 const SwFrmFmt* pFmt = rFmts[ n ];
2719cdf0e10cSrcweir                 const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx();
2720cdf0e10cSrcweir                 if( pIdx && pFlyNd == &pIdx->GetNode() )
2721cdf0e10cSrcweir                 {
2722cdf0e10cSrcweir                     if( pFmt == this )
2723cdf0e10cSrcweir                         return sal_True;
2724cdf0e10cSrcweir 
2725cdf0e10cSrcweir                     pAnchor = &pFmt->GetAnchor();
2726cdf0e10cSrcweir                     if ((FLY_AT_PAGE == pAnchor->GetAnchorId()) ||
2727cdf0e10cSrcweir                         !pAnchor->GetCntntAnchor() )
2728cdf0e10cSrcweir                     {
2729cdf0e10cSrcweir                         return sal_False;
2730cdf0e10cSrcweir                     }
2731cdf0e10cSrcweir 
2732cdf0e10cSrcweir                     pFlyNd = pAnchor->GetCntntAnchor()->nNode.GetNode().
2733cdf0e10cSrcweir                                 FindFlyStartNode();
2734cdf0e10cSrcweir                     break;
2735cdf0e10cSrcweir                 }
2736cdf0e10cSrcweir             }
2737cdf0e10cSrcweir             if( n >= rFmts.Count() )
2738cdf0e10cSrcweir             {
2739*870262e3SDon Lewis                 ASSERT( sal_False, "Fly-Section but no format found" );
2740cdf0e10cSrcweir                 return sal_False;
2741cdf0e10cSrcweir             }
2742cdf0e10cSrcweir         }
2743cdf0e10cSrcweir     }
2744cdf0e10cSrcweir     return sal_False;
2745cdf0e10cSrcweir }
2746cdf0e10cSrcweir 
2747cdf0e10cSrcweir // --> OD 2004-07-27 #i31698#
GetLayoutDir() const2748cdf0e10cSrcweir SwFrmFmt::tLayoutDir SwFrmFmt::GetLayoutDir() const
2749cdf0e10cSrcweir {
2750cdf0e10cSrcweir     return SwFrmFmt::HORI_L2R;
2751cdf0e10cSrcweir }
2752cdf0e10cSrcweir 
SetLayoutDir(const SwFrmFmt::tLayoutDir)2753cdf0e10cSrcweir void SwFrmFmt::SetLayoutDir( const SwFrmFmt::tLayoutDir )
2754cdf0e10cSrcweir {
2755cdf0e10cSrcweir     // empty body, because default implementation does nothing
2756cdf0e10cSrcweir }
2757cdf0e10cSrcweir // <--
2758cdf0e10cSrcweir 
2759cdf0e10cSrcweir // --> OD 2004-08-06 #i28749#
GetPositionLayoutDir() const2760cdf0e10cSrcweir sal_Int16 SwFrmFmt::GetPositionLayoutDir() const
2761cdf0e10cSrcweir {
2762cdf0e10cSrcweir     return text::PositionLayoutDir::PositionInLayoutDirOfAnchor;
2763cdf0e10cSrcweir }
SetPositionLayoutDir(const sal_Int16)2764cdf0e10cSrcweir void SwFrmFmt::SetPositionLayoutDir( const sal_Int16 )
2765cdf0e10cSrcweir {
2766cdf0e10cSrcweir     // empty body, because default implementation does nothing
2767cdf0e10cSrcweir }
2768cdf0e10cSrcweir // <--
GetDescription() const2769cdf0e10cSrcweir String SwFrmFmt::GetDescription() const
2770cdf0e10cSrcweir {
2771cdf0e10cSrcweir     return SW_RES(STR_FRAME);
2772cdf0e10cSrcweir }
2773cdf0e10cSrcweir 
2774cdf0e10cSrcweir //  class SwFlyFrmFmt
2775cdf0e10cSrcweir //  Implementierung teilweise inline im hxx
2776cdf0e10cSrcweir 
2777cdf0e10cSrcweir TYPEINIT1( SwFlyFrmFmt, SwFrmFmt );
2778cdf0e10cSrcweir IMPL_FIXEDMEMPOOL_NEWDEL( SwFlyFrmFmt,  10, 10 )
2779cdf0e10cSrcweir 
~SwFlyFrmFmt()2780cdf0e10cSrcweir SwFlyFrmFmt::~SwFlyFrmFmt()
2781cdf0e10cSrcweir {
2782cdf0e10cSrcweir     SwIterator<SwFlyFrm,SwFmt> aIter( *this );
2783cdf0e10cSrcweir     SwFlyFrm * pLast = aIter.First();
2784cdf0e10cSrcweir     if( pLast )
2785cdf0e10cSrcweir         do {
2786cdf0e10cSrcweir                 delete pLast;
2787cdf0e10cSrcweir         } while( 0 != ( pLast = aIter.Next() ));
2788cdf0e10cSrcweir 
2789cdf0e10cSrcweir     SwIterator<SwFlyDrawContact,SwFmt> a2ndIter( *this );
2790cdf0e10cSrcweir     SwFlyDrawContact* pC = a2ndIter.First();
2791cdf0e10cSrcweir     if( pC )
2792cdf0e10cSrcweir         do {
2793cdf0e10cSrcweir                 delete pC;
2794cdf0e10cSrcweir 
2795cdf0e10cSrcweir         } while( 0 != ( pC = a2ndIter.Next() ));
2796cdf0e10cSrcweir }
2797cdf0e10cSrcweir 
2798cdf0e10cSrcweir //Erzeugen der Frms wenn das Format einen Absatzgebundenen Rahmen beschreibt.
2799cdf0e10cSrcweir //MA: 14. Feb. 94, Erzeugen der Frms auch fuer Seitengebundene Rahmen.
2800cdf0e10cSrcweir 
MakeFrms()2801cdf0e10cSrcweir void SwFlyFrmFmt::MakeFrms()
2802cdf0e10cSrcweir {
2803cdf0e10cSrcweir     // gibts ueberhaupt ein Layout ??
2804cdf0e10cSrcweir     if( !GetDoc()->GetCurrentViewShell() )
2805cdf0e10cSrcweir         return; //swmod 071108//swmod 071225
2806cdf0e10cSrcweir 
2807cdf0e10cSrcweir     SwModify *pModify = 0;
2808cdf0e10cSrcweir     // OD 24.07.2003 #111032# - create local copy of anchor attribute for possible changes.
2809cdf0e10cSrcweir     SwFmtAnchor aAnchorAttr( GetAnchor() );
2810cdf0e10cSrcweir     switch( aAnchorAttr.GetAnchorId() )
2811cdf0e10cSrcweir     {
2812cdf0e10cSrcweir     case FLY_AS_CHAR:
2813cdf0e10cSrcweir     case FLY_AT_PARA:
2814cdf0e10cSrcweir     case FLY_AT_CHAR:
2815cdf0e10cSrcweir         if( aAnchorAttr.GetCntntAnchor() )
2816cdf0e10cSrcweir         {
2817cdf0e10cSrcweir             pModify = aAnchorAttr.GetCntntAnchor()->nNode.GetNode().GetCntntNode();
2818cdf0e10cSrcweir         }
2819cdf0e10cSrcweir         break;
2820cdf0e10cSrcweir 
2821cdf0e10cSrcweir     case FLY_AT_FLY:
2822cdf0e10cSrcweir         if( aAnchorAttr.GetCntntAnchor() )
2823cdf0e10cSrcweir         {
2824cdf0e10cSrcweir             //Erst einmal ueber den Inhalt suchen, weil konstant schnell. Kann
2825cdf0e10cSrcweir             //Bei verketteten Rahmen aber auch schief gehen, weil dann evtl.
2826cdf0e10cSrcweir             //niemals ein frame::Frame zu dem Inhalt existiert. Dann muss leider noch
2827cdf0e10cSrcweir             //die Suche vom StartNode zum FrameFormat sein.
2828cdf0e10cSrcweir             SwNodeIndex aIdx( aAnchorAttr.GetCntntAnchor()->nNode );
2829cdf0e10cSrcweir             SwCntntNode *pCNd = GetDoc()->GetNodes().GoNext( &aIdx );
2830cdf0e10cSrcweir             // --> OD 2009-12-28 #i105535#
2831cdf0e10cSrcweir             if ( pCNd == 0 )
2832cdf0e10cSrcweir             {
2833cdf0e10cSrcweir                 pCNd = aAnchorAttr.GetCntntAnchor()->nNode.GetNode().GetCntntNode();
2834cdf0e10cSrcweir             }
2835cdf0e10cSrcweir             if ( pCNd )
2836cdf0e10cSrcweir             // <--
2837cdf0e10cSrcweir             {
2838cdf0e10cSrcweir                 if( SwIterator<SwFrm,SwCntntNode>::FirstElement( *pCNd ) )
2839cdf0e10cSrcweir                 {
2840cdf0e10cSrcweir                     pModify = pCNd;
2841cdf0e10cSrcweir                 }
2842cdf0e10cSrcweir             }
2843cdf0e10cSrcweir             // --> OD 2009-12-28 #i105535#
2844cdf0e10cSrcweir             if ( pModify == 0 )
2845cdf0e10cSrcweir             // <--
2846cdf0e10cSrcweir             {
2847cdf0e10cSrcweir                 const SwNodeIndex &rIdx = aAnchorAttr.GetCntntAnchor()->nNode;
2848cdf0e10cSrcweir                 SwSpzFrmFmts& rFmts = *GetDoc()->GetSpzFrmFmts();
2849cdf0e10cSrcweir                 for( sal_uInt16 i = 0; i < rFmts.Count(); ++i )
2850cdf0e10cSrcweir                 {
2851cdf0e10cSrcweir                     SwFrmFmt* pFlyFmt = rFmts[i];
2852cdf0e10cSrcweir                     if( pFlyFmt->GetCntnt().GetCntntIdx() &&
2853cdf0e10cSrcweir                         rIdx == *pFlyFmt->GetCntnt().GetCntntIdx() )
2854cdf0e10cSrcweir                     {
2855cdf0e10cSrcweir                         pModify = pFlyFmt;
2856cdf0e10cSrcweir                         break;
2857cdf0e10cSrcweir                     }
2858cdf0e10cSrcweir                 }
2859cdf0e10cSrcweir             }
2860cdf0e10cSrcweir         }
2861cdf0e10cSrcweir         break;
2862cdf0e10cSrcweir 
2863cdf0e10cSrcweir     case FLY_AT_PAGE:
2864cdf0e10cSrcweir         {
2865cdf0e10cSrcweir             sal_uInt16 nPgNum = aAnchorAttr.GetPageNum();
2866cdf0e10cSrcweir             SwPageFrm *pPage = (SwPageFrm*)GetDoc()->GetCurrentLayout()->Lower();   //swmod 080218
2867c0286415SOliver-Rainer Wittmann             if( nPgNum == 0 && aAnchorAttr.GetCntntAnchor() )
2868cdf0e10cSrcweir             {
2869c0286415SOliver-Rainer Wittmann                 SwCntntNode *pCNd = aAnchorAttr.GetCntntAnchor()->nNode.GetNode().GetCntntNode();
2870cdf0e10cSrcweir                 SwIterator<SwFrm,SwCntntNode> aIter( *pCNd );
2871c0286415SOliver-Rainer Wittmann                 for ( SwFrm* pFrm = aIter.First(); pFrm != NULL; pFrm = aIter.Next() )
2872cdf0e10cSrcweir                 {
2873cdf0e10cSrcweir                     pPage = pFrm->FindPageFrm();
2874cdf0e10cSrcweir                     if( pPage )
2875cdf0e10cSrcweir                     {
2876cdf0e10cSrcweir                         nPgNum = pPage->GetPhyPageNum();
2877cdf0e10cSrcweir                         aAnchorAttr.SetPageNum( nPgNum );
2878cdf0e10cSrcweir                         aAnchorAttr.SetAnchor( 0 );
2879cdf0e10cSrcweir                         SetFmtAttr( aAnchorAttr );
2880cdf0e10cSrcweir                         break;
2881cdf0e10cSrcweir                     }
2882cdf0e10cSrcweir                 }
2883c0286415SOliver-Rainer Wittmann             }
2884cdf0e10cSrcweir             while ( pPage )
2885cdf0e10cSrcweir             {
2886cdf0e10cSrcweir                 if ( pPage->GetPhyPageNum() == nPgNum )
2887cdf0e10cSrcweir                 {
2888cdf0e10cSrcweir                     pPage->PlaceFly( 0, this );
2889cdf0e10cSrcweir                     break;
2890cdf0e10cSrcweir                 }
2891cdf0e10cSrcweir                 pPage = (SwPageFrm*)pPage->GetNext();
2892cdf0e10cSrcweir             }
2893cdf0e10cSrcweir         }
2894cdf0e10cSrcweir         break;
2895cdf0e10cSrcweir     default:
2896cdf0e10cSrcweir         break;
2897cdf0e10cSrcweir     }
2898cdf0e10cSrcweir 
2899cdf0e10cSrcweir     if( pModify )
2900cdf0e10cSrcweir     {
2901cdf0e10cSrcweir         SwIterator<SwFrm,SwModify> aIter( *pModify );
2902cdf0e10cSrcweir         for( SwFrm *pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
2903cdf0e10cSrcweir         {
2904cdf0e10cSrcweir             sal_Bool bAdd = !pFrm->IsCntntFrm() ||
2905cdf0e10cSrcweir                             !((SwCntntFrm*)pFrm)->IsFollow();
2906cdf0e10cSrcweir 
2907cdf0e10cSrcweir             if ( FLY_AT_FLY == aAnchorAttr.GetAnchorId() && !pFrm->IsFlyFrm() )
2908cdf0e10cSrcweir             {
2909cdf0e10cSrcweir                 // --> OD 2009-12-28 #i105535#
2910cdf0e10cSrcweir                 // fallback to anchor type at-paragraph, if no fly frame is found.
2911cdf0e10cSrcweir //                pFrm = pFrm->FindFlyFrm();
2912cdf0e10cSrcweir                 SwFrm* pFlyFrm = pFrm->FindFlyFrm();
2913cdf0e10cSrcweir                 if ( pFlyFrm )
2914cdf0e10cSrcweir                 {
2915cdf0e10cSrcweir                     pFrm = pFlyFrm;
2916cdf0e10cSrcweir                 }
2917cdf0e10cSrcweir                 else
2918cdf0e10cSrcweir                 {
2919cdf0e10cSrcweir                     aAnchorAttr.SetType( FLY_AT_PARA );
2920cdf0e10cSrcweir                     SetFmtAttr( aAnchorAttr );
2921cdf0e10cSrcweir                     MakeFrms();
2922cdf0e10cSrcweir                     return;
2923cdf0e10cSrcweir                 }
2924cdf0e10cSrcweir                 // <--
2925cdf0e10cSrcweir             }
2926cdf0e10cSrcweir 
2927cdf0e10cSrcweir             if( pFrm->GetDrawObjs() )
2928cdf0e10cSrcweir             {
2929cdf0e10cSrcweir                 // --> OD 2004-07-01 #i28701# - new type <SwSortedObjs>
2930cdf0e10cSrcweir                 SwSortedObjs &rObjs = *pFrm->GetDrawObjs();
2931cdf0e10cSrcweir                 for( sal_uInt16 i = 0; i < rObjs.Count(); ++i)
2932cdf0e10cSrcweir                 {
2933cdf0e10cSrcweir                     // --> OD 2004-07-01 #i28701# - consider changed type of
2934cdf0e10cSrcweir                     // <SwSortedObjs> entries.
2935cdf0e10cSrcweir                     SwAnchoredObject* pObj = rObjs[i];
2936cdf0e10cSrcweir                     if( pObj->ISA(SwFlyFrm) &&
2937cdf0e10cSrcweir                         (&pObj->GetFrmFmt()) == this )
2938cdf0e10cSrcweir                     {
2939cdf0e10cSrcweir                         bAdd = sal_False;
2940cdf0e10cSrcweir                         break;
2941cdf0e10cSrcweir                     }
2942cdf0e10cSrcweir                 }
2943cdf0e10cSrcweir             }
2944cdf0e10cSrcweir 
2945cdf0e10cSrcweir             if( bAdd )
2946cdf0e10cSrcweir             {
2947cdf0e10cSrcweir                 SwFlyFrm *pFly = 0;
2948cdf0e10cSrcweir                 switch( aAnchorAttr.GetAnchorId() )
2949cdf0e10cSrcweir                 {
2950cdf0e10cSrcweir                 case FLY_AT_FLY:
2951cdf0e10cSrcweir                     pFly = new SwFlyLayFrm( this, pFrm, pFrm );
2952cdf0e10cSrcweir                     break;
2953cdf0e10cSrcweir 
2954cdf0e10cSrcweir                 case FLY_AT_PARA:
2955cdf0e10cSrcweir                 case FLY_AT_CHAR:
2956cdf0e10cSrcweir                     pFly = new SwFlyAtCntFrm( this, pFrm, pFrm );
2957cdf0e10cSrcweir                     break;
2958cdf0e10cSrcweir 
2959cdf0e10cSrcweir                 case FLY_AS_CHAR:
2960cdf0e10cSrcweir                     pFly = new SwFlyInCntFrm( this, pFrm, pFrm );
2961cdf0e10cSrcweir                     break;
2962cdf0e10cSrcweir                 default:
2963*870262e3SDon Lewis                     ASSERT( sal_False, "New anchor type" )
2964cdf0e10cSrcweir                     break;
2965cdf0e10cSrcweir                 }
2966cdf0e10cSrcweir                 pFrm->AppendFly( pFly );
2967cdf0e10cSrcweir                 SwPageFrm *pPage = pFly->FindPageFrm();
2968cdf0e10cSrcweir                 if( pPage )
2969cdf0e10cSrcweir                     ::RegistFlys( pPage, pFly );
2970cdf0e10cSrcweir             }
2971cdf0e10cSrcweir         }
2972cdf0e10cSrcweir     }
2973cdf0e10cSrcweir }
2974cdf0e10cSrcweir 
GetFrm(const Point * pPoint,const sal_Bool bCalcFrm) const2975cdf0e10cSrcweir SwFlyFrm* SwFlyFrmFmt::GetFrm( const Point* pPoint, const sal_Bool bCalcFrm ) const
2976cdf0e10cSrcweir {
2977cdf0e10cSrcweir     return (SwFlyFrm*)::GetFrmOfModify( 0, *(SwModify*)this, FRM_FLY,
2978cdf0e10cSrcweir                                             pPoint, 0, bCalcFrm );
2979cdf0e10cSrcweir }
2980cdf0e10cSrcweir 
GetAnchoredObj(const Point * pPoint,const sal_Bool bCalcFrm) const2981cdf0e10cSrcweir SwAnchoredObject* SwFlyFrmFmt::GetAnchoredObj( const Point* pPoint, const sal_Bool bCalcFrm ) const
2982cdf0e10cSrcweir {
2983cdf0e10cSrcweir     SwFlyFrm* pFlyFrm( GetFrm( pPoint, bCalcFrm ) );
2984cdf0e10cSrcweir     if ( pFlyFrm )
2985cdf0e10cSrcweir     {
2986cdf0e10cSrcweir         return dynamic_cast<SwAnchoredObject*>(pFlyFrm);
2987cdf0e10cSrcweir     }
2988cdf0e10cSrcweir     else
2989cdf0e10cSrcweir     {
2990cdf0e10cSrcweir         return 0L;
2991cdf0e10cSrcweir     }
2992cdf0e10cSrcweir }
2993cdf0e10cSrcweir 
2994cdf0e10cSrcweir 
GetInfo(SfxPoolItem & rInfo) const2995cdf0e10cSrcweir sal_Bool SwFlyFrmFmt::GetInfo( SfxPoolItem& rInfo ) const
2996cdf0e10cSrcweir {
2997c0286415SOliver-Rainer Wittmann     sal_Bool bRet = sal_True;
2998cdf0e10cSrcweir     switch( rInfo.Which() )
2999cdf0e10cSrcweir     {
3000cdf0e10cSrcweir     case RES_CONTENT_VISIBLE:
3001cdf0e10cSrcweir         {
3002cdf0e10cSrcweir             ((SwPtrMsgPoolItem&)rInfo).pObject = SwIterator<SwFrm,SwFmt>::FirstElement( *this );
3003cdf0e10cSrcweir         }
3004c0286415SOliver-Rainer Wittmann         bRet = sal_False;
3005c0286415SOliver-Rainer Wittmann         break;
3006cdf0e10cSrcweir 
3007cdf0e10cSrcweir     default:
3008c0286415SOliver-Rainer Wittmann         bRet = SwFrmFmt::GetInfo( rInfo );
3009c0286415SOliver-Rainer Wittmann         break;
3010cdf0e10cSrcweir     }
3011c0286415SOliver-Rainer Wittmann     return bRet;
3012cdf0e10cSrcweir }
3013cdf0e10cSrcweir 
3014cdf0e10cSrcweir // --> OD 2009-07-14 #i73249#
SetObjTitle(const String & rTitle,bool bBroadcast)3015cdf0e10cSrcweir void SwFlyFrmFmt::SetObjTitle( const String& rTitle, bool bBroadcast )
3016cdf0e10cSrcweir {
3017cdf0e10cSrcweir     SdrObject* pMasterObject = FindSdrObject();
3018cdf0e10cSrcweir     ASSERT( pMasterObject,
3019cdf0e10cSrcweir             "<SwNoTxtNode::SetObjTitle(..)> - missing <SdrObject> instance" );
3020cdf0e10cSrcweir     if ( !pMasterObject )
3021cdf0e10cSrcweir     {
3022cdf0e10cSrcweir         return;
3023cdf0e10cSrcweir     }
3024cdf0e10cSrcweir 
3025cdf0e10cSrcweir     if( bBroadcast )
3026cdf0e10cSrcweir     {
3027cdf0e10cSrcweir         SwStringMsgPoolItem aOld( RES_TITLE_CHANGED, pMasterObject->GetTitle() );
3028cdf0e10cSrcweir         SwStringMsgPoolItem aNew( RES_TITLE_CHANGED, rTitle );
3029cdf0e10cSrcweir         pMasterObject->SetTitle( rTitle );
3030cdf0e10cSrcweir         ModifyNotification( &aOld, &aNew );
3031cdf0e10cSrcweir     }
3032cdf0e10cSrcweir     else
3033cdf0e10cSrcweir     {
3034cdf0e10cSrcweir         pMasterObject->SetTitle( rTitle );
3035cdf0e10cSrcweir     }
3036cdf0e10cSrcweir }
3037cdf0e10cSrcweir 
GetObjTitle() const3038cdf0e10cSrcweir const String SwFlyFrmFmt::GetObjTitle() const
3039cdf0e10cSrcweir {
3040cdf0e10cSrcweir     const SdrObject* pMasterObject = FindSdrObject();
3041cdf0e10cSrcweir     ASSERT( pMasterObject,
3042cdf0e10cSrcweir             "<SwFlyFrmFmt::GetObjTitle(..)> - missing <SdrObject> instance" );
3043cdf0e10cSrcweir     if ( !pMasterObject )
3044cdf0e10cSrcweir     {
3045cdf0e10cSrcweir         return aEmptyStr;
3046cdf0e10cSrcweir     }
3047cdf0e10cSrcweir 
3048cdf0e10cSrcweir     return pMasterObject->GetTitle();
3049cdf0e10cSrcweir }
3050cdf0e10cSrcweir 
SetObjDescription(const String & rDescription,bool bBroadcast)3051cdf0e10cSrcweir void SwFlyFrmFmt::SetObjDescription( const String& rDescription, bool bBroadcast )
3052cdf0e10cSrcweir {
3053cdf0e10cSrcweir     SdrObject* pMasterObject = FindSdrObject();
3054cdf0e10cSrcweir     ASSERT( pMasterObject,
3055cdf0e10cSrcweir             "<SwFlyFrmFmt::SetDescription(..)> - missing <SdrObject> instance" );
3056cdf0e10cSrcweir     if ( !pMasterObject )
3057cdf0e10cSrcweir     {
3058cdf0e10cSrcweir         return;
3059cdf0e10cSrcweir     }
3060cdf0e10cSrcweir 
3061cdf0e10cSrcweir     if( bBroadcast )
3062cdf0e10cSrcweir     {
3063cdf0e10cSrcweir         SwStringMsgPoolItem aOld( RES_DESCRIPTION_CHANGED, pMasterObject->GetDescription() );
3064cdf0e10cSrcweir         SwStringMsgPoolItem aNew( RES_DESCRIPTION_CHANGED, rDescription );
3065cdf0e10cSrcweir         pMasterObject->SetDescription( rDescription );
3066cdf0e10cSrcweir         ModifyNotification( &aOld, &aNew );
3067cdf0e10cSrcweir     }
3068cdf0e10cSrcweir     else
3069cdf0e10cSrcweir     {
3070cdf0e10cSrcweir         pMasterObject->SetDescription( rDescription );
3071cdf0e10cSrcweir     }
3072cdf0e10cSrcweir }
3073cdf0e10cSrcweir 
GetObjDescription() const3074cdf0e10cSrcweir const String SwFlyFrmFmt::GetObjDescription() const
3075cdf0e10cSrcweir {
3076cdf0e10cSrcweir     const SdrObject* pMasterObject = FindSdrObject();
3077cdf0e10cSrcweir     ASSERT( pMasterObject,
3078cdf0e10cSrcweir             "<SwNoTxtNode::GetDescription(..)> - missing <SdrObject> instance" );
3079cdf0e10cSrcweir     if ( !pMasterObject )
3080cdf0e10cSrcweir     {
3081cdf0e10cSrcweir         return aEmptyStr;
3082cdf0e10cSrcweir     }
3083cdf0e10cSrcweir 
3084cdf0e10cSrcweir     return pMasterObject->GetDescription();
3085cdf0e10cSrcweir }
3086cdf0e10cSrcweir // <--
3087cdf0e10cSrcweir 
3088cdf0e10cSrcweir /** SwFlyFrmFmt::IsBackgroundTransparent - for #99657#
3089cdf0e10cSrcweir 
3090cdf0e10cSrcweir     OD 22.08.2002 - overloading virtual method and its default implementation,
3091cdf0e10cSrcweir     because format of fly frame provides transparent backgrounds.
3092cdf0e10cSrcweir     Method determines, if background of fly frame is transparent.
3093cdf0e10cSrcweir 
3094cdf0e10cSrcweir     @author OD
3095cdf0e10cSrcweir 
3096cdf0e10cSrcweir     @return true, if background color is transparent, but not "no fill"
3097cdf0e10cSrcweir     or the transparency of a existing background graphic is set.
3098cdf0e10cSrcweir */
IsBackgroundTransparent() const3099cdf0e10cSrcweir sal_Bool SwFlyFrmFmt::IsBackgroundTransparent() const
3100cdf0e10cSrcweir {
31016104255bSArmin Le Grand     //UUUU
310228160478SArmin Le Grand     if(supportsFullDrawingLayerFillAttributeSet() && getSdrAllFillAttributesHelper())
31036104255bSArmin Le Grand     {
310456b35d86SArmin Le Grand         return getSdrAllFillAttributesHelper()->isTransparent();
31056104255bSArmin Le Grand     }
3106cdf0e10cSrcweir 
3107cdf0e10cSrcweir     /// NOTE: If background color is "no fill"/"auto fill" (COL_TRANSPARENT)
3108cdf0e10cSrcweir     ///     and there is no background graphic, it "inherites" the background
3109cdf0e10cSrcweir     ///     from its anchor.
3110cdf0e10cSrcweir     if ( (GetBackground().GetColor().GetTransparency() != 0) &&
3111cdf0e10cSrcweir          (GetBackground().GetColor() != COL_TRANSPARENT)
3112cdf0e10cSrcweir        )
3113cdf0e10cSrcweir     {
31146104255bSArmin Le Grand         return sal_True;
3115cdf0e10cSrcweir     }
3116cdf0e10cSrcweir     else
3117cdf0e10cSrcweir     {
3118cdf0e10cSrcweir         const GraphicObject *pTmpGrf =
3119cdf0e10cSrcweir                 static_cast<const GraphicObject*>(GetBackground().GetGraphicObject());
3120cdf0e10cSrcweir         if ( (pTmpGrf) &&
3121cdf0e10cSrcweir              (pTmpGrf->GetAttr().GetTransparency() != 0)
3122cdf0e10cSrcweir            )
3123cdf0e10cSrcweir         {
31246104255bSArmin Le Grand             return sal_True;
3125cdf0e10cSrcweir         }
3126cdf0e10cSrcweir     }
3127cdf0e10cSrcweir 
31286104255bSArmin Le Grand     return sal_False;
3129cdf0e10cSrcweir }
3130cdf0e10cSrcweir 
3131cdf0e10cSrcweir /** SwFlyFrmFmt::IsBackgroundBrushInherited - for #103898#
3132cdf0e10cSrcweir 
3133cdf0e10cSrcweir     OD 08.10.2002 - method to determine, if the brush for drawing the
3134cdf0e10cSrcweir     background is "inherited" from its parent/grandparent.
3135cdf0e10cSrcweir     This is the case, if no background graphic is set and the background
3136cdf0e10cSrcweir     color is "no fill"/"auto fill"
3137cdf0e10cSrcweir     NOTE: condition is "copied" from method <SwFrm::GetBackgroundBrush(..).
3138cdf0e10cSrcweir 
3139cdf0e10cSrcweir     @author OD
3140cdf0e10cSrcweir 
3141cdf0e10cSrcweir     @return true, if background brush is "inherited" from parent/grandparent
3142cdf0e10cSrcweir */
IsBackgroundBrushInherited() const3143cdf0e10cSrcweir sal_Bool SwFlyFrmFmt::IsBackgroundBrushInherited() const
3144cdf0e10cSrcweir {
31456104255bSArmin Le Grand     //UUUU
314628160478SArmin Le Grand     if(supportsFullDrawingLayerFillAttributeSet() && getSdrAllFillAttributesHelper())
31476104255bSArmin Le Grand     {
314856b35d86SArmin Le Grand         return !getSdrAllFillAttributesHelper()->isUsed();
31496104255bSArmin Le Grand     }
31506104255bSArmin Le Grand     else if ( (GetBackground().GetColor() == COL_TRANSPARENT) &&
3151cdf0e10cSrcweir          !(GetBackground().GetGraphicObject()) )
3152cdf0e10cSrcweir     {
31536104255bSArmin Le Grand         return sal_True;
3154cdf0e10cSrcweir     }
3155cdf0e10cSrcweir 
31566104255bSArmin Le Grand     return sal_False;
3157cdf0e10cSrcweir }
3158cdf0e10cSrcweir 
3159cdf0e10cSrcweir // --> OD 2006-02-28 #125892#
SwHandleAnchorNodeChg(SwFlyFrmFmt & _rFlyFrmFmt,const SwFmtAnchor & _rNewAnchorFmt,SwFlyFrm * _pKeepThisFlyFrm)3160cdf0e10cSrcweir SwHandleAnchorNodeChg::SwHandleAnchorNodeChg( SwFlyFrmFmt& _rFlyFrmFmt,
3161cdf0e10cSrcweir                                               const SwFmtAnchor& _rNewAnchorFmt,
3162cdf0e10cSrcweir                                               SwFlyFrm* _pKeepThisFlyFrm )
3163cdf0e10cSrcweir     : mrFlyFrmFmt( _rFlyFrmFmt ),
3164cdf0e10cSrcweir       mbAnchorNodeChanged( false )
3165cdf0e10cSrcweir {
3166cdf0e10cSrcweir     const RndStdIds nNewAnchorType( _rNewAnchorFmt.GetAnchorId() );
3167cdf0e10cSrcweir     if ( ((nNewAnchorType == FLY_AT_PARA) ||
3168cdf0e10cSrcweir           (nNewAnchorType == FLY_AT_CHAR)) &&
3169cdf0e10cSrcweir          _rNewAnchorFmt.GetCntntAnchor() &&
3170cdf0e10cSrcweir          _rNewAnchorFmt.GetCntntAnchor()->nNode.GetNode().GetCntntNode() )
3171cdf0e10cSrcweir     {
3172cdf0e10cSrcweir         const SwFmtAnchor& aOldAnchorFmt( _rFlyFrmFmt.GetAnchor() );
3173cdf0e10cSrcweir         if ( aOldAnchorFmt.GetAnchorId() == nNewAnchorType &&
3174cdf0e10cSrcweir              aOldAnchorFmt.GetCntntAnchor() &&
3175cdf0e10cSrcweir              aOldAnchorFmt.GetCntntAnchor()->nNode.GetNode().GetCntntNode() &&
3176cdf0e10cSrcweir              aOldAnchorFmt.GetCntntAnchor()->nNode !=
3177cdf0e10cSrcweir                                     _rNewAnchorFmt.GetCntntAnchor()->nNode )
3178cdf0e10cSrcweir         {
3179cdf0e10cSrcweir             // determine 'old' number of anchor frames
3180cdf0e10cSrcweir             sal_uInt32 nOldNumOfAnchFrm( 0L );
3181cdf0e10cSrcweir             SwIterator<SwFrm,SwCntntNode> aOldIter( *(aOldAnchorFmt.GetCntntAnchor()->nNode.GetNode().GetCntntNode()) );
3182cdf0e10cSrcweir             for( SwFrm* pOld = aOldIter.First(); pOld; pOld = aOldIter.Next() )
3183cdf0e10cSrcweir             {
3184cdf0e10cSrcweir                 ++nOldNumOfAnchFrm;
3185cdf0e10cSrcweir             }
3186cdf0e10cSrcweir             // determine 'new' number of anchor frames
3187cdf0e10cSrcweir             sal_uInt32 nNewNumOfAnchFrm( 0L );
3188cdf0e10cSrcweir             SwIterator<SwFrm,SwCntntNode> aNewIter( *(_rNewAnchorFmt.GetCntntAnchor()->nNode.GetNode().GetCntntNode()) );
3189cdf0e10cSrcweir             for( SwFrm* pNew = aNewIter.First(); pNew; pNew = aNewIter.Next() )
3190cdf0e10cSrcweir             {
3191cdf0e10cSrcweir                 ++nNewNumOfAnchFrm;
3192cdf0e10cSrcweir             }
3193cdf0e10cSrcweir             if ( nOldNumOfAnchFrm != nNewNumOfAnchFrm )
3194cdf0e10cSrcweir             {
3195cdf0e10cSrcweir                 // delete existing fly frames except <_pKeepThisFlyFrm>
3196cdf0e10cSrcweir                 SwIterator<SwFrm,SwFmt> aIter( mrFlyFrmFmt );
3197cdf0e10cSrcweir                 SwFrm* pFrm = aIter.First();
3198cdf0e10cSrcweir                 if ( pFrm )
3199cdf0e10cSrcweir                 {
3200cdf0e10cSrcweir                     do {
3201cdf0e10cSrcweir                         if ( pFrm != _pKeepThisFlyFrm )
3202cdf0e10cSrcweir                         {
3203cdf0e10cSrcweir                             pFrm->Cut();
3204cdf0e10cSrcweir                             delete pFrm;
3205cdf0e10cSrcweir                         }
3206cdf0e10cSrcweir                     } while( 0 != ( pFrm = aIter.Next() ));
3207cdf0e10cSrcweir                 }
3208cdf0e10cSrcweir                 // indicate, that re-creation of fly frames necessary
3209cdf0e10cSrcweir                 mbAnchorNodeChanged = true;
3210cdf0e10cSrcweir             }
3211cdf0e10cSrcweir         }
3212cdf0e10cSrcweir     }
3213cdf0e10cSrcweir }
3214cdf0e10cSrcweir 
~SwHandleAnchorNodeChg()3215cdf0e10cSrcweir SwHandleAnchorNodeChg::~SwHandleAnchorNodeChg()
3216cdf0e10cSrcweir {
3217cdf0e10cSrcweir     if ( mbAnchorNodeChanged )
3218cdf0e10cSrcweir     {
3219cdf0e10cSrcweir         mrFlyFrmFmt.MakeFrms();
3220cdf0e10cSrcweir     }
3221cdf0e10cSrcweir }
3222cdf0e10cSrcweir // <--
3223cdf0e10cSrcweir //  class SwDrawFrmFmt
3224cdf0e10cSrcweir //  Implementierung teilweise inline im hxx
3225cdf0e10cSrcweir 
3226cdf0e10cSrcweir TYPEINIT1( SwDrawFrmFmt, SwFrmFmt );
3227cdf0e10cSrcweir IMPL_FIXEDMEMPOOL_NEWDEL( SwDrawFrmFmt, 10, 10 )
3228cdf0e10cSrcweir 
~SwDrawFrmFmt()3229cdf0e10cSrcweir SwDrawFrmFmt::~SwDrawFrmFmt()
3230cdf0e10cSrcweir {
3231cdf0e10cSrcweir     SwContact *pContact = FindContactObj();
3232cdf0e10cSrcweir     delete pContact;
3233cdf0e10cSrcweir }
3234cdf0e10cSrcweir 
MakeFrms()3235cdf0e10cSrcweir void SwDrawFrmFmt::MakeFrms()
3236cdf0e10cSrcweir {
3237cdf0e10cSrcweir     SwDrawContact *pContact = (SwDrawContact*)FindContactObj();
3238cdf0e10cSrcweir     if ( pContact )
3239cdf0e10cSrcweir          pContact->ConnectToLayout();
3240cdf0e10cSrcweir }
3241cdf0e10cSrcweir 
DelFrms()3242cdf0e10cSrcweir void SwDrawFrmFmt::DelFrms()
3243cdf0e10cSrcweir {
3244cdf0e10cSrcweir     SwDrawContact *pContact = (SwDrawContact *)FindContactObj();
3245cdf0e10cSrcweir     if ( pContact ) //fuer den Reader und andere Unabwaegbarkeiten.
3246cdf0e10cSrcweir         pContact->DisconnectFromLayout();
3247cdf0e10cSrcweir }
3248cdf0e10cSrcweir 
3249cdf0e10cSrcweir // --> OD 2004-07-27 #i31698#
GetLayoutDir() const3250cdf0e10cSrcweir SwFrmFmt::tLayoutDir SwDrawFrmFmt::GetLayoutDir() const
3251cdf0e10cSrcweir {
3252cdf0e10cSrcweir     return meLayoutDir;
3253cdf0e10cSrcweir }
3254cdf0e10cSrcweir 
SetLayoutDir(const SwFrmFmt::tLayoutDir _eLayoutDir)3255cdf0e10cSrcweir void SwDrawFrmFmt::SetLayoutDir( const SwFrmFmt::tLayoutDir _eLayoutDir )
3256cdf0e10cSrcweir {
3257cdf0e10cSrcweir     meLayoutDir = _eLayoutDir;
3258cdf0e10cSrcweir }
3259cdf0e10cSrcweir // <--
3260cdf0e10cSrcweir 
3261cdf0e10cSrcweir // --> OD 2004-08-06 #i28749#
GetPositionLayoutDir() const3262cdf0e10cSrcweir sal_Int16 SwDrawFrmFmt::GetPositionLayoutDir() const
3263cdf0e10cSrcweir {
3264cdf0e10cSrcweir     return mnPositionLayoutDir;
3265cdf0e10cSrcweir }
SetPositionLayoutDir(const sal_Int16 _nPositionLayoutDir)3266cdf0e10cSrcweir void SwDrawFrmFmt::SetPositionLayoutDir( const sal_Int16 _nPositionLayoutDir )
3267cdf0e10cSrcweir {
3268cdf0e10cSrcweir     switch ( _nPositionLayoutDir )
3269cdf0e10cSrcweir     {
3270cdf0e10cSrcweir         case text::PositionLayoutDir::PositionInHoriL2R:
3271cdf0e10cSrcweir         case text::PositionLayoutDir::PositionInLayoutDirOfAnchor:
3272cdf0e10cSrcweir         {
3273cdf0e10cSrcweir             mnPositionLayoutDir = _nPositionLayoutDir;
3274cdf0e10cSrcweir         }
3275cdf0e10cSrcweir         break;
3276cdf0e10cSrcweir         default:
3277cdf0e10cSrcweir         {
3278cdf0e10cSrcweir             ASSERT( false,
3279cdf0e10cSrcweir                     "<SwDrawFrmFmt::SetPositionLayoutDir(..)> - invalid attribute value." );
3280cdf0e10cSrcweir         }
3281cdf0e10cSrcweir     }
3282cdf0e10cSrcweir }
3283cdf0e10cSrcweir // <--
3284cdf0e10cSrcweir 
GetDescription() const3285cdf0e10cSrcweir String SwDrawFrmFmt::GetDescription() const
3286cdf0e10cSrcweir {
3287cdf0e10cSrcweir     String aResult;
3288cdf0e10cSrcweir     const SdrObject * pSdrObj = FindSdrObject();
3289cdf0e10cSrcweir 
3290cdf0e10cSrcweir     if (pSdrObj)
3291cdf0e10cSrcweir     {
3292cdf0e10cSrcweir         if (pSdrObj != pSdrObjCached)
3293cdf0e10cSrcweir         {
3294cdf0e10cSrcweir             SdrObject * pSdrObjCopy = pSdrObj->Clone();
3295cdf0e10cSrcweir             SdrUndoNewObj * pSdrUndo = new SdrUndoNewObj(*pSdrObjCopy);
3296cdf0e10cSrcweir             sSdrObjCachedComment = pSdrUndo->GetComment();
3297cdf0e10cSrcweir 
3298cdf0e10cSrcweir             delete pSdrUndo;
3299cdf0e10cSrcweir 
3300cdf0e10cSrcweir             pSdrObjCached = pSdrObj;
3301cdf0e10cSrcweir         }
3302cdf0e10cSrcweir 
3303cdf0e10cSrcweir         aResult = sSdrObjCachedComment;
3304cdf0e10cSrcweir     }
3305cdf0e10cSrcweir     else
3306cdf0e10cSrcweir         aResult = SW_RES(STR_GRAPHIC);
3307cdf0e10cSrcweir 
3308cdf0e10cSrcweir     return aResult;
3309cdf0e10cSrcweir }
3310cdf0e10cSrcweir 
GetIMapObject(const Point & rPoint,const SwFlyFrm * pFly) const3311cdf0e10cSrcweir IMapObject* SwFrmFmt::GetIMapObject( const Point& rPoint,
3312cdf0e10cSrcweir                                         const SwFlyFrm *pFly ) const
3313cdf0e10cSrcweir {
3314cdf0e10cSrcweir     const SwFmtURL &rURL = GetURL();
3315cdf0e10cSrcweir     if( !rURL.GetMap() )
3316cdf0e10cSrcweir         return 0;
3317cdf0e10cSrcweir 
3318cdf0e10cSrcweir     if( !pFly )
3319cdf0e10cSrcweir     {
3320cdf0e10cSrcweir         pFly = SwIterator<SwFlyFrm,SwFmt>::FirstElement( *this );
3321cdf0e10cSrcweir         if( !pFly )
3322cdf0e10cSrcweir             return 0;
3323cdf0e10cSrcweir     }
3324cdf0e10cSrcweir 
3325cdf0e10cSrcweir     //Orignialgroesse fuer OLE und Grafik ist die TwipSize,
3326cdf0e10cSrcweir     //ansonsten die Groesse vom FrmFmt des Fly.
3327cdf0e10cSrcweir     const SwFrm *pRef;
3328cdf0e10cSrcweir     SwNoTxtNode *pNd = 0;
3329cdf0e10cSrcweir     Size aOrigSz;
3330cdf0e10cSrcweir     if( pFly->Lower() && pFly->Lower()->IsNoTxtFrm() )
3331cdf0e10cSrcweir     {
3332cdf0e10cSrcweir         pRef = pFly->Lower();
3333cdf0e10cSrcweir         pNd = ((SwCntntFrm*)pRef)->GetNode()->GetNoTxtNode();
3334cdf0e10cSrcweir         aOrigSz = pNd->GetTwipSize();
3335cdf0e10cSrcweir     }
3336cdf0e10cSrcweir     else
3337cdf0e10cSrcweir     {
3338cdf0e10cSrcweir         pRef = pFly;
3339cdf0e10cSrcweir         aOrigSz = pFly->GetFmt()->GetFrmSize().GetSize();
3340cdf0e10cSrcweir     }
3341cdf0e10cSrcweir 
3342cdf0e10cSrcweir     if( aOrigSz.Width() != 0 && aOrigSz.Height() != 0 )
3343cdf0e10cSrcweir     {
3344cdf0e10cSrcweir         Point aPos( rPoint );
3345cdf0e10cSrcweir         Size aActSz ( pRef == pFly ? pFly->Frm().SSize() : pRef->Prt().SSize() );
3346cdf0e10cSrcweir         const MapMode aSrc ( MAP_TWIP );
3347cdf0e10cSrcweir         const MapMode aDest( MAP_100TH_MM );
3348cdf0e10cSrcweir         aOrigSz = OutputDevice::LogicToLogic( aOrigSz, aSrc, aDest );
3349cdf0e10cSrcweir         aActSz  = OutputDevice::LogicToLogic( aActSz,  aSrc, aDest );
3350cdf0e10cSrcweir         aPos -= pRef->Frm().Pos();
3351cdf0e10cSrcweir         aPos -= pRef->Prt().Pos();
3352cdf0e10cSrcweir         aPos    = OutputDevice::LogicToLogic( aPos, aSrc, aDest );
3353cdf0e10cSrcweir         sal_uInt32 nFlags = 0;
3354cdf0e10cSrcweir         if ( pFly != pRef && pNd->IsGrfNode() )
3355cdf0e10cSrcweir         {
3356cdf0e10cSrcweir             const sal_uInt16 nMirror = pNd->GetSwAttrSet().
3357cdf0e10cSrcweir                                         GetMirrorGrf().GetValue();
3358cdf0e10cSrcweir             if ( RES_MIRROR_GRAPH_BOTH == nMirror )
3359cdf0e10cSrcweir                 nFlags = IMAP_MIRROR_HORZ | IMAP_MIRROR_VERT;
3360cdf0e10cSrcweir             else if ( RES_MIRROR_GRAPH_VERT == nMirror )
3361cdf0e10cSrcweir                 nFlags = IMAP_MIRROR_VERT;
3362cdf0e10cSrcweir             else if ( RES_MIRROR_GRAPH_HOR == nMirror )
3363cdf0e10cSrcweir                 nFlags = IMAP_MIRROR_HORZ;
3364cdf0e10cSrcweir 
3365cdf0e10cSrcweir         }
3366cdf0e10cSrcweir         return ((ImageMap*)rURL.GetMap())->GetHitIMapObject( aOrigSz,
3367cdf0e10cSrcweir                                                 aActSz, aPos, nFlags );
3368cdf0e10cSrcweir     }
3369cdf0e10cSrcweir 
3370cdf0e10cSrcweir     return 0;
3371cdf0e10cSrcweir }
3372cdf0e10cSrcweir 
HasCaption() const3373ca62e2c2SSteve Yin sal_Bool SwFrmFmt::HasCaption() const
3374ca62e2c2SSteve Yin {
3375ca62e2c2SSteve Yin     if(pCaptionFmt != NULL && pCaptionFmt->GetDepends())
3376ca62e2c2SSteve Yin         return sal_True;
3377ca62e2c2SSteve Yin     return sal_False;
3378ca62e2c2SSteve Yin }
3379ca62e2c2SSteve Yin 
SetCaptionFmt(SwFrmFmt * pFmt)3380ca62e2c2SSteve Yin void SwFrmFmt::SetCaptionFmt(SwFrmFmt * pFmt)
3381ca62e2c2SSteve Yin {
3382ca62e2c2SSteve Yin     pCaptionFmt = pFmt;
3383ca62e2c2SSteve Yin }
3384ca62e2c2SSteve Yin 
GetCaptionFmt() const3385ca62e2c2SSteve Yin SwFrmFmt* SwFrmFmt::GetCaptionFmt() const
3386ca62e2c2SSteve Yin {
3387ca62e2c2SSteve Yin     return pCaptionFmt;
3388ca62e2c2SSteve Yin }
338964b14621SArmin Le Grand 
339064b14621SArmin Le Grand //UUUU
getSdrAllFillAttributesHelper() const339156b35d86SArmin Le Grand drawinglayer::attribute::SdrAllFillAttributesHelperPtr SwFrmFmt::getSdrAllFillAttributesHelper() const
339264b14621SArmin Le Grand {
339328160478SArmin Le Grand     if(supportsFullDrawingLayerFillAttributeSet())
33947624f10dSArmin Le Grand     {
33957624f10dSArmin Le Grand         // create FillAttributes on demand
339664b14621SArmin Le Grand         if(!maFillAttributes.get())
339764b14621SArmin Le Grand         {
339856b35d86SArmin Le Grand             const_cast< SwFrmFmt* >(this)->maFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(GetAttrSet()));
339964b14621SArmin Le Grand         }
34007624f10dSArmin Le Grand     }
34017624f10dSArmin Le Grand     else
34027624f10dSArmin Le Grand     {
34037624f10dSArmin Le Grand         // FALLBACKBREAKHERE assert wrong usage
340456b35d86SArmin Le Grand         OSL_ENSURE(false, "getSdrAllFillAttributesHelper() call only valid for RES_FLYFRMFMT and RES_FRMFMT (!)");
34057624f10dSArmin Le Grand     }
340664b14621SArmin Le Grand 
340764b14621SArmin Le Grand     return maFillAttributes;
340864b14621SArmin Le Grand }
340964b14621SArmin Le Grand 
341064b14621SArmin Le Grand // eof
3411