LibreOffice Module sw (master)  1
tblafmt.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <comphelper/fileformat.h>
21 #include <tools/stream.hxx>
22 #include <sfx2/docfile.hxx>
23 #include <svl/zforlist.hxx>
24 #include <svl/zformat.hxx>
25 #include <unotools/configmgr.hxx>
26 #include <unotools/pathoptions.hxx>
27 #include <swtable.hxx>
28 #include <swtblfmt.hxx>
29 #include <com/sun/star/text/VertOrientation.hpp>
30 #include <swtypes.hxx>
31 #include <doc.hxx>
32 #include <poolfmt.hxx>
33 #include <tblafmt.hxx>
34 #include <cellatr.hxx>
35 #include <SwStyleNameMapper.hxx>
36 #include <hintids.hxx>
37 #include <fmtornt.hxx>
38 #include <editsh.hxx>
39 #include <fmtlsplt.hxx>
40 #include <fmtrowsplt.hxx>
41 #include <sal/log.hxx>
42 #include <osl/diagnose.h>
43 #include <osl/thread.h>
44 
45 #include <editeng/adjustitem.hxx>
46 #include <editeng/boxitem.hxx>
47 #include <editeng/brushitem.hxx>
48 #include <editeng/colritem.hxx>
49 #include <editeng/contouritem.hxx>
51 #include <editeng/fontitem.hxx>
52 #include <editeng/fhgtitem.hxx>
53 #include <editeng/justifyitem.hxx>
54 #include <editeng/legacyitem.hxx>
55 #include <editeng/lineitem.hxx>
56 #include <editeng/postitem.hxx>
57 #include <editeng/shdditem.hxx>
58 #include <editeng/udlnitem.hxx>
59 #include <editeng/wghtitem.hxx>
60 #include <svx/algitem.hxx>
61 #include <svx/rotmodit.hxx>
62 #include <legacyitem.hxx>
63 
64 #include <memory>
65 #include <vector>
66 
67 /*
68  * XXX: BIG RED NOTICE! Changes MUST be binary file format compatible and MUST
69  * be synchronized with Calc's ScAutoFormat sc/source/core/tool/autoform.cxx
70  */
71 
72 using ::editeng::SvxBorderLine;
73 
74 // until SO5PF
75 const sal_uInt16 AUTOFORMAT_ID_X = 9501;
76 const sal_uInt16 AUTOFORMAT_ID_358 = 9601;
77 const sal_uInt16 AUTOFORMAT_DATA_ID_X = 9502;
78 
79 // from SO5
81 const sal_uInt16 AUTOFORMAT_ID_504 = 9801;
82 const sal_uInt16 AUTOFORMAT_DATA_ID_504 = 9802;
83 
84 const sal_uInt16 AUTOFORMAT_DATA_ID_552 = 9902;
85 
86 // --- from 680/dr25 on: store strings as UTF-8
87 const sal_uInt16 AUTOFORMAT_ID_680DR25 = 10021;
88 
89 // --- Bug fix to fdo#31005: Table Autoformats does not save/apply all properties (Writer and Calc)
90 const sal_uInt16 AUTOFORMAT_ID_31005 = 10041;
91 const sal_uInt16 AUTOFORMAT_DATA_ID_31005 = 10042;
92 
93 // current version
97 
99 
100 #define AUTOTABLE_FORMAT_NAME "autotbl.fmt"
101 
102 namespace
103 {
105  sal_uInt64 BeginSwBlock(SvStream& rStream)
106  {
107  // We need to write down the offset of the end of the writer-specific data, so that
108  // calc can skip it. We'll only have that value after writing the data, so we
109  // write a placeholder value first, write the data, then jump back and write the
110  // real offset.
111 
112  // Note that we explicitly use sal_uInt64 instead of sal_Size (which can be 32
113  // or 64 depending on platform) to ensure 64-bit portability on this front. I don't
114  // actually know if autotbl.fmt as a whole is portable, since that requires all serialization
115  // logic to be written with portability in mind.
116  sal_uInt64 whereToWriteEndOfSwBlock = rStream.Tell();
117 
118  rStream.WriteUInt64( 0 ); // endOfSwBlock
119 
120  return whereToWriteEndOfSwBlock;
121  }
122 
125  void EndSwBlock(SvStream& rStream, sal_uInt64 whereToWriteEndOfSwBlock)
126  {
127  sal_uInt64 endOfSwBlock = rStream.Tell();
128  rStream.Seek(whereToWriteEndOfSwBlock);
129  rStream.WriteUInt64( endOfSwBlock );
130  rStream.Seek(endOfSwBlock);
131  }
132 
139  class WriterSpecificAutoFormatBlock
140  {
141  public:
142  explicit WriterSpecificAutoFormatBlock(SvStream &rStream) : _rStream(rStream), _whereToWriteEndOfBlock(BeginSwBlock(rStream))
143  {
144  }
145 
146  ~WriterSpecificAutoFormatBlock()
147  {
148  EndSwBlock(_rStream, _whereToWriteEndOfBlock);
149  }
150 
151  private:
152  WriterSpecificAutoFormatBlock(WriterSpecificAutoFormatBlock const&) = delete;
153  WriterSpecificAutoFormatBlock& operator=(WriterSpecificAutoFormatBlock const&) = delete;
154 
155  SvStream &_rStream;
156  sal_uInt64 _whereToWriteEndOfBlock;
157  };
158 
160  sal_Int64 WriterSpecificBlockExists(SvStream &stream)
161  {
162  sal_uInt64 endOfSwBlock = 0;
163  stream.ReadUInt64( endOfSwBlock );
164 
165  // end-of-block pointing to itself indicates a zero-size block.
166  return endOfSwBlock - stream.Tell();
167  }
168 }
169 
170 // Struct with version numbers of the Items
171 
173 {
174 public:
177 
178  SwAfVersions();
179  void Load( SvStream& rStream, sal_uInt16 nVer );
180  static void Write(SvStream& rStream, sal_uInt16 fileVersion);
181 };
182 
185  m_nTextOrientationVersion(0),
186  m_nVerticalAlignmentVersion(0)
187 {
188 }
189 
190 void SwAfVersions::Load( SvStream& rStream, sal_uInt16 nVer )
191 {
192  LoadBlockA(rStream, nVer);
193  if (nVer >= AUTOFORMAT_ID_31005 && WriterSpecificBlockExists(rStream))
194  {
197  }
198  LoadBlockB(rStream, nVer);
199 }
200 
201 void SwAfVersions::Write(SvStream& rStream, sal_uInt16 fileVersion)
202 {
203  AutoFormatVersions::WriteBlockA(rStream, fileVersion);
204 
205  if (fileVersion >= SOFFICE_FILEFORMAT_50)
206  {
207  WriterSpecificAutoFormatBlock block(rStream);
208 
210  rStream.WriteUInt16(legacy::SwFormatVert::GetVersion(fileVersion));
211  }
212 
213  AutoFormatVersions::WriteBlockB(rStream, fileVersion);
214 }
215 
216 
217 
219 : AutoFormatBase(),
220  m_aTextOrientation(std::make_unique<SvxFrameDirectionItem>(SvxFrameDirection::Environment, RES_FRAMEDIR)),
221  m_aVerticalAlignment(std::make_unique<SwFormatVertOrient>(0, css::text::VertOrientation::NONE, css::text::RelOrientation::FRAME)),
222  m_sNumFormatString(),
223  m_eSysLanguage(::GetAppLanguage()),
224  m_eNumFormatLanguage(::GetAppLanguage()),
225  m_wXObject()
226 {
227  // need to set default instances for base class AutoFormatBase here
228  // due to resource defines (e.g. RES_CHRATR_FONT) which are not available
229  // in svx and different in the different usages of derivations
230  m_aFont = std::make_unique<SvxFontItem>(*GetDfltAttr( RES_CHRATR_FONT ) );
231  m_aHeight = std::make_unique<SvxFontHeightItem>(240, 100, RES_CHRATR_FONTSIZE );
232  m_aWeight = std::make_unique<SvxWeightItem>(WEIGHT_NORMAL, RES_CHRATR_WEIGHT );
233  m_aPosture = std::make_unique<SvxPostureItem>(ITALIC_NONE, RES_CHRATR_POSTURE );
234  m_aCJKFont = std::make_unique<SvxFontItem>(*GetDfltAttr( RES_CHRATR_CJK_FONT ) );
235  m_aCJKHeight = std::make_unique<SvxFontHeightItem>(240, 100, RES_CHRATR_CJK_FONTSIZE );
236  m_aCJKWeight = std::make_unique<SvxWeightItem>(WEIGHT_NORMAL, RES_CHRATR_CJK_WEIGHT );
237  m_aCJKPosture = std::make_unique<SvxPostureItem>(ITALIC_NONE, RES_CHRATR_CJK_POSTURE );
238  m_aCTLFont = std::make_unique<SvxFontItem>(*GetDfltAttr( RES_CHRATR_CTL_FONT ) );
239  m_aCTLHeight = std::make_unique<SvxFontHeightItem>(240, 100, RES_CHRATR_CTL_FONTSIZE );
240  m_aCTLWeight = std::make_unique<SvxWeightItem>(WEIGHT_NORMAL, RES_CHRATR_CTL_WEIGHT );
241  m_aCTLPosture = std::make_unique<SvxPostureItem>(ITALIC_NONE, RES_CHRATR_CTL_POSTURE );
242  m_aUnderline = std::make_unique<SvxUnderlineItem>(LINESTYLE_NONE, RES_CHRATR_UNDERLINE );
243  m_aOverline = std::make_unique<SvxOverlineItem>(LINESTYLE_NONE, RES_CHRATR_OVERLINE );
244  m_aCrossedOut = std::make_unique<SvxCrossedOutItem>(STRIKEOUT_NONE, RES_CHRATR_CROSSEDOUT );
245  m_aContour = std::make_unique<SvxContourItem>(false, RES_CHRATR_CONTOUR );
246  m_aShadowed = std::make_unique<SvxShadowedItem>(false, RES_CHRATR_SHADOWED );
247  m_aColor = std::make_unique<SvxColorItem>(RES_CHRATR_COLOR );
248  m_aBox = std::make_unique<SvxBoxItem>(RES_BOX );
249  m_aTLBR = std::make_unique<SvxLineItem>(0 );
250  m_aBLTR = std::make_unique<SvxLineItem>(0 );
251  m_aBackground = std::make_unique<SvxBrushItem>(RES_BACKGROUND );
252  m_aAdjust = std::make_unique<SvxAdjustItem>(SvxAdjust::Left, RES_PARATR_ADJUST );
253  m_aHorJustify = std::make_unique<SvxHorJustifyItem>(SvxCellHorJustify::Standard, 0);
254  m_aVerJustify = std::make_unique<SvxVerJustifyItem>(SvxCellVerJustify::Standard, 0);
255  m_aStacked = std::make_unique<SfxBoolItem>(0 );
256  m_aMargin = std::make_unique<SvxMarginItem>(0 );
257  m_aLinebreak = std::make_unique<SfxBoolItem>(0 );
258  m_aRotateAngle = std::make_unique<SfxInt32Item>(0 );
259  m_aRotateMode = std::make_unique<SvxRotateModeItem>(SVX_ROTATE_MODE_STANDARD, 0 );
260 
261 // FIXME - add attribute IDs for the diagonal line items
262 // aTLBR( RES_... ),
263 // aBLTR( RES_... ),
264  m_aBox->SetAllDistances(55);
265 }
266 
268 : AutoFormatBase(rNew),
269  m_aTextOrientation(rNew.m_aTextOrientation->Clone()),
270  m_aVerticalAlignment(rNew.m_aVerticalAlignment->Clone()),
271  m_sNumFormatString( rNew.m_sNumFormatString ),
272  m_eSysLanguage( rNew.m_eSysLanguage ),
273  m_eNumFormatLanguage( rNew.m_eNumFormatLanguage ),
274  m_wXObject()
275 {
276 }
277 
279 {
280 }
281 
283 {
284  // check self-assignment
285  if(this == &rRef)
286  {
287  return *this;
288  }
289 
290  // call baseclass implementation
292 
293  // copy local members - this will use ::Clone() on all involved Items
299 
300  // m_wXObject used to not be copied before 1e2682235cded9a7cd90e55f0bfc60a1285e9a46
301  // "WIP: Further preparations for deeper Item changes" by this operator, so do not do it now, too
302  // rRef.SetXObject(GetXObject());
303 
304  return *this;
305 }
306 
308 {
309  return GetBackground().GetColor() == rRight.GetBackground().GetColor();
310 }
311 
312 bool SwBoxAutoFormat::Load( SvStream& rStream, const SwAfVersions& rVersions, sal_uInt16 nVer )
313 {
314  LoadBlockA( rStream, rVersions, nVer );
315 
316  if (nVer >= AUTOFORMAT_DATA_ID_31005)
317  {
318  sal_Int64 const nSize(WriterSpecificBlockExists(rStream));
319  if (0 < nSize && nSize < std::numeric_limits<sal_uInt16>::max())
320  {
322  // HORRIBLE HACK to read both 32-bit and 64-bit "long": abuse nSize
323  legacy::SwFormatVert::Create(*m_aVerticalAlignment, rStream, /*rVersions.m_nVerticalAlignmentVersion*/ nSize);
324  }
325  }
326 
327  LoadBlockB( rStream, rVersions, nVer );
328 
329  if( 0 == rVersions.nNumFormatVersion )
330  {
331  sal_uInt16 eSys, eLge;
332  // --- from 680/dr25 on: store strings as UTF-8
333  rtl_TextEncoding eCharSet = (nVer >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
334  m_sNumFormatString = rStream.ReadUniOrByteString( eCharSet );
335  rStream.ReadUInt16( eSys ).ReadUInt16( eLge );
338  if ( m_eSysLanguage == LANGUAGE_SYSTEM ) // from old versions (Calc)
340  }
341 
342  return ERRCODE_NONE == rStream.GetError();
343 }
344 
345 bool SwBoxAutoFormat::Save( SvStream& rStream, sal_uInt16 fileVersion ) const
346 {
347  SaveBlockA( rStream, fileVersion );
348 
349  if (fileVersion >= SOFFICE_FILEFORMAT_50)
350  {
351  WriterSpecificAutoFormatBlock block(rStream);
352 
355  }
356 
357  SaveBlockB( rStream, fileVersion );
358 
359  // --- from 680/dr25 on: store strings as UTF-8
361  RTL_TEXTENCODING_UTF8);
362  rStream.WriteUInt16( static_cast<sal_uInt16>(m_eSysLanguage) ).WriteUInt16( static_cast<sal_uInt16>(m_eNumFormatLanguage) );
363 
364  return ERRCODE_NONE == rStream.GetError();
365 }
366 
367 SwTableAutoFormat::SwTableAutoFormat( const OUString& rName )
368  : m_aName( rName )
369  , m_nStrResId( USHRT_MAX )
370  , m_aBreak(std::make_shared<SvxFormatBreakItem>(SvxBreak::NONE, RES_BREAK))
371  , m_aKeepWithNextPara(std::make_shared<SvxFormatKeepItem>(false, RES_KEEP))
372  , m_aRepeatHeading( 0 )
373  , m_bLayoutSplit( true )
374  , m_bRowSplit( true )
375  , m_bCollapsingBorders(true)
376  , m_aShadow(std::make_shared<SvxShadowItem>(RES_SHADOW))
377  , m_bHidden( false )
378  , m_bUserDefined( true )
379 {
380  m_bInclFont = true;
381  m_bInclJustify = true;
382  m_bInclFrame = true;
383  m_bInclBackground = true;
384  m_bInclValueFormat = true;
385  m_bInclWidthHeight = true;
386 }
387 
389  : m_aBreak()
390  , m_aKeepWithNextPara()
391  , m_aShadow(std::make_shared<SvxShadowItem>(RES_SHADOW))
392 {
393  for(SwBoxAutoFormat* & rp : m_aBoxAutoFormat)
394  rp = nullptr;
395  *this = rNew;
396 }
397 
399 {
400  if (&rNew == this)
401  return *this;
402 
403  for( sal_uInt8 n = 0; n < 16; ++n )
404  {
405  if( m_aBoxAutoFormat[ n ] )
406  delete m_aBoxAutoFormat[ n ];
407 
408  SwBoxAutoFormat* pFormat = rNew.m_aBoxAutoFormat[ n ];
409  if( pFormat ) // if is set -> copy
410  m_aBoxAutoFormat[ n ] = new SwBoxAutoFormat( *pFormat );
411  else // else default
412  m_aBoxAutoFormat[ n ] = nullptr;
413  }
414 
415  m_aName = rNew.m_aName;
416  m_nStrResId = rNew.m_nStrResId;
417  m_bInclFont = rNew.m_bInclFont;
419  m_bInclFrame = rNew.m_bInclFrame;
423 
424  m_aBreak.reset(rNew.m_aBreak->Clone());
425  m_aPageDesc = rNew.m_aPageDesc;
426  m_aKeepWithNextPara.reset(rNew.m_aKeepWithNextPara->Clone());
429  m_bRowSplit = rNew.m_bRowSplit;
431  m_aShadow.reset(rNew.m_aShadow->Clone());
432  m_bHidden = rNew.m_bHidden;
434 
435  return *this;
436 }
437 
439 {
440  SwBoxAutoFormat** ppFormat = m_aBoxAutoFormat;
441  for( sal_uInt8 n = 0; n < 16; ++n, ++ppFormat )
442  if( *ppFormat )
443  delete *ppFormat;
444 }
445 
447 {
448  OSL_ENSURE( nPos < 16, "wrong area" );
449 
450  SwBoxAutoFormat* pFormat = m_aBoxAutoFormat[ nPos ];
451  if( pFormat ) // if is set -> copy
452  *m_aBoxAutoFormat[ nPos ] = rNew;
453  else // else set anew
454  m_aBoxAutoFormat[ nPos ] = new SwBoxAutoFormat( rNew );
455 }
456 
458 {
459  OSL_ENSURE( nPos < 16, "wrong area" );
460 
461  SwBoxAutoFormat* pFormat = m_aBoxAutoFormat[ nPos ];
462  if( pFormat ) // if is set -> copy
463  return *pFormat;
464  else // else return the default
465  {
466  // If it doesn't exist yet:
467  if( !pDfltBoxAutoFormat )
469  return *pDfltBoxAutoFormat;
470  }
471 }
472 
474 {
475  SAL_WARN_IF(!(nPos < 16), "sw.core", "GetBoxFormat wrong area");
476 
477  SwBoxAutoFormat** pFormat = &m_aBoxAutoFormat[ nPos ];
478  if( !*pFormat )
479  {
480  // If default doesn't exist yet:
481  if( !pDfltBoxAutoFormat )
483  *pFormat = new SwBoxAutoFormat(*pDfltBoxAutoFormat);
484  }
485  return **pFormat;
486 }
487 
489 {
490  if(!pDfltBoxAutoFormat)
492 
493  return *pDfltBoxAutoFormat;
494 }
495 
497  const SfxItemSet& rSet,
499  SvNumberFormatter const * pNFormatr)
500 {
501  OSL_ENSURE( nPos < 16, "wrong area" );
502 
503  SwBoxAutoFormat* pFormat = m_aBoxAutoFormat[ nPos ];
504  if( !pFormat ) // if is set -> copy
505  {
506  pFormat = new SwBoxAutoFormat;
507  m_aBoxAutoFormat[ nPos ] = pFormat;
508  }
509 
511  {
512  pFormat->SetFont( rSet.Get( RES_CHRATR_FONT ) );
513  pFormat->SetHeight( rSet.Get( RES_CHRATR_FONTSIZE ) );
514  pFormat->SetWeight( rSet.Get( RES_CHRATR_WEIGHT ) );
515  pFormat->SetPosture( rSet.Get( RES_CHRATR_POSTURE ) );
516  pFormat->SetCJKFont( rSet.Get( RES_CHRATR_CJK_FONT ) );
517  pFormat->SetCJKHeight( rSet.Get( RES_CHRATR_CJK_FONTSIZE ) );
518  pFormat->SetCJKWeight( rSet.Get( RES_CHRATR_CJK_WEIGHT ) );
519  pFormat->SetCJKPosture( rSet.Get( RES_CHRATR_CJK_POSTURE ) );
520  pFormat->SetCTLFont( rSet.Get( RES_CHRATR_CTL_FONT ) );
521  pFormat->SetCTLHeight( rSet.Get( RES_CHRATR_CTL_FONTSIZE ) );
522  pFormat->SetCTLWeight( rSet.Get( RES_CHRATR_CTL_WEIGHT ) );
523  pFormat->SetCTLPosture( rSet.Get( RES_CHRATR_CTL_POSTURE ) );
524  pFormat->SetUnderline( rSet.Get( RES_CHRATR_UNDERLINE ) );
525  pFormat->SetOverline( rSet.Get( RES_CHRATR_OVERLINE ) );
526  pFormat->SetCrossedOut( rSet.Get( RES_CHRATR_CROSSEDOUT ) );
527  pFormat->SetContour( rSet.Get( RES_CHRATR_CONTOUR ) );
528  pFormat->SetShadowed( rSet.Get( RES_CHRATR_SHADOWED ) );
529  pFormat->SetColor( rSet.Get( RES_CHRATR_COLOR ) );
530  pFormat->SetAdjust( rSet.Get( RES_PARATR_ADJUST ) );
531  }
532  if( SwTableAutoFormatUpdateFlags::Box & eFlags )
533  {
534  pFormat->SetBox( rSet.Get( RES_BOX ) );
535 // FIXME - add attribute IDs for the diagonal line items
536 // pFormat->SetTLBR( (SvxLineItem&)rSet.Get( RES_... ) );
537 // pFormat->SetBLTR( (SvxLineItem&)rSet.Get( RES_... ) );
538  pFormat->SetBackground( rSet.Get( RES_BACKGROUND ) );
539  pFormat->SetTextOrientation(rSet.Get(RES_FRAMEDIR));
540  pFormat->SetVerticalAlignment(rSet.Get(RES_VERT_ORIENT));
541 
542  const SwTableBoxNumFormat* pNumFormatItem;
543  const SvNumberformat* pNumFormat = nullptr;
544  if( SfxItemState::SET == rSet.GetItemState( RES_BOXATR_FORMAT, true,
545  reinterpret_cast<const SfxPoolItem**>(&pNumFormatItem) ) && pNFormatr &&
546  nullptr != (pNumFormat = pNFormatr->GetEntry( pNumFormatItem->GetValue() )) )
547  pFormat->SetValueFormat( pNumFormat->GetFormatstring(),
548  pNumFormat->GetLanguage(),
549  ::GetAppLanguage());
550  else
551  {
552  // default
553  pFormat->SetValueFormat( OUString(), LANGUAGE_SYSTEM,
554  ::GetAppLanguage() );
555  }
556  }
557 
558  // we cannot handle the rest, that's specific to StarCalc
559 }
560 
561 void SwTableAutoFormat::UpdateToSet(const sal_uInt8 nPos, const bool bSingleRowTable, const bool bSingleColTable, SfxItemSet& rSet,
562  SwTableAutoFormatUpdateFlags eFlags, SvNumberFormatter* pNFormatr) const
563 {
564  const SwBoxAutoFormat& rChg = GetBoxFormat( nPos );
565 
567  {
568  if( IsFont() )
569  {
570  rSet.Put( rChg.GetFont() );
571  rSet.Put( rChg.GetHeight() );
572  rSet.Put( rChg.GetWeight() );
573  rSet.Put( rChg.GetPosture() );
574  // do not insert empty CJK font
575  const SvxFontItem& rCJKFont = rChg.GetCJKFont();
576  if (!rCJKFont.GetStyleName().isEmpty())
577  {
578  rSet.Put( rChg.GetCJKFont() );
579  rSet.Put( rChg.GetCJKHeight() );
580  rSet.Put( rChg.GetCJKWeight() );
581  rSet.Put( rChg.GetCJKPosture() );
582  }
583  else
584  {
585  rSet.Put( rChg.GetHeight().CloneSetWhich(RES_CHRATR_CJK_FONTSIZE) );
586  rSet.Put( rChg.GetWeight().CloneSetWhich(RES_CHRATR_CJK_WEIGHT) );
587  rSet.Put( rChg.GetPosture().CloneSetWhich(RES_CHRATR_CJK_POSTURE) );
588  }
589  // do not insert empty CTL font
590  const SvxFontItem& rCTLFont = rChg.GetCTLFont();
591  if (!rCTLFont.GetStyleName().isEmpty())
592  {
593  rSet.Put( rChg.GetCTLFont() );
594  rSet.Put( rChg.GetCTLHeight() );
595  rSet.Put( rChg.GetCTLWeight() );
596  rSet.Put( rChg.GetCTLPosture() );
597  }
598  else
599  {
600  rSet.Put( rChg.GetHeight().CloneSetWhich(RES_CHRATR_CTL_FONTSIZE) );
601  rSet.Put( rChg.GetWeight().CloneSetWhich(RES_CHRATR_CTL_WEIGHT) );
602  rSet.Put( rChg.GetPosture().CloneSetWhich(RES_CHRATR_CTL_POSTURE) );
603  }
604  rSet.Put( rChg.GetUnderline() );
605  rSet.Put( rChg.GetOverline() );
606  rSet.Put( rChg.GetCrossedOut() );
607  rSet.Put( rChg.GetContour() );
608  rSet.Put( rChg.GetShadowed() );
609  rSet.Put( rChg.GetColor() );
610  }
611  if( IsJustify() )
612  rSet.Put( rChg.GetAdjust() );
613  }
614 
615  if( SwTableAutoFormatUpdateFlags::Box & eFlags )
616  {
617  if( IsFrame() )
618  {
619  SvxBoxItem aAutoFormatBox = rChg.GetBox();
620 
621  // No format box is adequate to specify the borders of single column/row tables, so combine first/last.
622  if ( bSingleRowTable || bSingleColTable )
623  {
624  sal_uInt8 nSingleRowOrColumnId = 15; //LAST_ROW_END_COLUMN
625  if ( !bSingleRowTable )
626  nSingleRowOrColumnId = nPos + 3; //LAST COLUMN (3, 7, 11, 15)
627  else if ( !bSingleColTable )
628  nSingleRowOrColumnId = nPos + 12; //LAST ROW (12, 13, 14, 15)
629 
630  assert( nSingleRowOrColumnId < 16 );
631  const SvxBoxItem aLastAutoFormatBox( GetBoxFormat(nSingleRowOrColumnId).GetBox() );
632  if ( bSingleRowTable )
633  aAutoFormatBox.SetLine( aLastAutoFormatBox.GetLine(SvxBoxItemLine::BOTTOM), SvxBoxItemLine::BOTTOM );
634  if ( bSingleColTable )
635  aAutoFormatBox.SetLine( aLastAutoFormatBox.GetLine(SvxBoxItemLine::RIGHT), SvxBoxItemLine::RIGHT );
636  }
637 
638  rSet.Put( aAutoFormatBox );
639 // FIXME - uncomment the lines to put the diagonal line items
640 // rSet.Put( rChg.GetTLBR() );
641 // rSet.Put( rChg.GetBLTR() );
642  }
643  if( IsBackground() )
644  rSet.Put( rChg.GetBackground() );
645 
646  rSet.Put(rChg.GetTextOrientation());
647 
648  // Do not put a VertAlign when it has default value.
649  // It prevents the export of default value by automatic cell-styles export.
651  rSet.Put(rChg.GetVerticalAlignment());
652 
653  if( IsValueFormat() && pNFormatr )
654  {
655  OUString sFormat;
656  LanguageType eLng, eSys;
657  rChg.GetValueFormat( sFormat, eLng, eSys );
658  if( !sFormat.isEmpty() )
659  {
661  bool bNew;
662  sal_Int32 nCheckPos;
663  sal_uInt32 nKey = pNFormatr->GetIndexPuttingAndConverting( sFormat, eLng,
664  eSys, nType, bNew, nCheckPos);
665  rSet.Put( SwTableBoxNumFormat( nKey ));
666  }
667  else
669  }
670  }
671 
672  // we cannot handle the rest, that's specific to StarCalc
673 }
674 
676 {
677  SwTableFormat* pFormat = table.GetFrameFormat();
678  if (!pFormat)
679  return;
680 
681  SwDoc *pDoc = pFormat->GetDoc();
682  if (!pDoc)
683  return;
684 
685  SfxItemSet rSet(pDoc->GetAttrPool(), aTableSetRange);
686 
687  if ( m_aBreak->GetBreak() != SvxBreak::NONE )
688  rSet.Put(*m_aBreak);
689  rSet.Put(m_aPageDesc);
692  if ( m_aKeepWithNextPara->GetValue() )
693  rSet.Put(*m_aKeepWithNextPara);
694  rSet.Put(*m_aShadow);
695 
696  pFormat->SetFormatAttr(rSet);
697 
698  SwEditShell *pShell = pDoc->GetEditShell();
699  pDoc->SetRowSplit(*pShell->getShellCursor(false), SwFormatRowSplit(m_bRowSplit));
700 
702 }
703 
705 {
706  SwTableFormat* pFormat = table.GetFrameFormat();
707  if (!pFormat)
708  return;
709 
710  SwDoc *pDoc = pFormat->GetDoc();
711  if (!pDoc)
712  return;
713 
714  SwEditShell *pShell = pDoc->GetEditShell();
715  std::unique_ptr<SwFormatRowSplit> pRowSplit = SwDoc::GetRowSplit(*pShell->getShellCursor(false));
716  m_bRowSplit = pRowSplit && pRowSplit->GetValue();
717  pRowSplit.reset();
718 
719  const SfxItemSet &rSet = pFormat->GetAttrSet();
720 
721  m_aBreak.reset(rSet.Get(RES_BREAK).Clone());
722  m_aPageDesc = rSet.Get(RES_PAGEDESC);
723  const SwFormatLayoutSplit &layoutSplit = rSet.Get(RES_LAYOUT_SPLIT);
724  m_bLayoutSplit = layoutSplit.GetValue();
726 
727  m_aKeepWithNextPara.reset(rSet.Get(RES_KEEP).Clone());
729  m_aShadow.reset(rSet.Get(RES_SHADOW).Clone());
730 }
731 
733 {
734  return GetBoxFormat(3) == GetBoxFormat(2);
735 }
737 {
738  return GetBoxFormat(0) == GetBoxFormat(1);
739 }
741 {
742  return GetBoxFormat(14) == GetBoxFormat(15);
743 }
745 {
746  return GetBoxFormat(12) == GetBoxFormat(13);
747 }
748 
749 bool SwTableAutoFormat::Load( SvStream& rStream, const SwAfVersions& rVersions )
750 {
751  sal_uInt16 nVal = 0;
752  rStream.ReadUInt16( nVal );
753  bool bRet = ERRCODE_NONE == rStream.GetError();
754 
755  if( bRet && (nVal == AUTOFORMAT_DATA_ID_X ||
756  (AUTOFORMAT_DATA_ID_504 <= nVal && nVal <= AUTOFORMAT_DATA_ID)) )
757  {
758  bool b;
759  // --- from 680/dr25 on: store strings as UTF-8
760  rtl_TextEncoding eCharSet = (nVal >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
761  m_aName = rStream.ReadUniOrByteString( eCharSet );
762  if( AUTOFORMAT_DATA_ID_552 <= nVal )
763  {
764  rStream.ReadUInt16( m_nStrResId );
765  // start from 3d because default is added via constructor
767  {
769  }
770  else
772  }
773  rStream.ReadCharAsBool( b ); m_bInclFont = b;
774  rStream.ReadCharAsBool( b ); m_bInclJustify = b;
775  rStream.ReadCharAsBool( b ); m_bInclFrame = b;
776  rStream.ReadCharAsBool( b ); m_bInclBackground = b;
777  rStream.ReadCharAsBool( b ); m_bInclValueFormat = b;
778  rStream.ReadCharAsBool( b ); m_bInclWidthHeight = b;
779 
780  if (nVal >= AUTOFORMAT_DATA_ID_31005 && WriterSpecificBlockExists(rStream))
781  {
783 //unimplemented READ(m_aPageDesc, SwFormatPageDesc, AUTOFORMAT_FILE_VERSION);
785 
787 
789  }
790 
791  bRet = ERRCODE_NONE== rStream.GetError();
792 
793  for( sal_uInt8 i = 0; bRet && i < 16; ++i )
794  {
795  SwBoxAutoFormat* pFormat = new SwBoxAutoFormat;
796  bRet = pFormat->Load( rStream, rVersions, nVal );
797  if( bRet )
798  m_aBoxAutoFormat[ i ] = pFormat;
799  else
800  {
801  delete pFormat;
802  break;
803  }
804  }
805  }
806  m_bUserDefined = false;
807  return bRet;
808 }
809 
810 bool SwTableAutoFormat::Save( SvStream& rStream, sal_uInt16 fileVersion ) const
811 {
812  rStream.WriteUInt16( AUTOFORMAT_DATA_ID );
813  // --- from 680/dr25 on: store strings as UTF-8
815  RTL_TEXTENCODING_UTF8 );
816  rStream.WriteUInt16( m_nStrResId );
817  rStream.WriteBool( m_bInclFont );
818  rStream.WriteBool( m_bInclJustify );
819  rStream.WriteBool( m_bInclFrame );
820  rStream.WriteBool( m_bInclBackground );
821  rStream.WriteBool( m_bInclValueFormat );
822  rStream.WriteBool( m_bInclWidthHeight );
823 
824  {
825  WriterSpecificAutoFormatBlock block(rStream);
826 
828 //unimplemented m_aPageDesc.Store(rStream, m_aPageDesc.GetVersion(fileVersion));
832  }
833 
834  bool bRet = ERRCODE_NONE == rStream.GetError();
835 
836  for( int i = 0; bRet && i < 16; ++i )
837  {
838  SwBoxAutoFormat* pFormat = m_aBoxAutoFormat[ i ];
839  if( !pFormat ) // if not set -> write default
840  {
841  // If it doesn't exist yet:
842  if( !pDfltBoxAutoFormat )
844  pFormat = pDfltBoxAutoFormat;
845  }
846  bRet = pFormat->Save( rStream, fileVersion );
847  }
848  return bRet;
849 }
850 
852 {
853  sal_Int32 nIndex = 0;
854  for (; nIndex < 16; ++nIndex)
855  if (m_aBoxAutoFormat[nIndex] == &rBoxFormat) break;
856 
857  // box format doesn't belong to this table format
858  if (16 <= nIndex)
859  return OUString();
860 
861  const std::vector<sal_Int32> aTableTemplateMap = GetTableTemplateMap();
862  for (size_t i=0; i < aTableTemplateMap.size(); ++i)
863  {
864  if (aTableTemplateMap[i] == nIndex)
865  return "." + OUString::number(i + 1);
866  }
867 
868  // box format doesn't belong to a table template
869  return OUString();
870 }
871 
872 /*
873  * Mapping schema
874  * 0 1 2 3 4 5
875  * +-----------------------------------------------------------------------+
876  * 0 | FRSC | FR | FREC | | | FRENC |
877  * +-----------------------------------------------------------------------+
878  * 1 | FC | ER | EC | | | LC |
879  * +-----------------------------------------------------------------------+
880  * 2 | OR | OC | BODY | | | BCKG |
881  * +-----------------------------------------------------------------------+
882  * 3 | | | | | | |
883  * +-----------------------------------------------------------------------+
884  * 4 | | | | | | |
885  * +-----------------------------------------------------------------------+
886  * 5 | LRSC | LR | LREC | | | LRENC |
887  * +-----------+-----------+-----------+-----------+-----------+-----------+
888  * ODD = 1, 3, 5, ...
889  * EVEN = 2, 4, 6, ...
890  */
891 const std::vector<sal_Int32> & SwTableAutoFormat::GetTableTemplateMap()
892 {
893  static std::vector<sal_Int32> const aTableTemplateMap
894  {
895  1 , // FIRST_ROW // FR
896  13, // LAST_ROW // LR
897  4 , // FIRST_COLUMN // FC
898  7 , // LAST_COLUMN // LC
899  5 , // EVEN_ROWS // ER
900  8 , // ODD_ROWS // OR
901  6 , // EVEN_COLUMNS // EC
902  9 , // ODD_COLUMNS // OC
903  10, // BODY
904  11, // BACKGROUND // BCKG
905  0 , // FIRST_ROW_START_COLUMN // FRSC
906  3 , // FIRST_ROW_END_COLUMN // FRENC
907  12, // LAST_ROW_START_COLUMN // LRSC
908  15, // LAST_ROW_END_COLUMN // LRENC
909  2 , // FIRST_ROW_EVEN_COLUMN // FREC
910  14, // LAST_ROW_EVEN_COLUMN // LREC
911  };
912  return aTableTemplateMap;
913 }
914 
915 sal_uInt8 SwTableAutoFormat::CountPos(sal_uInt32 nCol, sal_uInt32 nCols, sal_uInt32 nRow,
916  sal_uInt32 nRows)
917 {
918  sal_uInt8 nRet = static_cast<sal_uInt8>(
919  !nRow ? 0 : ((nRow + 1 == nRows) ? 12 : (4 * (1 + ((nRow - 1) & 1)))));
920  nRet = nRet
921  + static_cast<sal_uInt8>(!nCol ? 0 : (nCol + 1 == nCols ? 3 : (1 + ((nCol - 1) & 1))));
922  return nRet;
923 }
924 
926 {
927  std::vector<std::unique_ptr<SwTableAutoFormat>> m_AutoFormats;
928 };
929 
931 {
932  return m_pImpl->m_AutoFormats.size();
933 }
934 
936 {
937  return *m_pImpl->m_AutoFormats[i];
938 }
940 {
941  return *m_pImpl->m_AutoFormats[i];
942 }
943 
945 {
946  // don't insert when we already have style of this name
947  if (FindAutoFormat(rTableStyle.GetName()))
948  return;
949 
950  InsertAutoFormat(size(), std::make_unique<SwTableAutoFormat>(rTableStyle));
951 }
952 
953 void SwTableAutoFormatTable::InsertAutoFormat(size_t const i, std::unique_ptr<SwTableAutoFormat> pFormat)
954 {
955  m_pImpl->m_AutoFormats.insert(m_pImpl->m_AutoFormats.begin() + i, std::move(pFormat));
956 }
957 
959 {
960  m_pImpl->m_AutoFormats.erase(m_pImpl->m_AutoFormats.begin() + i);
961 }
962 
963 void SwTableAutoFormatTable::EraseAutoFormat(const OUString& rName)
964 {
965  auto iter = std::find_if(m_pImpl->m_AutoFormats.begin(), m_pImpl->m_AutoFormats.end(),
966  [&rName](const std::unique_ptr<SwTableAutoFormat>& rpFormat) { return rpFormat->GetName() == rName; });
967  if (iter != m_pImpl->m_AutoFormats.end())
968  {
969  m_pImpl->m_AutoFormats.erase(iter);
970  return;
971  }
972  SAL_INFO("sw.core", "SwTableAutoFormatTable::EraseAutoFormat, SwTableAutoFormat with given name not found");
973 }
974 
975 std::unique_ptr<SwTableAutoFormat> SwTableAutoFormatTable::ReleaseAutoFormat(size_t const i)
976 {
977  auto const iter(m_pImpl->m_AutoFormats.begin() + i);
978  std::unique_ptr<SwTableAutoFormat> pRet(std::move(*iter));
979  m_pImpl->m_AutoFormats.erase(iter);
980  return pRet;
981 }
982 
983 std::unique_ptr<SwTableAutoFormat> SwTableAutoFormatTable::ReleaseAutoFormat(const OUString& rName)
984 {
985  std::unique_ptr<SwTableAutoFormat> pRet;
986  auto iter = std::find_if(m_pImpl->m_AutoFormats.begin(), m_pImpl->m_AutoFormats.end(),
987  [&rName](const std::unique_ptr<SwTableAutoFormat>& rpFormat) { return rpFormat->GetName() == rName; });
988  if (iter != m_pImpl->m_AutoFormats.end())
989  {
990  pRet = std::move(*iter);
991  m_pImpl->m_AutoFormats.erase(iter);
992  }
993  return pRet;
994 }
995 
997 {
998  for (const auto &rFormat : m_pImpl->m_AutoFormats)
999  {
1000  if (rFormat->GetName() == rName)
1001  return rFormat.get();
1002  }
1003 
1004  return nullptr;
1005 }
1006 
1008 {
1009 }
1010 
1012  : m_pImpl(new Impl)
1013 {
1014  std::unique_ptr<SwTableAutoFormat> pNew(new SwTableAutoFormat(
1016 
1017  sal_uInt8 i;
1018 
1019  Color aColor( COL_BLACK );
1020  SvxBoxItem aBox( RES_BOX );
1021 
1022  aBox.SetAllDistances(55);
1023  SvxBorderLine aLn( &aColor, DEF_LINE_WIDTH_5 );
1024  aBox.SetLine( &aLn, SvxBoxItemLine::LEFT );
1025  aBox.SetLine( &aLn, SvxBoxItemLine::BOTTOM );
1026 
1027  for( i = 0; i <= 15; ++i )
1028  {
1029  aBox.SetLine( i <= 3 ? &aLn : nullptr, SvxBoxItemLine::TOP );
1030  aBox.SetLine( (3 == ( i & 3 )) ? &aLn : nullptr, SvxBoxItemLine::RIGHT );
1031  pNew->GetBoxFormat( i ).SetBox( aBox );
1032  }
1033 
1034  pNew->SetUserDefined(false);
1035  m_pImpl->m_AutoFormats.push_back(std::move(pNew));
1036 }
1037 
1039 {
1041  return;
1042  OUString sNm(AUTOTABLE_FORMAT_NAME);
1043  SvtPathOptions aOpt;
1044  if( aOpt.SearchFile( sNm ))
1045  {
1046  SfxMedium aStream( sNm, StreamMode::STD_READ );
1047  Load( *aStream.GetInStream() );
1048  }
1049 }
1050 
1052 {
1054  return false;
1055  SvtPathOptions aPathOpt;
1056  const OUString sNm( aPathOpt.GetUserConfigPath() + "/" AUTOTABLE_FORMAT_NAME );
1057  SfxMedium aStream(sNm, StreamMode::STD_WRITE );
1058  return Save( *aStream.GetOutStream() ) && aStream.Commit();
1059 }
1060 
1062 {
1063  bool bRet = ERRCODE_NONE == rStream.GetError();
1064  if (bRet)
1065  {
1066  // Attention: We need to read a general Header here
1067  sal_uInt16 nVal = 0;
1068  rStream.ReadUInt16( nVal );
1069  bRet = ERRCODE_NONE == rStream.GetError();
1070 
1071  if( bRet )
1072  {
1073  SwAfVersions aVersions;
1074 
1075  // Default version is 5.0, unless we detect an old format ID.
1076  sal_uInt16 nFileVers = SOFFICE_FILEFORMAT_50;
1077  if(nVal < AUTOFORMAT_ID_31005)
1078  nFileVers = SOFFICE_FILEFORMAT_40;
1079 
1080  if( nVal == AUTOFORMAT_ID_358 ||
1081  (AUTOFORMAT_ID_504 <= nVal && nVal <= AUTOFORMAT_ID) )
1082  {
1083  sal_uInt8 nChrSet, nCnt;
1084  long nPos = rStream.Tell();
1085  rStream.ReadUChar( nCnt ).ReadUChar( nChrSet );
1086  if( rStream.Tell() != sal_uLong(nPos + nCnt) )
1087  {
1088  OSL_ENSURE( false, "The Header contains more or newer Data" );
1089  rStream.Seek( nPos + nCnt );
1090  }
1091  rStream.SetStreamCharSet( static_cast<rtl_TextEncoding>(nChrSet) );
1092  rStream.SetVersion( nFileVers );
1093  }
1094 
1095  if( nVal == AUTOFORMAT_ID_358 || nVal == AUTOFORMAT_ID_X ||
1096  (AUTOFORMAT_ID_504 <= nVal && nVal <= AUTOFORMAT_ID) )
1097  {
1098  aVersions.Load( rStream, nVal ); // Item versions
1099 
1100  sal_uInt16 nCount = 0;
1101  rStream.ReadUInt16( nCount );
1102 
1103  bRet = ERRCODE_NONE== rStream.GetError();
1104  if (bRet)
1105  {
1106  const size_t nMinRecordSize = sizeof(sal_uInt16);
1107  const size_t nMaxRecords = rStream.remainingSize() / nMinRecordSize;
1108  if (nCount > nMaxRecords)
1109  {
1110  SAL_WARN("sw.core", "Parsing error: " << nMaxRecords <<
1111  " max possible entries, but " << nCount << " claimed, truncating");
1112  nCount = nMaxRecords;
1113  }
1114  for (sal_uInt16 i = 0; i < nCount; ++i)
1115  {
1116  std::unique_ptr<SwTableAutoFormat> pNew(
1117  new SwTableAutoFormat( OUString() ));
1118  bRet = pNew->Load( rStream, aVersions );
1119  if( bRet )
1120  {
1121  m_pImpl->m_AutoFormats.push_back(std::move(pNew));
1122  }
1123  else
1124  {
1125  break;
1126  }
1127  }
1128  }
1129  }
1130  else
1131  {
1132  bRet = false;
1133  }
1134  }
1135  }
1136  return bRet;
1137 }
1138 
1140 {
1141  bool bRet = ERRCODE_NONE == rStream.GetError();
1142  if (bRet)
1143  {
1145 
1146  // Attention: We need to save a general Header here
1147  rStream.WriteUInt16( AUTOFORMAT_ID )
1148  .WriteUChar( 2 ) // Character count of the Header including this value
1149  .WriteUChar( GetStoreCharSet( ::osl_getThreadTextEncoding() ) );
1150 
1151  bRet = ERRCODE_NONE == rStream.GetError();
1152  if (!bRet)
1153  return false;
1154 
1155  // Write this version number for all attributes
1157 
1158  rStream.WriteUInt16( m_pImpl->m_AutoFormats.size() - 1 );
1159  bRet = ERRCODE_NONE == rStream.GetError();
1160 
1161  for (size_t i = 1; bRet && i < m_pImpl->m_AutoFormats.size(); ++i)
1162  {
1163  SwTableAutoFormat const& rFormat = *m_pImpl->m_AutoFormats[i];
1164  bRet = rFormat.Save(rStream, AUTOFORMAT_FILE_VERSION);
1165  }
1166  }
1167  rStream.Flush();
1168  return bRet;
1169 }
1170 
1172 { }
1173 
1175 {
1176 }
1177 
1179 {
1180  return m_aCellStyles.size();
1181 }
1182 
1184 {
1185  m_aCellStyles.clear();
1186 }
1187 
1189 {
1191 }
1192 
1193 void SwCellStyleTable::AddBoxFormat(const SwBoxAutoFormat& rBoxFormat, const OUString& sName)
1194 {
1195  m_aCellStyles.emplace_back(sName, std::make_unique<SwBoxAutoFormat>(rBoxFormat));
1196 }
1197 
1198 void SwCellStyleTable::RemoveBoxFormat(const OUString& sName)
1199 {
1200  auto iter = std::find_if(m_aCellStyles.begin(), m_aCellStyles.end(),
1201  [&sName](const std::pair<OUString, std::unique_ptr<SwBoxAutoFormat>>& rStyle) { return rStyle.first == sName; });
1202  if (iter != m_aCellStyles.end())
1203  {
1204  m_aCellStyles.erase(iter);
1205  return;
1206  }
1207  SAL_INFO("sw.core", "SwCellStyleTable::RemoveBoxFormat, format with given name doesn't exists");
1208 }
1209 
1210 OUString SwCellStyleTable::GetBoxFormatName(const SwBoxAutoFormat& rBoxFormat) const
1211 {
1212  for (size_t i=0; i < m_aCellStyles.size(); ++i)
1213  {
1214  if (m_aCellStyles[i].second.get() == &rBoxFormat)
1215  return m_aCellStyles[i].first;
1216  }
1217 
1218  // box format not found
1219  return OUString();
1220 }
1221 
1223 {
1224  for (size_t i=0; i < m_aCellStyles.size(); ++i)
1225  {
1226  if (m_aCellStyles[i].first == sName)
1227  return m_aCellStyles[i].second.get();
1228  }
1229 
1230  return nullptr;
1231 }
1232 
1233 void SwCellStyleTable::ChangeBoxFormatName(const OUString& sFromName, const OUString& sToName)
1234 {
1235  if (!GetBoxFormat(sToName))
1236  {
1237  SAL_INFO("sw.core", "SwCellStyleTable::ChangeBoxName, box with given name already exists");
1238  return;
1239  }
1240  for (size_t i=0; i < m_aCellStyles.size(); ++i)
1241  {
1242  if (m_aCellStyles[i].first == sFromName)
1243  {
1244  m_aCellStyles[i].first = sToName;
1245  // changed successfully
1246  return;
1247  }
1248  }
1249  SAL_INFO("sw.core", "SwCellStyleTable::ChangeBoxName, box with given name not found");
1250 }
1251 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion)
bool m_bInclWidthHeight
Definition: tblafmt.hxx:171
void Create(SvxFormatBreakItem &rItem, SvStream &rStrm, sal_uInt16 nItemVersion)
SvStream & WriteBool(bool b)
void SetNumFormatString(const OUString &rNew)
Definition: tblafmt.hxx:90
bool GetValue() const
SvxBreak
static SwBoxAutoFormat * pDfltBoxAutoFormat
Definition: tblafmt.hxx:156
SvStream & Store(const SvxFormatKeepItem &rItem, SvStream &rStrm, sal_uInt16)
void SetValueFormat(const OUString &rFormat, LanguageType eLng, LanguageType eSys)
Definition: tblafmt.hxx:87
std::unique_ptr< SvxBrushItem > m_aBackground
#define RES_CHRATR_WEIGHT
Definition: hintids.hxx:177
bool IsValueFormat() const
Definition: tblafmt.hxx:223
std::unique_ptr< SfxBoolItem > m_aStacked
SvStream & WriteUInt64(sal_uInt64 nuInt64)
sal_Int32 nIndex
sal_uInt16 GetVersion(sal_uInt16)
void SetBackground(const SvxBrushItem &rNew)
void SetRowsToRepeat(sal_uInt16 nNumOfRows)
Definition: swtable.hxx:194
void SetVerticalAlignment(const SwFormatVertOrient &rNew)
Definition: tblafmt.hxx:85
std::unique_ptr< SvxPostureItem > m_aCTLPosture
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
void SetOverline(const SvxOverlineItem &rNew)
sal_uInt32 GetIndexPuttingAndConverting(OUString &rString, LanguageType eLnge, LanguageType eSysLnge, SvNumFormatType &rType, bool &rNewInserted, sal_Int32 &rCheckPos)
bool m_bInclBackground
Definition: tblafmt.hxx:167
void Create(SvxFrameDirectionItem &rItem, SvStream &rStrm, sal_uInt16)
std::unique_ptr< SvxFontHeightItem > m_aHeight
std::shared_ptr< SvxFormatKeepItem > m_aKeepWithNextPara
Definition: tblafmt.hxx:178
SvStream & WriteUInt16(sal_uInt16 nUInt16)
void SetCJKPosture(const SvxPostureItem &rNew)
bool LastRowEndColumnIsRow()
Definition: tblafmt.cxx:740
void SetCJKFont(const SvxFontItem &rNew)
#define RES_CHRATR_FONTSIZE
Definition: hintids.hxx:170
void Create(SvxFormatKeepItem &rItem, SvStream &rStrm, sal_uInt16)
bool LoadBlockB(SvStream &rStream, const AutoFormatVersions &rVersions, sal_uInt16 nVer)
SwTableAutoFormat * FindAutoFormat(const OUString &rName) const
Find table style with the provided name, return nullptr when not found.
Definition: tblafmt.cxx:996
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
std::unique_ptr< SfxInt32Item > m_aRotateAngle
void LoadBlockB(SvStream &rStream, sal_uInt16 nVer)
SwBoxAutoFormat * m_aBoxAutoFormat[16]
Definition: tblafmt.hxx:173
void UpdateToSet(const sal_uInt8 nPos, const bool bSingleRowTable, const bool bSingleColTable, SfxItemSet &rSet, SwTableAutoFormatUpdateFlags eFlags, SvNumberFormatter *) const
Definition: tblafmt.cxx:561
SvStream & Store(const SvxShadowItem &rItem, SvStream &rStrm, sal_uInt16)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
std::unique_ptr< SvxFontItem > m_aFont
void SetAdjust(const SvxAdjustItem &rNew)
#define RES_CHRATR_CJK_POSTURE
Definition: hintids.hxx:187
std::unique_ptr< SvxContourItem > m_aContour
#define FRAME
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
Definition: legacyitem.cxx:32
const SvxFontHeightItem & GetCTLHeight() const
SwShellCursor * getShellCursor(bool bBlock)
Delivers the current shell cursor.
Definition: crsrsh.cxx:3014
#define AUTOTABLE_FORMAT_NAME
Definition: tblafmt.cxx:100
#define RES_SHADOW
Definition: hintids.hxx:307
const SvxShadowedItem & GetShadowed() const
void RemoveBoxFormat(const OUString &sName)
Definition: tblafmt.cxx:1198
sal_uIntPtr sal_uLong
void StoreTableProperties(const SwTable &table)
Definition: tblafmt.cxx:704
std::vector< std::pair< OUString, std::unique_ptr< SwBoxAutoFormat > > > m_aCellStyles
Definition: tblafmt.hxx:312
#define RES_FRAMEDIR
Definition: hintids.hxx:320
void SetRowSplit(const SwCursor &rCursor, const SwFormatRowSplit &rNew)
Definition: ndtbl1.cxx:317
const sal_uInt16 AUTOFORMAT_DATA_ID_504
Definition: tblafmt.cxx:82
SvStream & ReadCharAsBool(bool &rBool)
const SvxAdjustItem & GetAdjust() const
void Create(SvxShadowItem &rItem, SvStream &rStrm, sal_uInt16)
sal_Int64 n
Definition: doc.hxx:185
SVX_ROTATE_MODE_STANDARD
const SvxWeightItem & GetCTLWeight() const
const SvxFontItem & GetCTLFont() const
#define RES_CHRATR_CJK_WEIGHT
Definition: hintids.hxx:188
SvStream & Store(const SvxFrameDirectionItem &rItem, SvStream &rStrm, sal_uInt16)
sal_uInt64 Seek(sal_uInt64 nPos)
void SetTextOrientation(const SvxFrameDirectionItem &rNew)
Definition: tblafmt.hxx:84
#define RES_CHRATR_FONT
Definition: hintids.hxx:169
std::unique_ptr< SvxFontHeightItem > m_aCJKHeight
bool SaveBlockB(SvStream &rStream, sal_uInt16 fileVersion) const
static void WriteBlockB(SvStream &rStream, sal_uInt16 fileVersion)
SvxFrameDirection
const sal_uInt16 AUTOFORMAT_ID_X
Definition: tblafmt.cxx:75
void Flush()
sal_uInt16 GetRowsToRepeat() const
Definition: swtable.hxx:193
std::unique_ptr< SwFormatVertOrient > m_aVerticalAlignment
Definition: tblafmt.hxx:52
bool Save(SvStream &rStream, sal_uInt16 fileVersion) const
Definition: tblafmt.cxx:810
#define RES_CHRATR_CJK_FONT
Definition: hintids.hxx:184
void SetContour(const SvxContourItem &rNew)
#define RES_CHRATR_CJK_FONTSIZE
Definition: hintids.hxx:185
const SvxBrushItem & GetBackground() const
void SetCTLPosture(const SvxPostureItem &rNew)
std::shared_ptr< SvxFormatBreakItem > m_aBreak
Definition: tblafmt.hxx:176
const sal_uInt16 AUTOFORMAT_DATA_ID
Definition: tblafmt.cxx:95
SwTableAutoFormat(const OUString &rName)
Definition: tblafmt.cxx:367
void AddAutoFormat(const SwTableAutoFormat &rFormat)
Append table style to the existing styles.
Definition: tblafmt.cxx:944
static void Write(SvStream &rStream, sal_uInt16 fileVersion)
Definition: tblafmt.cxx:201
sal_uInt16 m_aRepeatHeading
Definition: tblafmt.hxx:179
SvStream & ReadUInt64(sal_uInt64 &rUInt64)
const SvxPostureItem & GetCTLPosture() const
void SetCTLWeight(const SvxWeightItem &rNew)
SwTableFormat * GetFrameFormat()
Definition: swtable.hxx:201
const OUString & GetFormatstring() const
const SvxWeightItem & GetCJKWeight() const
static void WriteBlockA(SvStream &rStream, sal_uInt16 fileVersion)
const sal_uInt16 AUTOFORMAT_DATA_ID_X
Definition: tblafmt.cxx:77
const OUString & GetNumFormatString() const
Definition: tblafmt.hxx:79
std::unique_ptr< SvxUnderlineItem > m_aUnderline
std::unique_ptr< SvxShadowedItem > m_aShadowed
bool IsFont() const
Definition: tblafmt.hxx:219
const SvxFontItem & GetFont() const
SvStream & Store(const SvxFormatBreakItem &rItem, SvStream &rStrm, sal_uInt16 nItemVersion)
std::unique_ptr< SvxOverlineItem > m_aOverline
void SetHeight(const SvxFontHeightItem &rNew)
std::unique_ptr< SvxFrameDirectionItem > m_aTextOrientation
Definition: tblafmt.hxx:51
void Load(SvStream &rStream, sal_uInt16 nVer)
Definition: tblafmt.cxx:190
ErrCode GetError() const
bool m_bCollapsingBorders
Definition: tblafmt.hxx:182
LINESTYLE_NONE
#define RES_CHRATR_CTL_FONTSIZE
Definition: hintids.hxx:190
static const std::vector< sal_Int32 > & GetTableTemplateMap()
Returns a vector of indexes in aBoxAutoFormat array. Returned indexes points to cells which are mappe...
Definition: tblafmt.cxx:891
bool IsJustify() const
Definition: tblafmt.hxx:220
void SetUnderline(const SvxUnderlineItem &rNew)
bool LoadBlockA(SvStream &rStream, const AutoFormatVersions &rVersions, sal_uInt16 nVer)
std::unique_ptr< SvxPostureItem > m_aCJKPosture
std::unique_ptr< SvxCrossedOutItem > m_aCrossedOut
std::unique_ptr< SvxHorJustifyItem > m_aHorJustify
void SetCJKWeight(const SvxWeightItem &rNew)
std::unique_ptr< SvxMarginItem > m_aMargin
static bool IsFuzzing()
int nCount
const SvxUnderlineItem & GetUnderline() const
void SetNumFormatLanguage(const LanguageType &rNew)
Definition: tblafmt.hxx:92
sal_uInt16 nNumFormatVersion
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
Definition: hints.cxx:153
const editeng::SvxBorderLine * GetLine(SvxBoxItemLine nLine) const
const SvxWeightItem & GetWeight() const
void SetAllDistances(sal_uInt16 nNew)
static sal_uInt8 CountPos(sal_uInt32 nCol, sal_uInt32 nCols, sal_uInt32 nRow, sal_uInt32 nRows)
Calculates the relevant position in the table autoformat for a given cell in a given table...
Definition: tblafmt.cxx:915
bool IsBackground() const
Definition: tblafmt.hxx:222
std::unique_ptr< SfxBoolItem > m_aLinebreak
sal_uInt64 remainingSize()
bool FirstRowEndColumnIsRow()
These methods returns what style (row or column) is applied first on given Cell.
Definition: tblafmt.cxx:732
OUString m_aName
Definition: tblafmt.hxx:160
const LanguageType & GetNumFormatLanguage() const
Definition: tblafmt.hxx:81
rtl_TextEncoding GetStoreCharSet(rtl_TextEncoding eEncoding)
const OUString & GetStyleName() const
void SetShadowed(const SvxShadowedItem &rNew)
const SvxContourItem & GetContour() const
AutoFormatBase & operator=(const AutoFormatBase &)
SwTableAutoFormatUpdateFlags
Definition: tblafmt.hxx:103
void ChangeBoxFormatName(const OUString &sFromName, const OUString &sToName)
Definition: tblafmt.cxx:1233
#define RES_BACKGROUND
Definition: hintids.hxx:305
const Color & GetColor() const
OUString m_aName
#define RES_CHRATR_COLOR
Definition: hintids.hxx:165
sal_uInt16 const aTableSetRange[]
Definition: init.cxx:192
const sal_uInt16 AUTOFORMAT_ID_504
In follow-up versions these IDs' values need to increase.
Definition: tblafmt.cxx:81
void SetCrossedOut(const SvxCrossedOutItem &rNew)
const sal_uInt16 AUTOFORMAT_DATA_ID_552
Definition: tblafmt.cxx:84
bool operator==(const SwBoxAutoFormat &rRight)
Comparing based of boxes backgrounds.
Definition: tblafmt.cxx:307
std::shared_ptr< SvxShadowItem > m_aShadow
Definition: tblafmt.hxx:183
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
#define SOFFICE_FILEFORMAT_50
#define RES_CHRATR_OVERLINE
Definition: hintids.hxx:200
const OUString & GetUserConfigPath() const
OUString GetTableTemplateCellSubName(const SwBoxAutoFormat &rBoxFormat) const
Returns the cell's name postfix. eg. ".1".
Definition: tblafmt.cxx:851
const SvxFrameDirectionItem & GetTextOrientation() const
Definition: tblafmt.hxx:73
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SetWeight(const SvxWeightItem &rNew)
#define RES_CHRATR_CTL_FONT
Definition: hintids.hxx:189
Reference< XAnimationNode > Clone(const Reference< XAnimationNode > &xSourceNode, const SdPage *pSource, const SdPage *pTarget)
const SvxFontHeightItem & GetCJKHeight() const
void SetBox(const SvxBoxItem &rNew)
const SwBoxAutoFormat & GetBoxFormat(sal_uInt8 nPos) const
Definition: tblafmt.cxx:457
void LoadBlockA(SvStream &rStream, sal_uInt16 nVer)
SwEditShell const * GetEditShell() const
Definition: doccorr.cxx:317
size_t size() const
Definition: tblafmt.cxx:1178
#define LANGUAGE_SYSTEM
std::unique_ptr< SvxLineItem > m_aTLBR
std::unique_ptr< SvxBoxItem > m_aBox
#define RES_VERT_ORIENT
Definition: hintids.hxx:302
std::unique_ptr< SvxVerJustifyItem > m_aVerJustify
const sal_uInt16 AUTOFORMAT_ID
Definition: tblafmt.cxx:94
std::unique_ptr< SvxWeightItem > m_aCTLWeight
sal_uInt16 GetVersion(sal_uInt16)
int i
QPRO_FUNC_TYPE const nType
LanguageType m_eNumFormatLanguage
Definition: tblafmt.hxx:57
void SetCTLHeight(const SvxFontHeightItem &rNew)
void SetCJKHeight(const SvxFontHeightItem &rNew)
size_t size() const
Definition: tblafmt.cxx:930
bool Save(SvStream &rStream, sal_uInt16 fileVersion) const
Definition: tblafmt.cxx:345
WEIGHT_NORMAL
bool Load(SvStream &rStream, const SwAfVersions &rVersions, sal_uInt16 nVer)
Definition: tblafmt.cxx:312
#define RES_LAYOUT_SPLIT
Definition: hintids.hxx:313
std::unique_ptr< SvxAdjustItem > m_aAdjust
SwFormatPageDesc m_aPageDesc
Definition: tblafmt.hxx:177
#define RES_CHRATR_UNDERLINE
Definition: hintids.hxx:176
static const SwBoxAutoFormat & GetDefaultBoxFormat()
Definition: tblafmt.cxx:488
SvNumFormatType
SwBoxAutoFormat & operator=(const SwBoxAutoFormat &rRef)
assignment-op (still used)
Definition: tblafmt.cxx:282
bool SaveBlockA(SvStream &rStream, sal_uInt16 fileVersion) const
bool m_bInclValueFormat
Definition: tblafmt.hxx:168
SvStream & ReadUChar(unsigned char &rChar)
std::unique_ptr< SvxFontItem > m_aCTLFont
ITALIC_NONE
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:119
void SetVersion(sal_Int32 n)
void SetBoxFormat(const SwBoxAutoFormat &rNew, sal_uInt8 nPos)
Definition: tblafmt.cxx:446
std::unique_ptr< Impl > m_pImpl
Definition: tblafmt.hxx:270
const SvxPostureItem & GetCJKPosture() const
const sal_uInt16 AUTOFORMAT_ID_31005
Definition: tblafmt.cxx:90
std::unique_ptr< SvxPostureItem > m_aPosture
static std::unique_ptr< SwFormatRowSplit > GetRowSplit(const SwCursor &rCursor)
Definition: ndtbl1.cxx:343
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:110
#define RES_CHRATR_CONTOUR
Definition: hintids.hxx:166
void GetValueFormat(OUString &rFormat, LanguageType &rLng, LanguageType &rSys) const
Definition: tblafmt.hxx:76
OUString m_sNumFormatString
Definition: tblafmt.hxx:55
std::unique_ptr< SwTableAutoFormat > ReleaseAutoFormat(size_t i)
Definition: tblafmt.cxx:975
void SetFont(const SvxFontItem &rNew)
Reference< XOutputStream > stream
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:458
const OUString & GetName() const
Definition: tblafmt.hxx:208
bool LastRowStartColumnIsRow()
Definition: tblafmt.cxx:744
const sal_uInt16 AUTOFORMAT_FILE_VERSION
Definition: tblafmt.cxx:96
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SvStream * GetInStream()
const SvxCrossedOutItem & GetCrossedOut() const
const SwFormatVertOrient & GetVerticalAlignment() const
Definition: tblafmt.hxx:74
sal_uInt16 m_nTextOrientationVersion
Definition: tblafmt.cxx:175
sal_uInt16 GetVersion(sal_uInt16)
Definition: legacyitem.cxx:27
#define SOFFICE_FILEFORMAT_40
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
bool Load(SvStream &rStream, const SwAfVersions &)
Definition: tblafmt.cxx:749
#define SAL_WARN_IF(condition, area, stream)
#define ERRCODE_NONE
const SvxOverlineItem & GetOverline() const
unsigned char sal_uInt8
#define RES_CHRATR_POSTURE
Definition: hintids.hxx:173
const SvNumberformat * GetEntry(sal_uInt32 nKey) const
#define RES_CHRATR_CTL_WEIGHT
Definition: hintids.hxx:193
#define RES_CHRATR_CTL_POSTURE
Definition: hintids.hxx:192
std::unique_ptr< SvxRotateModeItem > m_aRotateMode
void RestoreTableProperties(SwTable &table) const
Definition: tblafmt.cxx:675
std::unique_ptr< SvxLineItem > m_aBLTR
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:253
SwTableAutoFormat const & operator[](size_t i) const
Definition: tblafmt.cxx:935
std::unique_ptr< SvxFontItem > m_aCJKFont
sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion)
#define SAL_INFO(area, stream)
SvStream & WriteUChar(unsigned char nChar)
std::vector< std::unique_ptr< SwTableAutoFormat > > m_AutoFormats
Definition: tblafmt.cxx:927
SwTableAutoFormat & operator=(const SwTableAutoFormat &rNew)
Definition: tblafmt.cxx:398
void EraseAutoFormat(size_t i)
Definition: tblafmt.cxx:958
LanguageType GetAppLanguage()
Definition: init.cxx:729
const LanguageType & GetSysLanguage() const
Definition: tblafmt.hxx:80
void SetStreamCharSet(rtl_TextEncoding eCharSet)
#define RES_KEEP
Definition: hintids.hxx:310
SwCellStyleDescriptor operator[](size_t i) const
Definition: tblafmt.cxx:1188
rtl_TextEncoding GetStreamCharSet() const
const sal_uInt16 AUTOFORMAT_DATA_ID_31005
Definition: tblafmt.cxx:91
static const OUString & GetUIName(const OUString &rName, SwGetPoolIdFromName)
void InsertAutoFormat(size_t i, std::unique_ptr< SwTableAutoFormat > pFormat)
Definition: tblafmt.cxx:953
const SvxFontItem & GetCJKFont() const
OUString GetBoxFormatName(const SwBoxAutoFormat &rBoxFormat) const
If found returns its name. If not found returns an empty OUString.
Definition: tblafmt.cxx:1210
sal_uInt64 Tell() const
#define RES_PARATR_ADJUST
Definition: hintids.hxx:256
const sal_uInt16 AUTOFORMAT_ID_680DR25
Definition: tblafmt.cxx:87
void AddBoxFormat(const SwBoxAutoFormat &rBoxFormat, const OUString &sName)
Add a copy of rBoxFormat.
Definition: tblafmt.cxx:1193
sal_Int16 GetVertOrient() const
Definition: fmtornt.hxx:54
#define DEF_LINE_WIDTH_5
std::unique_ptr< SvxColorItem > m_aColor
const sal_uInt16 AUTOFORMAT_ID_358
Definition: tblafmt.cxx:76
#define RES_CHRATR_SHADOWED
Definition: hintids.hxx:175
std::unique_ptr< SvxWeightItem > m_aCJKWeight
void UpdateFromSet(sal_uInt8 nPos, const SfxItemSet &rSet, SwTableAutoFormatUpdateFlags eFlags, SvNumberFormatter const *)
Definition: tblafmt.cxx:496
def text(shape, st)
sal_uInt32 GetValue() const
#define RES_BOX
Definition: hintids.hxx:306
void SAL_CALL first(const css::awt::SpinEvent &rEvent) override
LanguageType m_eSysLanguage
Definition: tblafmt.hxx:56
std::unique_ptr< SvxWeightItem > m_aWeight
void SetPosture(const SvxPostureItem &rNew)
#define SAL_WARN(area, stream)
SvStream & Store(const SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16)
Definition: legacyitem.cxx:67
#define RES_CHRATR_CROSSEDOUT
Definition: hintids.hxx:167
#define RES_COLLAPSING_BORDERS
Definition: hintids.hxx:324
SwBoxAutoFormat * GetBoxFormat(const OUString &sName) const
If found returns a ptr to a BoxFormat. If not found returns nullptr.
Definition: tblafmt.cxx:1222
bool SearchFile(OUString &rIniFile, Paths ePath=PATH_USERCONFIG)
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
STRIKEOUT_NONE
const SvxPostureItem & GetPosture() const
std::size_t write_uInt16_lenPrefixed_uInt8s_FromOUString(SvStream &rStrm, const OUString &rStr, rtl_TextEncoding eEnc)
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
const SvxColorItem & GetColor() const
#define RES_PAGEDESC
Definition: hintids.hxx:293
#define RES_BREAK
Definition: hintids.hxx:294
void SetCTLFont(const SvxFontItem &rNew)
std::unique_ptr< SvxFontHeightItem > m_aCTLHeight
void SetSysLanguage(const LanguageType &rNew)
Definition: tblafmt.hxx:91
sal_uInt16 m_nVerticalAlignmentVersion
Definition: tblafmt.cxx:176
bool IsFrame() const
Definition: tblafmt.hxx:221
const SvxBoxItem & GetBox() const
const SvxFontHeightItem & GetHeight() const
bool FirstRowStartColumnIsRow()
Definition: tblafmt.cxx:736
LanguageType GetLanguage() const
sal_uInt16 nPos
#define RES_BOXATR_FORMAT
Definition: hintids.hxx:356
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1313
sal_uInt16 m_nStrResId
Definition: tblafmt.hxx:161
bool Save() const
Definition: tblafmt.cxx:1051
void SetColor(const SvxColorItem &rNew)
OUString ReadUniOrByteString(rtl_TextEncoding eSrcCharSet)
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)