2010-10-12 15:59:00 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-30 12:23:25 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2017-06-13 10:46:16 +02:00
|
|
|
#include <sal/config.h>
|
|
|
|
|
|
|
|
#include <utility>
|
|
|
|
|
2000-09-18 23:16:46 +00:00
|
|
|
#include "scitems.hxx"
|
2014-04-16 16:28:33 +02:00
|
|
|
|
2012-06-11 13:15:18 +01:00
|
|
|
#include <comphelper/string.hxx>
|
2014-01-20 13:55:03 +00:00
|
|
|
#include <i18nutil/unicode.hxx>
|
2017-06-13 10:46:16 +02:00
|
|
|
#include <o3tl/make_unique.hxx>
|
2001-07-12 09:40:43 +00:00
|
|
|
#include <vcl/outdev.hxx>
|
2014-01-20 13:55:03 +00:00
|
|
|
#include <vcl/svapp.hxx>
|
2014-01-02 23:52:37 +01:00
|
|
|
#include <vcl/settings.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/aeitem.hxx>
|
|
|
|
#include <svl/itemiter.hxx>
|
2013-01-08 10:56:44 +00:00
|
|
|
#include <svl/stritem.hxx>
|
2000-09-18 23:16:46 +00:00
|
|
|
#include <svx/algitem.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/boxitem.hxx>
|
2013-02-12 13:41:53 -05:00
|
|
|
#include <editeng/lineitem.hxx>
|
|
|
|
#include <editeng/brushitem.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/charreliefitem.hxx>
|
2013-02-12 13:41:53 -05:00
|
|
|
#include <editeng/contouritem.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/colritem.hxx>
|
2013-02-12 13:41:53 -05:00
|
|
|
#include <editeng/crossedoutitem.hxx>
|
2000-09-18 23:16:46 +00:00
|
|
|
#include <svx/dialmgr.hxx>
|
2013-02-12 13:41:53 -05:00
|
|
|
#include <editeng/emphasismarkitem.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/fhgtitem.hxx>
|
|
|
|
#include <editeng/fontitem.hxx>
|
|
|
|
#include <editeng/forbiddenruleitem.hxx>
|
|
|
|
#include <editeng/frmdiritem.hxx>
|
|
|
|
#include <editeng/hngpnctitem.hxx>
|
|
|
|
#include <editeng/itemtype.hxx>
|
|
|
|
#include <editeng/langitem.hxx>
|
|
|
|
#include <editeng/lrspitem.hxx>
|
2000-09-18 23:16:46 +00:00
|
|
|
#include <svx/pageitem.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/pbinitem.hxx>
|
|
|
|
#include <editeng/postitem.hxx>
|
2000-09-18 23:16:46 +00:00
|
|
|
#include <svx/rotmodit.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/scriptspaceitem.hxx>
|
|
|
|
#include <editeng/shaditem.hxx>
|
|
|
|
#include <editeng/shdditem.hxx>
|
|
|
|
#include <editeng/sizeitem.hxx>
|
2000-09-18 23:16:46 +00:00
|
|
|
#include <svx/svxitems.hrc>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/udlnitem.hxx>
|
|
|
|
#include <editeng/ulspitem.hxx>
|
|
|
|
#include <editeng/wghtitem.hxx>
|
|
|
|
#include <editeng/wrlmitem.hxx>
|
|
|
|
#include <editeng/xmlcnitm.hxx>
|
2010-10-05 11:19:10 -04:00
|
|
|
#include <editeng/justifyitem.hxx>
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
#include "docpool.hxx"
|
|
|
|
#include "global.hxx"
|
|
|
|
#include "attrib.hxx"
|
|
|
|
#include "patattr.hxx"
|
|
|
|
#include "globstr.hrc"
|
2014-09-04 00:14:59 +02:00
|
|
|
#include "document.hxx"
|
2013-10-22 15:58:57 +03:00
|
|
|
#include "sc.hrc"
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2015-11-10 10:22:39 +01:00
|
|
|
sal_uInt16* ScDocumentPool::pVersionMap1 = nullptr;
|
|
|
|
sal_uInt16* ScDocumentPool::pVersionMap2 = nullptr;
|
|
|
|
sal_uInt16* ScDocumentPool::pVersionMap3 = nullptr;
|
|
|
|
sal_uInt16* ScDocumentPool::pVersionMap4 = nullptr;
|
|
|
|
sal_uInt16* ScDocumentPool::pVersionMap5 = nullptr;
|
|
|
|
sal_uInt16* ScDocumentPool::pVersionMap6 = nullptr;
|
|
|
|
sal_uInt16* ScDocumentPool::pVersionMap7 = nullptr;
|
|
|
|
sal_uInt16* ScDocumentPool::pVersionMap8 = nullptr;
|
|
|
|
sal_uInt16* ScDocumentPool::pVersionMap9 = nullptr;
|
|
|
|
sal_uInt16* ScDocumentPool::pVersionMap10 = nullptr;
|
|
|
|
sal_uInt16* ScDocumentPool::pVersionMap11 = nullptr;
|
|
|
|
sal_uInt16* ScDocumentPool::pVersionMap12 = nullptr;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2001-09-26 18:12:35 +00:00
|
|
|
// ATTR_FONT_TWOLINES (not used) was changed to ATTR_USERDEF (not saved in binary format) in 641c
|
|
|
|
|
2010-12-12 09:17:08 +01:00
|
|
|
static SfxItemInfo const aItemInfos[] =
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2016-03-09 09:47:35 +02:00
|
|
|
{ SID_ATTR_CHAR_FONT, true }, // ATTR_FONT
|
|
|
|
{ SID_ATTR_CHAR_FONTHEIGHT, true }, // ATTR_FONT_HEIGHT
|
|
|
|
{ SID_ATTR_CHAR_WEIGHT, true }, // ATTR_FONT_WEIGHT
|
|
|
|
{ SID_ATTR_CHAR_POSTURE, true }, // ATTR_FONT_POSTURE
|
|
|
|
{ SID_ATTR_CHAR_UNDERLINE, true }, // ATTR_FONT_UNDERLINE
|
|
|
|
{ SID_ATTR_CHAR_OVERLINE, true }, // ATTR_FONT_OVERLINE
|
|
|
|
{ SID_ATTR_CHAR_STRIKEOUT, true }, // ATTR_FONT_CROSSEDOUT
|
|
|
|
{ SID_ATTR_CHAR_CONTOUR, true }, // ATTR_FONT_CONTOUR
|
|
|
|
{ SID_ATTR_CHAR_SHADOWED, true }, // ATTR_FONT_SHADOWED
|
|
|
|
{ SID_ATTR_CHAR_COLOR, true }, // ATTR_FONT_COLOR
|
|
|
|
{ SID_ATTR_CHAR_LANGUAGE, true }, // ATTR_FONT_LANGUAGE
|
|
|
|
{ SID_ATTR_CHAR_CJK_FONT, true }, // ATTR_CJK_FONT from 614
|
|
|
|
{ SID_ATTR_CHAR_CJK_FONTHEIGHT, true }, // ATTR_CJK_FONT_HEIGHT from 614
|
|
|
|
{ SID_ATTR_CHAR_CJK_WEIGHT, true }, // ATTR_CJK_FONT_WEIGHT from 614
|
|
|
|
{ SID_ATTR_CHAR_CJK_POSTURE, true }, // ATTR_CJK_FONT_POSTURE from 614
|
|
|
|
{ SID_ATTR_CHAR_CJK_LANGUAGE, true }, // ATTR_CJK_FONT_LANGUAGE from 614
|
|
|
|
{ SID_ATTR_CHAR_CTL_FONT, true }, // ATTR_CTL_FONT from 614
|
|
|
|
{ SID_ATTR_CHAR_CTL_FONTHEIGHT, true }, // ATTR_CTL_FONT_HEIGHT from 614
|
|
|
|
{ SID_ATTR_CHAR_CTL_WEIGHT, true }, // ATTR_CTL_FONT_WEIGHT from 614
|
|
|
|
{ SID_ATTR_CHAR_CTL_POSTURE, true }, // ATTR_CTL_FONT_POSTURE from 614
|
|
|
|
{ SID_ATTR_CHAR_CTL_LANGUAGE, true }, // ATTR_CTL_FONT_LANGUAGE from 614
|
|
|
|
{ SID_ATTR_CHAR_EMPHASISMARK, true }, // ATTR_FONT_EMPHASISMARK from 614
|
|
|
|
{ 0, true }, // ATTR_USERDEF from 614 / 641c
|
|
|
|
{ SID_ATTR_CHAR_WORDLINEMODE, true }, // ATTR_FONT_WORDLINE from 632b
|
|
|
|
{ SID_ATTR_CHAR_RELIEF, true }, // ATTR_FONT_RELIEF from 632b
|
|
|
|
{ SID_ATTR_ALIGN_HYPHENATION, true }, // ATTR_HYPHENATE from 632b
|
|
|
|
{ 0, true }, // ATTR_SCRIPTSPACE from 614d
|
|
|
|
{ 0, true }, // ATTR_HANGPUNCTUATION from 614d
|
|
|
|
{ SID_ATTR_PARA_FORBIDDEN_RULES,true }, // ATTR_FORBIDDEN_RULES from 614d
|
|
|
|
{ SID_ATTR_ALIGN_HOR_JUSTIFY, true }, // ATTR_HOR_JUSTIFY
|
|
|
|
{ SID_ATTR_ALIGN_HOR_JUSTIFY_METHOD, true }, // ATTR_HOR_JUSTIFY_METHOD
|
|
|
|
{ SID_ATTR_ALIGN_INDENT, true }, // ATTR_INDENT from 350
|
|
|
|
{ SID_ATTR_ALIGN_VER_JUSTIFY, true }, // ATTR_VER_JUSTIFY
|
|
|
|
{ SID_ATTR_ALIGN_VER_JUSTIFY_METHOD, true }, // ATTR_VER_JUSTIFY_METHOD
|
|
|
|
{ SID_ATTR_ALIGN_STACKED, true }, // ATTR_STACKED from 680/dr14 (replaces ATTR_ORIENTATION)
|
|
|
|
{ SID_ATTR_ALIGN_DEGREES, true }, // ATTR_ROTATE_VALUE from 367
|
|
|
|
{ SID_ATTR_ALIGN_LOCKPOS, true }, // ATTR_ROTATE_MODE from 367
|
|
|
|
{ SID_ATTR_ALIGN_ASIANVERTICAL, true }, // ATTR_VERTICAL_ASIAN from 642
|
|
|
|
{ SID_ATTR_FRAMEDIRECTION, true }, // ATTR_WRITINGDIR from 643
|
|
|
|
{ SID_ATTR_ALIGN_LINEBREAK, true }, // ATTR_LINEBREAK
|
|
|
|
{ SID_ATTR_ALIGN_SHRINKTOFIT, true }, // ATTR_SHRINKTOFIT from 680/dr14
|
|
|
|
{ SID_ATTR_BORDER_DIAG_TLBR, true }, // ATTR_BORDER_TLBR from 680/dr14
|
|
|
|
{ SID_ATTR_BORDER_DIAG_BLTR, true }, // ATTR_BORDER_BLTR from 680/dr14
|
|
|
|
{ SID_ATTR_ALIGN_MARGIN, true }, // ATTR_MARGIN
|
|
|
|
{ 0, true }, // ATTR_MERGE
|
|
|
|
{ 0, true }, // ATTR_MERGE_FLAG
|
|
|
|
{ SID_ATTR_NUMBERFORMAT_VALUE, true }, // ATTR_VALUE_FORMAT
|
|
|
|
{ ATTR_LANGUAGE_FORMAT, true }, // ATTR_LANGUAGE_FORMAT from 329, is combined with SID_ATTR_NUMBERFORMAT_VALUE in the dialog
|
|
|
|
{ SID_ATTR_BRUSH, true }, // ATTR_BACKGROUND
|
|
|
|
{ SID_SCATTR_PROTECTION, true }, // ATTR_PROTECTION
|
|
|
|
{ SID_ATTR_BORDER_OUTER, true }, // ATTR_BORDER
|
|
|
|
{ SID_ATTR_BORDER_INNER, true }, // ATTR_BORDER_INNER
|
|
|
|
{ SID_ATTR_BORDER_SHADOW, true }, // ATTR_SHADOW
|
|
|
|
{ 0, true }, // ATTR_VALIDDATA
|
|
|
|
{ 0, true }, // ATTR_CONDITIONAL
|
|
|
|
{ 0, true }, // ATTR_HYPERLINK
|
|
|
|
{ 0, true }, // ATTR_PATTERN
|
|
|
|
{ SID_ATTR_LRSPACE, true }, // ATTR_LRSPACE
|
|
|
|
{ SID_ATTR_ULSPACE, true }, // ATTR_ULSPACE
|
|
|
|
{ SID_ATTR_PAGE, true }, // ATTR_PAGE
|
|
|
|
{ 0, true }, // ATTR_PAGE_PAPERTRAY, since 303 just a dummy
|
|
|
|
{ SID_ATTR_PAGE_PAPERBIN, true }, // ATTR_PAGE_PAPERBIN
|
|
|
|
{ SID_ATTR_PAGE_SIZE, true }, // ATTR_PAGE_SIZE
|
|
|
|
{ SID_ATTR_PAGE_MAXSIZE, true }, // ATTR_PAGE_MAXSIZE
|
|
|
|
{ SID_ATTR_PAGE_EXT1, true }, // ATTR_PAGE_HORCENTER
|
|
|
|
{ SID_ATTR_PAGE_EXT2, true }, // ATTR_PAGE_VERCENTER
|
|
|
|
{ SID_ATTR_PAGE_ON, true }, // ATTR_PAGE_ON
|
|
|
|
{ SID_ATTR_PAGE_DYNAMIC, true }, // ATTR_PAGE_DYNAMIC
|
|
|
|
{ SID_ATTR_PAGE_SHARED, true }, // ATTR_PAGE_SHARED
|
|
|
|
{ SID_SCATTR_PAGE_NOTES, true }, // ATTR_PAGE_NOTES
|
|
|
|
{ SID_SCATTR_PAGE_GRID, true }, // ATTR_PAGE_GRID
|
|
|
|
{ SID_SCATTR_PAGE_HEADERS, true }, // ATTR_PAGE_HEADERS
|
|
|
|
{ SID_SCATTR_PAGE_CHARTS, true }, // ATTR_PAGE_CHARTS
|
|
|
|
{ SID_SCATTR_PAGE_OBJECTS, true }, // ATTR_PAGE_OBJECTS
|
|
|
|
{ SID_SCATTR_PAGE_DRAWINGS, true }, // ATTR_PAGE_DRAWINGS
|
|
|
|
{ SID_SCATTR_PAGE_TOPDOWN, true }, // ATTR_PAGE_TOPDOWN
|
|
|
|
{ SID_SCATTR_PAGE_SCALE, true }, // ATTR_PAGE_SCALE
|
|
|
|
{ SID_SCATTR_PAGE_SCALETOPAGES, true }, // ATTR_PAGE_SCALETOPAGES
|
|
|
|
{ SID_SCATTR_PAGE_FIRSTPAGENO, true }, // ATTR_PAGE_FIRSTPAGENO
|
|
|
|
{ SID_SCATTR_PAGE_PRINTAREA, true }, // ATTR_PAGE_PRINTAREA
|
|
|
|
{ SID_SCATTR_PAGE_REPEATROW, true }, // ATTR_PAGE_REPEATROW
|
|
|
|
{ SID_SCATTR_PAGE_REPEATCOL, true }, // ATTR_PAGE_REPEATCOL
|
|
|
|
{ SID_SCATTR_PAGE_PRINTTABLES, true }, // ATTR_PAGE_PRINTTABLES
|
|
|
|
{ SID_SCATTR_PAGE_HEADERLEFT, true }, // ATTR_PAGE_HEADERLEFT
|
|
|
|
{ SID_SCATTR_PAGE_FOOTERLEFT, true }, // ATTR_PAGE_FOOTERLEFT
|
|
|
|
{ SID_SCATTR_PAGE_HEADERRIGHT, true }, // ATTR_PAGE_HEADERRIGHT
|
|
|
|
{ SID_SCATTR_PAGE_FOOTERRIGHT, true }, // ATTR_PAGE_FOOTERRIGHT
|
|
|
|
{ SID_ATTR_PAGE_HEADERSET, true }, // ATTR_PAGE_HEADERSET
|
|
|
|
{ SID_ATTR_PAGE_FOOTERSET, true }, // ATTR_PAGE_FOOTERSET
|
|
|
|
{ SID_SCATTR_PAGE_FORMULAS, true }, // ATTR_PAGE_FORMULAS
|
|
|
|
{ SID_SCATTR_PAGE_NULLVALS, true }, // ATTR_PAGE_NULLVALS
|
|
|
|
{ SID_SCATTR_PAGE_SCALETO, true }, // ATTR_PAGE_SCALETO
|
|
|
|
{ 0, true } // ATTR_HIDDEN
|
2000-09-18 23:16:46 +00:00
|
|
|
};
|
2015-02-05 20:54:12 +00:00
|
|
|
static_assert(
|
|
|
|
SAL_N_ELEMENTS(aItemInfos) == ATTR_ENDINDEX - ATTR_STARTINDEX + 1, "these must match");
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2016-09-09 15:32:41 +02:00
|
|
|
ScDocumentPool::ScDocumentPool()
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2017-01-30 16:38:54 +02:00
|
|
|
: SfxItemPool ( "ScDocumentPool",
|
2000-09-18 23:16:46 +00:00
|
|
|
ATTR_STARTINDEX, ATTR_ENDINDEX,
|
2016-09-24 20:41:52 +02:00
|
|
|
aItemInfos, nullptr, false/*bLoadRefCounts*/ ),
|
|
|
|
mnCurrentMaxKey(0)
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2017-06-28 16:49:42 +02:00
|
|
|
// this is a hack for unit tests that need to have a ScDocument
|
|
|
|
// but don't want to depend on BootstrapFixture
|
|
|
|
if (!pVersionMap1)
|
|
|
|
InitVersionMaps();
|
|
|
|
|
2001-07-12 09:40:43 +00:00
|
|
|
// latin font from GetDefaultFonts is not used, DEFAULTFONT_LATIN_SPREADSHEET instead
|
2015-05-05 09:58:47 +02:00
|
|
|
vcl::Font aStdFont = OutputDevice::GetDefaultFont( DefaultFontType::LATIN_SPREADSHEET, LANGUAGE_ENGLISH_US,
|
2015-05-19 14:37:07 +02:00
|
|
|
GetDefaultFontFlags::OnlyOne );
|
2016-01-21 03:30:10 +11:00
|
|
|
SvxFontItem* pStdFont = new SvxFontItem( aStdFont.GetFamilyType(),
|
2016-01-17 13:26:25 +11:00
|
|
|
aStdFont.GetFamilyName(), aStdFont.GetStyleName(),
|
2000-11-25 11:13:30 +00:00
|
|
|
aStdFont.GetPitch(), aStdFont.GetCharSet(),
|
|
|
|
ATTR_FONT );
|
|
|
|
|
|
|
|
SvxFontItem* pCjkFont = new SvxFontItem( ATTR_CJK_FONT );
|
|
|
|
SvxFontItem* pCtlFont = new SvxFontItem( ATTR_CTL_FONT );
|
2007-05-10 15:43:34 +00:00
|
|
|
SvxFontItem aDummy( ATTR_FONT );
|
2000-11-25 11:13:30 +00:00
|
|
|
GetDefaultFonts( aDummy, *pCjkFont, *pCtlFont );
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
SvxBoxInfoItem* pGlobalBorderInnerAttr = new SvxBoxInfoItem( ATTR_BORDER_INNER );
|
Make SfxItemSet ranges correct by construction
This is a follow-up to 45a7f5b62d0b1b21763c1c94255ef2309ea4280b "Keep WID ranges
sorted, and join adjacent ones". While SfxItemSet::MergeRange relies on the
m_pWhichRanges being sorted (and, under DBG_UTIL, asserts if they are not), the
various SfxItemSet constructors curiously only check (via assert or DBG_ASSERT)
that each individual range has an upper bound not smaller than its lower bound.
Arguably, all SfxItemSet instances should fulfill the stronger guarantees
required and checked by MergeRange.
And in many cases the ranges are statically known, so that the checking can
happen at compile time. Therefore, replace the two SfxItemSet ctors taking
explicit ranges with two other ctors that actually do proper checking. The
(templated) overload taking an svl::Items struct should be used in all cases
where the range values are statically known at compile time, while the overload
taking a std::initializer_list<Pair> is for the remaining cases (that can only
do runtime checking via assert). Most of those latter cases are simple cases
with a single range covering a single item, but a few are more complex.
(At least some of the uses of the existing SfxItemSet overload taking a
const sal_uInt16* pWhichPairTable
can probably also be strengthened, but that is left for another day.)
This commit is the first in a series of two. Apart from the manual changes to
compilerplugins/clang/store/sfxitemsetrewrite.cxx, include/svl/itemset.hxx, and
svl/source/items/itemset.cxx, it only consists of automatic rewriting of the
relevant SfxItemSet ctor calls (plus a few required manual fixes, see next).
But it does not yet check that the individual ranges are properly sorted (see
the TODO in svl::detail::validGap). That check will be enabled, and the ensuing
manual fixes will be made in a follow-up commit, to reduce the likelyhood of
accidents.
There were three cases of necessary manual intervention:
* sw/source/core/unocore/unostyle.cxx uses eAtr of enum type RES_FRMATR in
braced-init-list syntax now, so needs explicit narrowing conversion to
sal_uInt16.
* In sw/source/uibase/uiview/formatclipboard.cxx, the trailiing comma in the
definition of macro FORMAT_PAINTBRUSH_FRAME_IDS needed to be removed manually.
* In svx/source/svdraw/svdoashp.cxx, svx/source/svdraw/svdotext.cxx,
sw/source/uibase/app/docstyle.cxx, sw/source/uibase/shells/frmsh.cxx,
sw/source/uibase/shells/grfsh.cxx, and sw/source/uibase/shells/textsh1.cxx,
some comments had to be put back (see "TODO: the replaced range can contain
relevant comments" in compilerplugins/clang/store/sfxitemsetrewrite.cxx).
A few uses of the variadic form erroneously used nullptr instead of 0 for
termination. But this should have been harmless even if promoted std::nullptr_t
is larger than promoted sal_uInt16, assuming that the part of the nullptr value
that was interpreted as sal_uInt16/promoted int was all-zero bits. Similarly,
some uses made the harmless error of using 0L instead of 0.
Change-Id: I2afea97282803cb311b9321a99bb627520ef5e35
Reviewed-on: https://gerrit.libreoffice.org/38861
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-06-16 09:58:13 +02:00
|
|
|
auto pSet = o3tl::make_unique<SfxItemSet>( *this, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
|
2000-09-18 23:16:46 +00:00
|
|
|
SfxItemSet aSetItemItemSet( *this,
|
Make SfxItemSet ranges correct by construction
This is a follow-up to 45a7f5b62d0b1b21763c1c94255ef2309ea4280b "Keep WID ranges
sorted, and join adjacent ones". While SfxItemSet::MergeRange relies on the
m_pWhichRanges being sorted (and, under DBG_UTIL, asserts if they are not), the
various SfxItemSet constructors curiously only check (via assert or DBG_ASSERT)
that each individual range has an upper bound not smaller than its lower bound.
Arguably, all SfxItemSet instances should fulfill the stronger guarantees
required and checked by MergeRange.
And in many cases the ranges are statically known, so that the checking can
happen at compile time. Therefore, replace the two SfxItemSet ctors taking
explicit ranges with two other ctors that actually do proper checking. The
(templated) overload taking an svl::Items struct should be used in all cases
where the range values are statically known at compile time, while the overload
taking a std::initializer_list<Pair> is for the remaining cases (that can only
do runtime checking via assert). Most of those latter cases are simple cases
with a single range covering a single item, but a few are more complex.
(At least some of the uses of the existing SfxItemSet overload taking a
const sal_uInt16* pWhichPairTable
can probably also be strengthened, but that is left for another day.)
This commit is the first in a series of two. Apart from the manual changes to
compilerplugins/clang/store/sfxitemsetrewrite.cxx, include/svl/itemset.hxx, and
svl/source/items/itemset.cxx, it only consists of automatic rewriting of the
relevant SfxItemSet ctor calls (plus a few required manual fixes, see next).
But it does not yet check that the individual ranges are properly sorted (see
the TODO in svl::detail::validGap). That check will be enabled, and the ensuing
manual fixes will be made in a follow-up commit, to reduce the likelyhood of
accidents.
There were three cases of necessary manual intervention:
* sw/source/core/unocore/unostyle.cxx uses eAtr of enum type RES_FRMATR in
braced-init-list syntax now, so needs explicit narrowing conversion to
sal_uInt16.
* In sw/source/uibase/uiview/formatclipboard.cxx, the trailiing comma in the
definition of macro FORMAT_PAINTBRUSH_FRAME_IDS needed to be removed manually.
* In svx/source/svdraw/svdoashp.cxx, svx/source/svdraw/svdotext.cxx,
sw/source/uibase/app/docstyle.cxx, sw/source/uibase/shells/frmsh.cxx,
sw/source/uibase/shells/grfsh.cxx, and sw/source/uibase/shells/textsh1.cxx,
some comments had to be put back (see "TODO: the replaced range can contain
relevant comments" in compilerplugins/clang/store/sfxitemsetrewrite.cxx).
A few uses of the variadic form erroneously used nullptr instead of 0 for
termination. But this should have been harmless even if promoted std::nullptr_t
is larger than promoted sal_uInt16, assuming that the part of the nullptr value
that was interpreted as sal_uInt16/promoted int was all-zero bits. Similarly,
some uses made the harmless error of using 0L instead of 0.
Change-Id: I2afea97282803cb311b9321a99bb627520ef5e35
Reviewed-on: https://gerrit.libreoffice.org/38861
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-06-16 09:58:13 +02:00
|
|
|
svl::Items<ATTR_BACKGROUND, ATTR_BACKGROUND,
|
2000-09-18 23:16:46 +00:00
|
|
|
ATTR_BORDER, ATTR_SHADOW,
|
|
|
|
ATTR_LRSPACE, ATTR_ULSPACE,
|
|
|
|
ATTR_PAGE_SIZE, ATTR_PAGE_SIZE,
|
Make SfxItemSet ranges correct by construction
This is a follow-up to 45a7f5b62d0b1b21763c1c94255ef2309ea4280b "Keep WID ranges
sorted, and join adjacent ones". While SfxItemSet::MergeRange relies on the
m_pWhichRanges being sorted (and, under DBG_UTIL, asserts if they are not), the
various SfxItemSet constructors curiously only check (via assert or DBG_ASSERT)
that each individual range has an upper bound not smaller than its lower bound.
Arguably, all SfxItemSet instances should fulfill the stronger guarantees
required and checked by MergeRange.
And in many cases the ranges are statically known, so that the checking can
happen at compile time. Therefore, replace the two SfxItemSet ctors taking
explicit ranges with two other ctors that actually do proper checking. The
(templated) overload taking an svl::Items struct should be used in all cases
where the range values are statically known at compile time, while the overload
taking a std::initializer_list<Pair> is for the remaining cases (that can only
do runtime checking via assert). Most of those latter cases are simple cases
with a single range covering a single item, but a few are more complex.
(At least some of the uses of the existing SfxItemSet overload taking a
const sal_uInt16* pWhichPairTable
can probably also be strengthened, but that is left for another day.)
This commit is the first in a series of two. Apart from the manual changes to
compilerplugins/clang/store/sfxitemsetrewrite.cxx, include/svl/itemset.hxx, and
svl/source/items/itemset.cxx, it only consists of automatic rewriting of the
relevant SfxItemSet ctor calls (plus a few required manual fixes, see next).
But it does not yet check that the individual ranges are properly sorted (see
the TODO in svl::detail::validGap). That check will be enabled, and the ensuing
manual fixes will be made in a follow-up commit, to reduce the likelyhood of
accidents.
There were three cases of necessary manual intervention:
* sw/source/core/unocore/unostyle.cxx uses eAtr of enum type RES_FRMATR in
braced-init-list syntax now, so needs explicit narrowing conversion to
sal_uInt16.
* In sw/source/uibase/uiview/formatclipboard.cxx, the trailiing comma in the
definition of macro FORMAT_PAINTBRUSH_FRAME_IDS needed to be removed manually.
* In svx/source/svdraw/svdoashp.cxx, svx/source/svdraw/svdotext.cxx,
sw/source/uibase/app/docstyle.cxx, sw/source/uibase/shells/frmsh.cxx,
sw/source/uibase/shells/grfsh.cxx, and sw/source/uibase/shells/textsh1.cxx,
some comments had to be put back (see "TODO: the replaced range can contain
relevant comments" in compilerplugins/clang/store/sfxitemsetrewrite.cxx).
A few uses of the variadic form erroneously used nullptr instead of 0 for
termination. But this should have been harmless even if promoted std::nullptr_t
is larger than promoted sal_uInt16, assuming that the part of the nullptr value
that was interpreted as sal_uInt16/promoted int was all-zero bits. Similarly,
some uses made the harmless error of using 0L instead of 0.
Change-Id: I2afea97282803cb311b9321a99bb627520ef5e35
Reviewed-on: https://gerrit.libreoffice.org/38861
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-06-16 09:58:13 +02:00
|
|
|
ATTR_PAGE_ON, ATTR_PAGE_SHARED>{} );
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2015-11-10 10:22:39 +01:00
|
|
|
pGlobalBorderInnerAttr->SetLine(nullptr, SvxBoxInfoItemLine::HORI);
|
|
|
|
pGlobalBorderInnerAttr->SetLine(nullptr, SvxBoxInfoItemLine::VERT);
|
2014-02-19 15:40:53 +02:00
|
|
|
pGlobalBorderInnerAttr->SetTable(true);
|
|
|
|
pGlobalBorderInnerAttr->SetDist(true);
|
2011-03-10 16:55:21 -05:00
|
|
|
pGlobalBorderInnerAttr->SetMinDist(false);
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2016-12-23 16:03:53 +02:00
|
|
|
mpPoolDefaults = new std::vector<SfxPoolItem*>(ATTR_ENDINDEX-ATTR_STARTINDEX+1);
|
|
|
|
std::vector<SfxPoolItem*>& rPoolDefaults = *mpPoolDefaults;
|
|
|
|
|
|
|
|
rPoolDefaults[ ATTR_FONT - ATTR_STARTINDEX ] = pStdFont;
|
|
|
|
rPoolDefaults[ ATTR_FONT_HEIGHT - ATTR_STARTINDEX ] = new SvxFontHeightItem( 200, 100, ATTR_FONT_HEIGHT ); // 10 pt;
|
|
|
|
rPoolDefaults[ ATTR_FONT_WEIGHT - ATTR_STARTINDEX ] = new SvxWeightItem( WEIGHT_NORMAL, ATTR_FONT_WEIGHT );
|
|
|
|
rPoolDefaults[ ATTR_FONT_POSTURE - ATTR_STARTINDEX ] = new SvxPostureItem( ITALIC_NONE, ATTR_FONT_POSTURE );
|
|
|
|
rPoolDefaults[ ATTR_FONT_UNDERLINE - ATTR_STARTINDEX ] = new SvxUnderlineItem( LINESTYLE_NONE, ATTR_FONT_UNDERLINE );
|
|
|
|
rPoolDefaults[ ATTR_FONT_OVERLINE - ATTR_STARTINDEX ] = new SvxOverlineItem( LINESTYLE_NONE, ATTR_FONT_OVERLINE );
|
|
|
|
rPoolDefaults[ ATTR_FONT_CROSSEDOUT - ATTR_STARTINDEX ] = new SvxCrossedOutItem( STRIKEOUT_NONE, ATTR_FONT_CROSSEDOUT );
|
|
|
|
rPoolDefaults[ ATTR_FONT_CONTOUR - ATTR_STARTINDEX ] = new SvxContourItem( false, ATTR_FONT_CONTOUR );
|
|
|
|
rPoolDefaults[ ATTR_FONT_SHADOWED - ATTR_STARTINDEX ] = new SvxShadowedItem( false, ATTR_FONT_SHADOWED );
|
|
|
|
rPoolDefaults[ ATTR_FONT_COLOR - ATTR_STARTINDEX ] = new SvxColorItem( Color(COL_AUTO), ATTR_FONT_COLOR );
|
2017-05-22 15:55:38 +02:00
|
|
|
rPoolDefaults[ ATTR_FONT_LANGUAGE - ATTR_STARTINDEX ] = new SvxLanguageItem( LANGUAGE_DONTKNOW, ATTR_FONT_LANGUAGE );
|
2016-12-23 16:03:53 +02:00
|
|
|
rPoolDefaults[ ATTR_CJK_FONT - ATTR_STARTINDEX ] = pCjkFont;
|
|
|
|
rPoolDefaults[ ATTR_CJK_FONT_HEIGHT - ATTR_STARTINDEX ] = new SvxFontHeightItem( 200, 100, ATTR_CJK_FONT_HEIGHT );
|
|
|
|
rPoolDefaults[ ATTR_CJK_FONT_WEIGHT - ATTR_STARTINDEX ] = new SvxWeightItem( WEIGHT_NORMAL, ATTR_CJK_FONT_WEIGHT );
|
|
|
|
rPoolDefaults[ ATTR_CJK_FONT_POSTURE- ATTR_STARTINDEX ] = new SvxPostureItem( ITALIC_NONE, ATTR_CJK_FONT_POSTURE );
|
2017-05-22 15:55:38 +02:00
|
|
|
rPoolDefaults[ ATTR_CJK_FONT_LANGUAGE-ATTR_STARTINDEX ] = new SvxLanguageItem( LANGUAGE_DONTKNOW, ATTR_CJK_FONT_LANGUAGE );
|
2016-12-23 16:03:53 +02:00
|
|
|
rPoolDefaults[ ATTR_CTL_FONT - ATTR_STARTINDEX ] = pCtlFont;
|
|
|
|
rPoolDefaults[ ATTR_CTL_FONT_HEIGHT - ATTR_STARTINDEX ] = new SvxFontHeightItem( 200, 100, ATTR_CTL_FONT_HEIGHT );
|
|
|
|
rPoolDefaults[ ATTR_CTL_FONT_WEIGHT - ATTR_STARTINDEX ] = new SvxWeightItem( WEIGHT_NORMAL, ATTR_CTL_FONT_WEIGHT );
|
|
|
|
rPoolDefaults[ ATTR_CTL_FONT_POSTURE- ATTR_STARTINDEX ] = new SvxPostureItem( ITALIC_NONE, ATTR_CTL_FONT_POSTURE );
|
2017-05-22 15:55:38 +02:00
|
|
|
rPoolDefaults[ ATTR_CTL_FONT_LANGUAGE-ATTR_STARTINDEX ] = new SvxLanguageItem( LANGUAGE_DONTKNOW, ATTR_CTL_FONT_LANGUAGE );
|
2016-12-23 16:03:53 +02:00
|
|
|
rPoolDefaults[ ATTR_FONT_EMPHASISMARK-ATTR_STARTINDEX ] = new SvxEmphasisMarkItem( FontEmphasisMark::NONE, ATTR_FONT_EMPHASISMARK );
|
|
|
|
rPoolDefaults[ ATTR_USERDEF - ATTR_STARTINDEX ] = new SvXMLAttrContainerItem( ATTR_USERDEF );
|
|
|
|
rPoolDefaults[ ATTR_FONT_WORDLINE - ATTR_STARTINDEX ] = new SvxWordLineModeItem(false, ATTR_FONT_WORDLINE );
|
|
|
|
rPoolDefaults[ ATTR_FONT_RELIEF - ATTR_STARTINDEX ] = new SvxCharReliefItem( FontRelief::NONE, ATTR_FONT_RELIEF );
|
|
|
|
rPoolDefaults[ ATTR_HYPHENATE - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_HYPHENATE );
|
|
|
|
rPoolDefaults[ ATTR_SCRIPTSPACE - ATTR_STARTINDEX ] = new SvxScriptSpaceItem( false, ATTR_SCRIPTSPACE);
|
|
|
|
rPoolDefaults[ ATTR_HANGPUNCTUATION - ATTR_STARTINDEX ] = new SvxHangingPunctuationItem( false, ATTR_HANGPUNCTUATION);
|
|
|
|
rPoolDefaults[ ATTR_FORBIDDEN_RULES - ATTR_STARTINDEX ] = new SvxForbiddenRuleItem( false, ATTR_FORBIDDEN_RULES);
|
2017-03-08 12:39:34 +02:00
|
|
|
rPoolDefaults[ ATTR_HOR_JUSTIFY - ATTR_STARTINDEX ] = new SvxHorJustifyItem( SvxCellHorJustify::Standard, ATTR_HOR_JUSTIFY);
|
2016-12-23 16:03:53 +02:00
|
|
|
rPoolDefaults[ ATTR_HOR_JUSTIFY_METHOD - ATTR_STARTINDEX ] = new SvxJustifyMethodItem( SvxCellJustifyMethod::Auto, ATTR_HOR_JUSTIFY_METHOD);
|
|
|
|
rPoolDefaults[ ATTR_INDENT - ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_INDENT, 0 );
|
|
|
|
rPoolDefaults[ ATTR_VER_JUSTIFY - ATTR_STARTINDEX ] = new SvxVerJustifyItem( SVX_VER_JUSTIFY_STANDARD, ATTR_VER_JUSTIFY);
|
|
|
|
rPoolDefaults[ ATTR_VER_JUSTIFY_METHOD - ATTR_STARTINDEX ] = new SvxJustifyMethodItem( SvxCellJustifyMethod::Auto, ATTR_VER_JUSTIFY_METHOD);
|
|
|
|
rPoolDefaults[ ATTR_STACKED - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_STACKED, false );
|
|
|
|
rPoolDefaults[ ATTR_ROTATE_VALUE - ATTR_STARTINDEX ] = new SfxInt32Item( ATTR_ROTATE_VALUE, 0 );
|
|
|
|
rPoolDefaults[ ATTR_ROTATE_MODE - ATTR_STARTINDEX ] = new SvxRotateModeItem( SVX_ROTATE_MODE_BOTTOM, ATTR_ROTATE_MODE );
|
|
|
|
rPoolDefaults[ ATTR_VERTICAL_ASIAN - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_VERTICAL_ASIAN );
|
2017-03-14 08:39:55 +02:00
|
|
|
// The default for the ATTR_WRITINGDIR cell attribute must by SvxFrameDirection::Environment,
|
2002-09-09 13:00:39 +00:00
|
|
|
// so that value is returned when asking for a default cell's attributes.
|
|
|
|
// The value from the page style is set as DefaultHorizontalTextDirection for the EditEngine.
|
2017-03-14 08:39:55 +02:00
|
|
|
rPoolDefaults[ ATTR_WRITINGDIR - ATTR_STARTINDEX ] = new SvxFrameDirectionItem( SvxFrameDirection::Environment, ATTR_WRITINGDIR );
|
2016-12-23 16:03:53 +02:00
|
|
|
rPoolDefaults[ ATTR_LINEBREAK - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_LINEBREAK );
|
|
|
|
rPoolDefaults[ ATTR_SHRINKTOFIT - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_SHRINKTOFIT );
|
|
|
|
rPoolDefaults[ ATTR_BORDER_TLBR - ATTR_STARTINDEX ] = new SvxLineItem( ATTR_BORDER_TLBR );
|
|
|
|
rPoolDefaults[ ATTR_BORDER_BLTR - ATTR_STARTINDEX ] = new SvxLineItem( ATTR_BORDER_BLTR );
|
|
|
|
rPoolDefaults[ ATTR_MARGIN - ATTR_STARTINDEX ] = new SvxMarginItem( ATTR_MARGIN );
|
|
|
|
rPoolDefaults[ ATTR_MERGE - ATTR_STARTINDEX ] = new ScMergeAttr;
|
|
|
|
rPoolDefaults[ ATTR_MERGE_FLAG - ATTR_STARTINDEX ] = new ScMergeFlagAttr;
|
|
|
|
rPoolDefaults[ ATTR_VALUE_FORMAT - ATTR_STARTINDEX ] = new SfxUInt32Item( ATTR_VALUE_FORMAT, 0 );
|
|
|
|
rPoolDefaults[ ATTR_LANGUAGE_FORMAT - ATTR_STARTINDEX ] = new SvxLanguageItem( ScGlobal::eLnge, ATTR_LANGUAGE_FORMAT );
|
|
|
|
rPoolDefaults[ ATTR_BACKGROUND - ATTR_STARTINDEX ] = new SvxBrushItem( Color(COL_TRANSPARENT), ATTR_BACKGROUND );
|
|
|
|
rPoolDefaults[ ATTR_PROTECTION - ATTR_STARTINDEX ] = new ScProtectionAttr;
|
|
|
|
rPoolDefaults[ ATTR_BORDER - ATTR_STARTINDEX ] = new SvxBoxItem( ATTR_BORDER );
|
|
|
|
rPoolDefaults[ ATTR_BORDER_INNER - ATTR_STARTINDEX ] = pGlobalBorderInnerAttr;
|
|
|
|
rPoolDefaults[ ATTR_SHADOW - ATTR_STARTINDEX ] = new SvxShadowItem( ATTR_SHADOW );
|
|
|
|
rPoolDefaults[ ATTR_VALIDDATA - ATTR_STARTINDEX ] = new SfxUInt32Item( ATTR_VALIDDATA, 0 );
|
|
|
|
rPoolDefaults[ ATTR_CONDITIONAL - ATTR_STARTINDEX ] = new ScCondFormatItem;
|
|
|
|
rPoolDefaults[ ATTR_HYPERLINK - ATTR_STARTINDEX ] = new SfxStringItem( ATTR_HYPERLINK, OUString() ) ;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2014-08-23 23:41:33 +02:00
|
|
|
// GetRscString only works after ScGlobal::Init (indicated by the EmptyBrushItem)
|
|
|
|
// TODO: Write additional method ScGlobal::IsInit() or somesuch
|
|
|
|
// or detect whether this is the Secondary Pool for a MessagePool
|
2000-09-18 23:16:46 +00:00
|
|
|
if ( ScGlobal::GetEmptyBrushItem() )
|
2017-06-13 10:46:16 +02:00
|
|
|
rPoolDefaults[ ATTR_PATTERN - ATTR_STARTINDEX ] = new ScPatternAttr( std::move(pSet), ScGlobal::GetRscString(STR_STYLENAME_STANDARD) );
|
2000-09-18 23:16:46 +00:00
|
|
|
else
|
2017-06-13 10:46:16 +02:00
|
|
|
rPoolDefaults[ ATTR_PATTERN - ATTR_STARTINDEX ] = new ScPatternAttr( std::move(pSet), STRING_STANDARD ); // FIXME: without name?
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2016-12-23 16:03:53 +02:00
|
|
|
rPoolDefaults[ ATTR_LRSPACE - ATTR_STARTINDEX ] = new SvxLRSpaceItem( ATTR_LRSPACE );
|
|
|
|
rPoolDefaults[ ATTR_ULSPACE - ATTR_STARTINDEX ] = new SvxULSpaceItem( ATTR_ULSPACE );
|
|
|
|
rPoolDefaults[ ATTR_PAGE - ATTR_STARTINDEX ] = new SvxPageItem( ATTR_PAGE );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_PAPERTRAY - ATTR_STARTINDEX ] = new SfxAllEnumItem( ATTR_PAGE_PAPERTRAY );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_PAPERBIN - ATTR_STARTINDEX ] = new SvxPaperBinItem( ATTR_PAGE_PAPERBIN );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_SIZE - ATTR_STARTINDEX ] = new SvxSizeItem( ATTR_PAGE_SIZE );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_MAXSIZE - ATTR_STARTINDEX ] = new SvxSizeItem( ATTR_PAGE_MAXSIZE );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_HORCENTER - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_HORCENTER );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_VERCENTER - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_VERCENTER );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_ON - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_ON, true );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_DYNAMIC - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_DYNAMIC, true );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_SHARED - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_SHARED, true );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_NOTES - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_NOTES, false );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_GRID - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_GRID, false );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_HEADERS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_HEADERS, false );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_CHARTS - ATTR_STARTINDEX ] = new ScViewObjectModeItem( ATTR_PAGE_CHARTS );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_OBJECTS - ATTR_STARTINDEX ] = new ScViewObjectModeItem( ATTR_PAGE_OBJECTS );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_DRAWINGS - ATTR_STARTINDEX ] = new ScViewObjectModeItem( ATTR_PAGE_DRAWINGS );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_TOPDOWN - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_TOPDOWN, true );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_SCALE - ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_PAGE_SCALE, 100 );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_SCALETOPAGES-ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_PAGE_SCALETOPAGES, 1 );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_FIRSTPAGENO- ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_PAGE_FIRSTPAGENO, 1 );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_PRINTAREA - ATTR_STARTINDEX ] = new ScRangeItem( ATTR_PAGE_PRINTAREA );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_REPEATROW - ATTR_STARTINDEX ] = new ScRangeItem( ATTR_PAGE_REPEATROW );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_REPEATCOL - ATTR_STARTINDEX ] = new ScRangeItem( ATTR_PAGE_REPEATCOL );
|
2017-04-04 11:57:23 +02:00
|
|
|
rPoolDefaults[ ATTR_PAGE_PRINTTABLES- ATTR_STARTINDEX ] = new ScTableListItem;
|
2016-12-23 16:03:53 +02:00
|
|
|
rPoolDefaults[ ATTR_PAGE_HEADERLEFT - ATTR_STARTINDEX ] = new ScPageHFItem( ATTR_PAGE_HEADERLEFT );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_FOOTERLEFT - ATTR_STARTINDEX ] = new ScPageHFItem( ATTR_PAGE_FOOTERLEFT );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_HEADERRIGHT- ATTR_STARTINDEX ] = new ScPageHFItem( ATTR_PAGE_HEADERRIGHT );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_FOOTERRIGHT- ATTR_STARTINDEX ] = new ScPageHFItem( ATTR_PAGE_FOOTERRIGHT );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_HEADERSET - ATTR_STARTINDEX ] = new SvxSetItem( ATTR_PAGE_HEADERSET, aSetItemItemSet );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_FOOTERSET - ATTR_STARTINDEX ] = new SvxSetItem( ATTR_PAGE_FOOTERSET, aSetItemItemSet );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_FORMULAS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_FORMULAS, false );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_NULLVALS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_NULLVALS, true );
|
|
|
|
rPoolDefaults[ ATTR_PAGE_SCALETO - ATTR_STARTINDEX ] = new ScPageScaleToItem( 1, 1 );
|
|
|
|
rPoolDefaults[ ATTR_HIDDEN - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_HIDDEN, false );
|
|
|
|
|
|
|
|
SetDefaults( mpPoolDefaults );
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2014-08-23 23:41:33 +02:00
|
|
|
// ATTR_LANGUAGE_FORMAT from sv329 inserted, VersionMap in _ScGlobal__Init
|
2000-09-18 23:16:46 +00:00
|
|
|
SetVersionMap( 1, 100, 157, pVersionMap1 );
|
|
|
|
|
2014-08-23 23:41:33 +02:00
|
|
|
// ATTR_VALIDDATA, ATTR_CONDITIONAL from 341
|
2000-09-18 23:16:46 +00:00
|
|
|
SetVersionMap( 2, 100, 158, pVersionMap2 );
|
|
|
|
|
2014-08-23 23:41:33 +02:00
|
|
|
// ATTR_INDENT from 350
|
2000-09-18 23:16:46 +00:00
|
|
|
SetVersionMap( 3, 100, 160, pVersionMap3 );
|
|
|
|
|
2014-08-23 23:41:33 +02:00
|
|
|
// ATTR_ROTATE_VALUE, ATTR_ROTATE_MODE from 367
|
2000-09-18 23:16:46 +00:00
|
|
|
SetVersionMap( 4, 100, 161, pVersionMap4 );
|
2000-11-23 19:08:02 +00:00
|
|
|
|
|
|
|
// CJK, CTL, EMPHASISMARK, TWOLINES from 614
|
|
|
|
SetVersionMap( 5, 100, 163, pVersionMap5 );
|
2000-11-30 17:17:45 +00:00
|
|
|
|
|
|
|
// ATTR_SCRIPTSPACE, ATTR_HANGPUNCTUATION, ATTR_FORBIDDEN_RULES from 614d
|
|
|
|
SetVersionMap( 6, 100, 175, pVersionMap6 );
|
2001-05-16 14:17:35 +00:00
|
|
|
|
|
|
|
// ATTR_FONT_WORDLINE, ATTR_FONT_RELIEF, ATTR_HYPHENATE from 632b
|
|
|
|
SetVersionMap( 7, 100, 178, pVersionMap7 );
|
2002-04-03 09:10:59 +00:00
|
|
|
|
|
|
|
// ATTR_VERTICAL_ASIAN from 642q
|
|
|
|
SetVersionMap( 8, 100, 181, pVersionMap8 );
|
2002-09-09 13:00:39 +00:00
|
|
|
|
|
|
|
// ATTR_WRITINGDIR from 643y
|
|
|
|
SetVersionMap( 9, 100, 182, pVersionMap9 );
|
2004-08-02 15:54:35 +00:00
|
|
|
|
2009-01-05 17:49:45 +00:00
|
|
|
// ATTR_PAGE_SCALETO added in 680/sab008
|
|
|
|
// new version map not required
|
|
|
|
|
2004-08-02 15:54:35 +00:00
|
|
|
// ATTR_SHRINKTOFIT, ATTR_BORDER_TL_BR, ATTR_BORDER_BL_TR added in 680/dr14
|
2009-01-05 17:49:45 +00:00
|
|
|
SetVersionMap( 10, 100, 184, pVersionMap10 );
|
|
|
|
|
|
|
|
// ATTR_FONT_OVERLINE added in DEV300/overline2
|
|
|
|
SetVersionMap( 11, 100, 187, pVersionMap11 );
|
2013-01-08 10:56:44 +00:00
|
|
|
// ATTR_HYERLINK added
|
|
|
|
SetVersionMap( 12, 100, 192, pVersionMap12 );
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
|
2010-12-11 23:25:30 +01:00
|
|
|
ScDocumentPool::~ScDocumentPool()
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
|
|
|
Delete();
|
|
|
|
|
2011-01-17 13:20:22 +01:00
|
|
|
for ( sal_uInt16 i=0; i < ATTR_ENDINDEX-ATTR_STARTINDEX+1; i++ )
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2017-04-04 14:13:00 +02:00
|
|
|
ClearRefCount( *(*mpPoolDefaults)[i] );
|
2016-12-23 16:03:53 +02:00
|
|
|
delete (*mpPoolDefaults)[i];
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
|
2016-12-23 16:03:53 +02:00
|
|
|
delete mpPoolDefaults;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ScDocumentPool::InitVersionMaps()
|
|
|
|
{
|
2011-05-21 13:29:51 +02:00
|
|
|
OSL_PRECOND( !pVersionMap1 && !pVersionMap2 &&
|
2000-11-23 19:08:02 +00:00
|
|
|
!pVersionMap3 && !pVersionMap4 &&
|
2001-05-16 14:17:35 +00:00
|
|
|
!pVersionMap5 && !pVersionMap6 &&
|
2002-09-09 13:00:39 +00:00
|
|
|
!pVersionMap7 && !pVersionMap8 &&
|
2009-01-05 17:49:45 +00:00
|
|
|
!pVersionMap9 && !pVersionMap10 &&
|
2013-01-08 10:56:44 +00:00
|
|
|
!pVersionMap11 && !pVersionMap12 , "InitVersionMaps call multiple times" );
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2014-08-23 23:41:33 +02:00
|
|
|
// Map old WhichId's
|
|
|
|
// Do not count with ATTR_*, if they change again
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2014-08-23 23:41:33 +02:00
|
|
|
// First Map: ATTR_LANGUAGE_FORMAT from sv329 inserted
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2014-08-23 23:41:33 +02:00
|
|
|
const sal_uInt16 nMap1Start = 100; // Old ATTR_STARTINDEX
|
|
|
|
const sal_uInt16 nMap1End = 157; // Old ATTR_ENDINDEX
|
2011-01-17 13:20:22 +01:00
|
|
|
const sal_uInt16 nMap1Count = nMap1End - nMap1Start + 1;
|
|
|
|
const sal_uInt16 nMap1New = 18; // ATTR_LANGUAGE_FORMAT - ATTR_STARTINDEX
|
|
|
|
pVersionMap1 = new sal_uInt16 [ nMap1Count ];
|
|
|
|
sal_uInt16 i, j;
|
2000-09-18 23:16:46 +00:00
|
|
|
for ( i=0, j=nMap1Start; i < nMap1New; i++, j++ )
|
|
|
|
pVersionMap1[i] = j;
|
2014-08-23 23:41:33 +02:00
|
|
|
// An entry inserted ...
|
2000-09-18 23:16:46 +00:00
|
|
|
for ( i=nMap1New, j=nMap1Start+nMap1New+1; i < nMap1Count; i++, j++ )
|
|
|
|
pVersionMap1[i] = j;
|
|
|
|
|
2014-08-23 23:41:33 +02:00
|
|
|
// Second Map: ATTR_VALIDDATA and ATTR_CONDITIONAL from 341 inserted
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2011-01-17 13:20:22 +01:00
|
|
|
const sal_uInt16 nMap2Start = 100; // ATTR_STARTINDEX
|
|
|
|
const sal_uInt16 nMap2End = 158; // ATTR_ENDINDEX
|
|
|
|
const sal_uInt16 nMap2Count = nMap2End - nMap2Start + 1;
|
|
|
|
const sal_uInt16 nMap2New = 24; // ATTR_VALIDDATA - ATTR_STARTINDEX
|
|
|
|
pVersionMap2 = new sal_uInt16 [ nMap2Count ];
|
2000-09-18 23:16:46 +00:00
|
|
|
for ( i=0, j=nMap2Start; i < nMap2New; i++, j++ )
|
|
|
|
pVersionMap2[i] = j;
|
2015-03-03 23:19:24 +01:00
|
|
|
// Two entries inserted ...
|
2000-09-18 23:16:46 +00:00
|
|
|
for ( i=nMap2New, j=nMap2Start+nMap2New+2; i < nMap2Count; i++, j++ )
|
|
|
|
pVersionMap2[i] = j;
|
|
|
|
|
2015-03-03 23:19:24 +01:00
|
|
|
// Third Map: ATTR_INDENT from 350 inserted
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2011-01-17 13:20:22 +01:00
|
|
|
const sal_uInt16 nMap3Start = 100; // ATTR_STARTINDEX
|
|
|
|
const sal_uInt16 nMap3End = 160; // ATTR_ENDINDEX
|
|
|
|
const sal_uInt16 nMap3Count = nMap3End - nMap3Start + 1;
|
|
|
|
const sal_uInt16 nMap3New = 11; // ATTR_INDENT - ATTR_STARTINDEX
|
|
|
|
pVersionMap3 = new sal_uInt16 [ nMap3Count ];
|
2000-09-18 23:16:46 +00:00
|
|
|
for ( i=0, j=nMap3Start; i < nMap3New; i++, j++ )
|
|
|
|
pVersionMap3[i] = j;
|
2016-01-09 22:55:28 +01:00
|
|
|
// An entry inserted...
|
2000-09-18 23:16:46 +00:00
|
|
|
for ( i=nMap3New, j=nMap3Start+nMap3New+1; i < nMap3Count; i++, j++ )
|
|
|
|
pVersionMap3[i] = j;
|
|
|
|
|
2014-08-23 23:41:33 +02:00
|
|
|
// Fourth Map: ATTR_ROTATE_VALUE and ATTR_ROTATE_MODE from 367 inserted
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2011-01-17 13:20:22 +01:00
|
|
|
const sal_uInt16 nMap4Start = 100; // ATTR_STARTINDEX
|
|
|
|
const sal_uInt16 nMap4End = 161; // ATTR_ENDINDEX
|
|
|
|
const sal_uInt16 nMap4Count = nMap4End - nMap4Start + 1;
|
|
|
|
const sal_uInt16 nMap4New = 14; // ATTR_ROTATE_VALUE - ATTR_STARTINDEX
|
|
|
|
pVersionMap4 = new sal_uInt16 [ nMap4Count ];
|
2000-09-18 23:16:46 +00:00
|
|
|
for ( i=0, j=nMap4Start; i < nMap4New; i++, j++ )
|
|
|
|
pVersionMap4[i] = j;
|
2014-08-23 23:41:33 +02:00
|
|
|
// Two entries inserted ...
|
2000-09-18 23:16:46 +00:00
|
|
|
for ( i=nMap4New, j=nMap4Start+nMap4New+2; i < nMap4Count; i++, j++ )
|
|
|
|
pVersionMap4[i] = j;
|
2000-11-23 19:08:02 +00:00
|
|
|
|
2014-08-23 23:41:33 +02:00
|
|
|
// fifth map: CJK..., CTL..., EMPHASISMARK, TWOLINES (12 items) added in 614
|
2000-11-23 19:08:02 +00:00
|
|
|
|
2011-01-17 13:20:22 +01:00
|
|
|
const sal_uInt16 nMap5Start = 100; // ATTR_STARTINDEX
|
|
|
|
const sal_uInt16 nMap5End = 163; // ATTR_ENDINDEX
|
|
|
|
const sal_uInt16 nMap5Count = nMap5End - nMap5Start + 1;
|
|
|
|
const sal_uInt16 nMap5New = 10; // ATTR_CJK_FONT - ATTR_STARTINDEX
|
|
|
|
pVersionMap5 = new sal_uInt16 [ nMap5Count ];
|
2000-11-23 19:08:02 +00:00
|
|
|
for ( i=0, j=nMap5Start; i < nMap5New; i++, j++ )
|
|
|
|
pVersionMap5[i] = j;
|
|
|
|
// 12 entries inserted
|
|
|
|
for ( i=nMap5New, j=nMap5Start+nMap5New+12; i < nMap5Count; i++, j++ )
|
|
|
|
pVersionMap5[i] = j;
|
2000-11-30 17:17:45 +00:00
|
|
|
|
|
|
|
// sixth map: ATTR_SCRIPTSPACE, ATTR_HANGPUNCTUATION, ATTR_FORBIDDEN_RULES added in 614d
|
|
|
|
|
2011-01-17 13:20:22 +01:00
|
|
|
const sal_uInt16 nMap6Start = 100; // ATTR_STARTINDEX
|
|
|
|
const sal_uInt16 nMap6End = 175; // ATTR_ENDINDEX
|
|
|
|
const sal_uInt16 nMap6Count = nMap6End - nMap6Start + 1;
|
|
|
|
const sal_uInt16 nMap6New = 22; // ATTR_SCRIPTSPACE - ATTR_STARTINDEX
|
|
|
|
pVersionMap6 = new sal_uInt16 [ nMap6Count ];
|
2000-11-30 17:17:45 +00:00
|
|
|
for ( i=0, j=nMap6Start; i < nMap6New; i++, j++ )
|
|
|
|
pVersionMap6[i] = j;
|
|
|
|
// 3 entries inserted
|
|
|
|
for ( i=nMap6New, j=nMap6Start+nMap6New+3; i < nMap6Count; i++, j++ )
|
|
|
|
pVersionMap6[i] = j;
|
2001-05-16 14:17:35 +00:00
|
|
|
|
2014-08-23 23:41:33 +02:00
|
|
|
// seventh map: ATTR_FONT_WORDLINE, ATTR_FONT_RELIEF, ATTR_HYPHENATE added in 632b
|
2001-05-16 14:17:35 +00:00
|
|
|
|
2011-01-17 13:20:22 +01:00
|
|
|
const sal_uInt16 nMap7Start = 100; // ATTR_STARTINDEX
|
|
|
|
const sal_uInt16 nMap7End = 178; // ATTR_ENDINDEX
|
|
|
|
const sal_uInt16 nMap7Count = nMap7End - nMap7Start + 1;
|
|
|
|
const sal_uInt16 nMap7New = 22; // ATTR_FONT_WORDLINE - ATTR_STARTINDEX
|
|
|
|
pVersionMap7 = new sal_uInt16 [ nMap7Count ];
|
2001-05-16 14:17:35 +00:00
|
|
|
for ( i=0, j=nMap7Start; i < nMap7New; i++, j++ )
|
|
|
|
pVersionMap7[i] = j;
|
|
|
|
// 3 entries inserted
|
|
|
|
for ( i=nMap7New, j=nMap7Start+nMap7New+3; i < nMap7Count; i++, j++ )
|
|
|
|
pVersionMap7[i] = j;
|
2002-04-03 09:10:59 +00:00
|
|
|
|
2014-08-23 23:41:33 +02:00
|
|
|
// eighth map: ATTR_VERTICAL_ASIAN added in 642q
|
2002-04-03 09:10:59 +00:00
|
|
|
|
2011-01-17 13:20:22 +01:00
|
|
|
const sal_uInt16 nMap8Start = 100; // ATTR_STARTINDEX
|
|
|
|
const sal_uInt16 nMap8End = 181; // ATTR_ENDINDEX
|
|
|
|
const sal_uInt16 nMap8Count = nMap8End - nMap8Start + 1;
|
|
|
|
const sal_uInt16 nMap8New = 34; // ATTR_VERTICAL_ASIAN - ATTR_STARTINDEX
|
|
|
|
pVersionMap8 = new sal_uInt16 [ nMap8Count ];
|
2002-04-03 09:10:59 +00:00
|
|
|
for ( i=0, j=nMap8Start; i < nMap8New; i++, j++ )
|
|
|
|
pVersionMap8[i] = j;
|
|
|
|
// 1 entry inserted
|
|
|
|
for ( i=nMap8New, j=nMap8Start+nMap8New+1; i < nMap8Count; i++, j++ )
|
|
|
|
pVersionMap8[i] = j;
|
2002-09-09 13:00:39 +00:00
|
|
|
|
2014-08-23 23:41:33 +02:00
|
|
|
// 9th map: ATTR_WRITINGDIR added in 643y
|
2002-09-09 13:00:39 +00:00
|
|
|
|
2011-01-17 13:20:22 +01:00
|
|
|
const sal_uInt16 nMap9Start = 100; // ATTR_STARTINDEX
|
|
|
|
const sal_uInt16 nMap9End = 182; // ATTR_ENDINDEX
|
|
|
|
const sal_uInt16 nMap9Count = nMap9End - nMap9Start + 1;
|
|
|
|
const sal_uInt16 nMap9New = 35; // ATTR_WRITINGDIR - ATTR_STARTINDEX
|
|
|
|
pVersionMap9 = new sal_uInt16 [ nMap9Count ];
|
2002-09-09 13:00:39 +00:00
|
|
|
for ( i=0, j=nMap9Start; i < nMap9New; i++, j++ )
|
|
|
|
pVersionMap9[i] = j;
|
|
|
|
// 1 entry inserted
|
|
|
|
for ( i=nMap9New, j=nMap9Start+nMap9New+1; i < nMap9Count; i++, j++ )
|
|
|
|
pVersionMap9[i] = j;
|
2004-08-02 15:54:35 +00:00
|
|
|
|
2009-01-05 17:49:45 +00:00
|
|
|
// ATTR_PAGE_SCALETO added in 680/sab008
|
|
|
|
|
2004-08-02 15:54:35 +00:00
|
|
|
// 10th map: ATTR_SHRINKTOFIT, ATTR_BORDER_TL_BR, ATTR_BORDER_BL_TR added in 680/dr14
|
|
|
|
|
2011-01-17 13:20:22 +01:00
|
|
|
const sal_uInt16 nMap10Start = 100; // ATTR_STARTINDEX
|
|
|
|
const sal_uInt16 nMap10End = 184; // ATTR_ENDINDEX
|
|
|
|
const sal_uInt16 nMap10Count = nMap10End - nMap10Start + 1;
|
|
|
|
const sal_uInt16 nMap10New = 37; // ATTR_SHRINKTOFIT - ATTR_STARTINDEX
|
|
|
|
pVersionMap10 = new sal_uInt16 [ nMap10Count ];
|
2004-08-02 15:54:35 +00:00
|
|
|
for ( i=0, j=nMap10Start; i < nMap10New; i++, j++ )
|
|
|
|
pVersionMap10[i] = j;
|
|
|
|
// 3 entries inserted
|
|
|
|
for ( i=nMap10New, j=nMap10Start+nMap10New+3; i < nMap10Count; i++, j++ )
|
|
|
|
pVersionMap10[i] = j;
|
2009-01-05 17:49:45 +00:00
|
|
|
|
|
|
|
// 11th map: ATTR_FONT_OVERLINE added in DEV300/overline2
|
|
|
|
|
2011-01-17 13:20:22 +01:00
|
|
|
const sal_uInt16 nMap11Start = 100; // ATTR_STARTINDEX
|
|
|
|
const sal_uInt16 nMap11End = 187; // ATTR_ENDINDEX
|
|
|
|
const sal_uInt16 nMap11Count = nMap11End - nMap11Start + 1;
|
|
|
|
const sal_uInt16 nMap11New = 5; // ATTR_FONT_OVERLINE - ATTR_STARTINDEX
|
|
|
|
pVersionMap11 = new sal_uInt16 [ nMap11Count ];
|
2009-01-05 17:49:45 +00:00
|
|
|
for ( i=0, j=nMap11Start; i < nMap11New; i++, j++ )
|
|
|
|
pVersionMap11[i] = j;
|
|
|
|
// 1 entry inserted
|
|
|
|
for ( i=nMap11New, j=nMap11Start+nMap11New+1; i < nMap11Count; i++, j++ )
|
|
|
|
pVersionMap11[i] = j;
|
2013-01-08 10:56:44 +00:00
|
|
|
|
|
|
|
const sal_uInt16 nMap12Start = 100; // ATTR_STARTINDEX
|
|
|
|
const sal_uInt16 nMap12End = 192; // ATTR_ENDINDEX
|
|
|
|
const sal_uInt16 nMap12Count = nMap12End - nMap12Start + 1;
|
|
|
|
const sal_uInt16 nMap12New = 55; // ATTR_HYPERLINK - ATTR_STARTINDEX
|
|
|
|
pVersionMap12 = new sal_uInt16 [ nMap12Count ];
|
|
|
|
for ( i=0, j=nMap12Start; i < nMap12New; i++, j++ )
|
|
|
|
pVersionMap12[i] = j;
|
|
|
|
// 1 entry inserted
|
|
|
|
for ( i=nMap12New, j=nMap12Start+nMap12New+1; i < nMap12Count; i++, j++ )
|
|
|
|
pVersionMap12[i] = j;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ScDocumentPool::DeleteVersionMaps()
|
|
|
|
{
|
2011-05-21 13:29:51 +02:00
|
|
|
OSL_PRECOND( pVersionMap1 && pVersionMap2 &&
|
2000-11-23 19:08:02 +00:00
|
|
|
pVersionMap3 && pVersionMap4 &&
|
2001-05-16 14:17:35 +00:00
|
|
|
pVersionMap5 && pVersionMap6 &&
|
2002-09-09 13:00:39 +00:00
|
|
|
pVersionMap7 && pVersionMap8 &&
|
2009-01-05 17:49:45 +00:00
|
|
|
pVersionMap9 && pVersionMap10 &&
|
2013-01-08 10:56:44 +00:00
|
|
|
pVersionMap11 && pVersionMap12 , "DeleteVersionMaps without maps" );
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2013-01-08 10:56:44 +00:00
|
|
|
delete[] pVersionMap12;
|
2015-11-10 10:22:39 +01:00
|
|
|
pVersionMap12 = nullptr;
|
2009-01-05 17:49:45 +00:00
|
|
|
delete[] pVersionMap11;
|
2015-11-10 10:22:39 +01:00
|
|
|
pVersionMap11 = nullptr;
|
2004-08-02 15:54:35 +00:00
|
|
|
delete[] pVersionMap10;
|
2015-11-10 10:22:39 +01:00
|
|
|
pVersionMap10 = nullptr;
|
2002-09-09 13:00:39 +00:00
|
|
|
delete[] pVersionMap9;
|
2015-11-10 10:22:39 +01:00
|
|
|
pVersionMap9 = nullptr;
|
2002-04-03 09:10:59 +00:00
|
|
|
delete[] pVersionMap8;
|
2015-11-10 10:22:39 +01:00
|
|
|
pVersionMap8 = nullptr;
|
2001-05-16 14:17:35 +00:00
|
|
|
delete[] pVersionMap7;
|
2015-11-10 10:22:39 +01:00
|
|
|
pVersionMap7 = nullptr;
|
2000-11-30 17:17:45 +00:00
|
|
|
delete[] pVersionMap6;
|
2015-11-10 10:22:39 +01:00
|
|
|
pVersionMap6 = nullptr;
|
2000-11-23 19:08:02 +00:00
|
|
|
delete[] pVersionMap5;
|
2015-11-10 10:22:39 +01:00
|
|
|
pVersionMap5 = nullptr;
|
2000-09-18 23:16:46 +00:00
|
|
|
delete[] pVersionMap4;
|
2015-11-10 10:22:39 +01:00
|
|
|
pVersionMap4 = nullptr;
|
2000-09-18 23:16:46 +00:00
|
|
|
delete[] pVersionMap3;
|
2015-11-10 10:22:39 +01:00
|
|
|
pVersionMap3 = nullptr;
|
2000-09-18 23:16:46 +00:00
|
|
|
delete[] pVersionMap2;
|
2015-11-10 10:22:39 +01:00
|
|
|
pVersionMap2 = nullptr;
|
2000-09-18 23:16:46 +00:00
|
|
|
delete[] pVersionMap1;
|
2015-11-10 10:22:39 +01:00
|
|
|
pVersionMap1 = nullptr;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
|
2011-03-10 16:55:21 -05:00
|
|
|
const SfxPoolItem& ScDocumentPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich )
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2014-08-23 23:41:33 +02:00
|
|
|
if ( rItem.Which() != ATTR_PATTERN ) // Only Pattern is special
|
2000-09-18 23:16:46 +00:00
|
|
|
return SfxItemPool::Put( rItem, nWhich );
|
|
|
|
|
2014-08-23 23:41:33 +02:00
|
|
|
// Don't copy the default pattern of this Pool
|
2016-12-23 16:03:53 +02:00
|
|
|
if (&rItem == (*mpPoolDefaults)[ ATTR_PATTERN - ATTR_STARTINDEX ])
|
2000-09-18 23:16:46 +00:00
|
|
|
return rItem;
|
|
|
|
|
2014-08-23 23:41:33 +02:00
|
|
|
// Else Put must always happen, because it could be another Pool
|
2000-09-18 23:16:46 +00:00
|
|
|
const SfxPoolItem& rNew = SfxItemPool::Put( rItem, nWhich );
|
2016-10-28 21:45:06 +02:00
|
|
|
sal_uInt32 nRef = rNew.GetRefCount();
|
2016-09-24 20:41:52 +02:00
|
|
|
if (nRef == 1)
|
|
|
|
{
|
|
|
|
++mnCurrentMaxKey;
|
|
|
|
const_cast<ScPatternAttr&>(static_cast<const ScPatternAttr&>(rNew)).SetKey(mnCurrentMaxKey);
|
|
|
|
}
|
2000-09-18 23:16:46 +00:00
|
|
|
return rNew;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScDocumentPool::StyleDeleted( ScStyleSheet* pStyle )
|
|
|
|
{
|
2010-10-18 22:00:21 +02:00
|
|
|
sal_uInt32 nCount = GetItemCount2(ATTR_PATTERN);
|
|
|
|
for (sal_uInt32 i=0; i<nCount; i++)
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2014-10-22 12:03:38 +02:00
|
|
|
ScPatternAttr* pPattern = const_cast<ScPatternAttr*>(static_cast<const ScPatternAttr*>(GetItem2(ATTR_PATTERN, i)));
|
2000-09-18 23:16:46 +00:00
|
|
|
if ( pPattern && pPattern->GetStyleSheet() == pStyle )
|
|
|
|
pPattern->StyleToName();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-04 00:14:59 +02:00
|
|
|
void ScDocumentPool::CellStyleCreated( const OUString& rName, ScDocument* pDoc )
|
2010-06-23 12:03:27 +02:00
|
|
|
{
|
|
|
|
// If a style was created, don't keep any pattern with its name string in the pool,
|
|
|
|
// because it would compare equal to a pattern with a pointer to the new style.
|
|
|
|
// Calling StyleSheetChanged isn't enough because the pool may still contain items
|
|
|
|
// for undo or clipboard content.
|
|
|
|
|
2010-10-21 23:25:11 +02:00
|
|
|
sal_uInt32 nCount = GetItemCount2(ATTR_PATTERN);
|
|
|
|
for (sal_uInt32 i=0; i<nCount; i++)
|
2010-06-23 12:03:27 +02:00
|
|
|
{
|
2010-10-23 15:48:00 +02:00
|
|
|
ScPatternAttr *const pPattern =
|
|
|
|
const_cast<ScPatternAttr*>(
|
|
|
|
static_cast<ScPatternAttr const*>(GetItem2(ATTR_PATTERN, i)));
|
2015-11-10 10:22:39 +01:00
|
|
|
if ( pPattern && pPattern->GetStyleSheet() == nullptr )
|
2010-06-23 12:03:27 +02:00
|
|
|
{
|
2013-07-05 16:25:03 -05:00
|
|
|
const OUString* pStyleName = pPattern->GetStyleName();
|
2010-06-23 12:03:27 +02:00
|
|
|
if ( pStyleName && *pStyleName == rName )
|
2014-09-04 00:14:59 +02:00
|
|
|
pPattern->UpdateStyleSheet(pDoc); // find and store style pointer
|
2010-06-23 12:03:27 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-11 23:25:30 +01:00
|
|
|
SfxItemPool* ScDocumentPool::Clone() const
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2014-02-19 21:49:02 +01:00
|
|
|
return new SfxItemPool (*this, true);
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
|
2014-07-24 11:31:39 +02:00
|
|
|
static bool lcl_HFPresentation
|
2000-09-18 23:16:46 +00:00
|
|
|
(
|
|
|
|
const SfxPoolItem& rItem,
|
2016-08-19 09:31:35 +01:00
|
|
|
MapUnit eCoreMetric,
|
|
|
|
MapUnit ePresentationMetric,
|
2013-01-23 12:41:52 +01:00
|
|
|
OUString& rText,
|
2001-05-13 02:33:31 +00:00
|
|
|
const IntlWrapper* pIntl
|
2000-09-18 23:16:46 +00:00
|
|
|
)
|
|
|
|
{
|
2014-10-22 12:03:38 +02:00
|
|
|
const SfxItemSet& rSet = static_cast<const SfxSetItem&>(rItem).GetItemSet();
|
2000-09-18 23:16:46 +00:00
|
|
|
const SfxPoolItem* pItem;
|
|
|
|
|
2014-09-10 17:53:41 +02:00
|
|
|
if ( SfxItemState::SET == rSet.GetItemState(ATTR_PAGE_ON,false,&pItem) )
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2015-04-27 15:28:46 +02:00
|
|
|
if( !static_cast<const SfxBoolItem*>(pItem)->GetValue() )
|
2014-07-24 11:31:39 +02:00
|
|
|
return false;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SfxItemIter aIter( rSet );
|
|
|
|
pItem = aIter.FirstItem();
|
2013-01-23 12:41:52 +01:00
|
|
|
OUString aText;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
while( pItem )
|
|
|
|
{
|
2011-01-17 13:20:22 +01:00
|
|
|
sal_uInt16 nWhich = pItem->Which();
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2014-12-18 13:29:00 +01:00
|
|
|
aText.clear();
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
switch( nWhich )
|
|
|
|
{
|
|
|
|
case ATTR_PAGE_ON:
|
|
|
|
case ATTR_PAGE_DYNAMIC:
|
|
|
|
case ATTR_PAGE_SHARED:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ATTR_LRSPACE:
|
|
|
|
{
|
2014-10-22 12:03:38 +02:00
|
|
|
const SvxLRSpaceItem& rLRItem = static_cast<const SvxLRSpaceItem&>(*pItem);
|
2011-01-17 13:20:22 +01:00
|
|
|
sal_uInt16 nPropLeftMargin = rLRItem.GetPropLeft();
|
|
|
|
sal_uInt16 nPropRightMargin = rLRItem.GetPropRight();
|
|
|
|
sal_uInt16 nLeftMargin, nRightMargin;
|
2000-09-18 23:16:46 +00:00
|
|
|
long nTmp;
|
|
|
|
nTmp = rLRItem.GetLeft();
|
2011-01-17 13:20:22 +01:00
|
|
|
nLeftMargin = nTmp < 0 ? 0 : sal_uInt16(nTmp);
|
2000-09-18 23:16:46 +00:00
|
|
|
nTmp = rLRItem.GetRight();
|
2011-01-17 13:20:22 +01:00
|
|
|
nRightMargin = nTmp < 0 ? 0 : sal_uInt16(nTmp);
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2017-03-17 16:09:35 +01:00
|
|
|
aText = EditResId::GetString(RID_SVXITEMS_LRSPACE_LEFT);
|
2000-09-18 23:16:46 +00:00
|
|
|
if ( 100 != nPropLeftMargin )
|
|
|
|
{
|
2014-01-20 13:55:03 +00:00
|
|
|
aText = aText + unicode::formatPercent(nPropLeftMargin,
|
|
|
|
Application::GetSettings().GetUILanguageTag());
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
aText += GetMetricText( (long)nLeftMargin,
|
2003-04-04 16:56:48 +00:00
|
|
|
eCoreMetric, ePresentationMetric, pIntl );
|
2017-03-17 16:09:35 +01:00
|
|
|
aText += " " + EditResId::GetString(GetMetricId(ePresentationMetric));
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
aText += cpDelim;
|
|
|
|
|
2014-08-23 23:41:33 +02:00
|
|
|
// We don't have a nPropFirstLineOfst
|
2017-03-17 16:09:35 +01:00
|
|
|
aText += EditResId::GetString(RID_SVXITEMS_LRSPACE_RIGHT);
|
2000-09-18 23:16:46 +00:00
|
|
|
if ( 100 != nPropRightMargin )
|
|
|
|
{
|
2014-01-20 13:55:03 +00:00
|
|
|
aText = aText + unicode::formatPercent(nPropLeftMargin,
|
|
|
|
Application::GetSettings().GetUILanguageTag());
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
aText += GetMetricText( (long)nRightMargin,
|
2003-04-04 16:56:48 +00:00
|
|
|
eCoreMetric, ePresentationMetric, pIntl );
|
2017-03-17 16:09:35 +01:00
|
|
|
aText += " " + EditResId::GetString(GetMetricId(ePresentationMetric));
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
if ( !pIntl )
|
2009-09-08 04:57:32 +00:00
|
|
|
pIntl = ScGlobal::GetScIntlWrapper();
|
2016-09-21 10:37:51 +02:00
|
|
|
pItem->GetPresentation( SfxItemPresentation::Complete, eCoreMetric, ePresentationMetric, aText, pIntl );
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-01-23 12:41:52 +01:00
|
|
|
if ( aText.getLength() )
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2015-11-06 09:23:33 +02:00
|
|
|
rText = rText + aText + " + ";
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pItem = aIter.NextItem();
|
|
|
|
}
|
|
|
|
|
2012-06-11 13:15:18 +01:00
|
|
|
rText = comphelper::string::stripEnd(rText, ' ');
|
|
|
|
rText = comphelper::string::stripEnd(rText, '+');
|
|
|
|
rText = comphelper::string::stripEnd(rText, ' ');
|
2014-07-24 11:31:39 +02:00
|
|
|
return true;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
|
2014-07-24 11:31:39 +02:00
|
|
|
bool ScDocumentPool::GetPresentation(
|
2000-09-18 23:16:46 +00:00
|
|
|
const SfxPoolItem& rItem,
|
2016-08-19 09:31:35 +01:00
|
|
|
MapUnit ePresentationMetric,
|
2013-01-23 12:41:52 +01:00
|
|
|
OUString& rText,
|
2001-05-13 02:33:31 +00:00
|
|
|
const IntlWrapper* pIntl ) const
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2011-01-17 13:20:22 +01:00
|
|
|
sal_uInt16 nW = rItem.Which();
|
2013-01-23 12:41:52 +01:00
|
|
|
OUString aStrYes ( ScGlobal::GetRscString(STR_YES) );
|
|
|
|
OUString aStrNo ( ScGlobal::GetRscString(STR_NO) );
|
|
|
|
OUString aStrSep(": ");
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2014-07-24 11:31:39 +02:00
|
|
|
bool ePresentationRet = true;
|
2000-09-18 23:16:46 +00:00
|
|
|
switch( nW )
|
|
|
|
{
|
|
|
|
case ATTR_PAGE_TOPDOWN:
|
2013-01-23 12:41:52 +01:00
|
|
|
rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_PRINTDIR) + aStrSep;
|
2014-10-22 12:03:38 +02:00
|
|
|
rText += static_cast<const SfxBoolItem&>(rItem).GetValue() ?
|
2000-09-18 23:16:46 +00:00
|
|
|
ScGlobal::GetRscString(STR_SCATTR_PAGE_TOPDOWN) :
|
|
|
|
ScGlobal::GetRscString(STR_SCATTR_PAGE_LEFTRIGHT) ;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ATTR_PAGE_HEADERS:
|
2013-01-23 12:41:52 +01:00
|
|
|
rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_HEADERS) + aStrSep;
|
2014-10-22 12:03:38 +02:00
|
|
|
rText += static_cast<const SfxBoolItem&>(rItem).GetValue() ? aStrYes : aStrNo ;
|
2000-09-18 23:16:46 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ATTR_PAGE_NULLVALS:
|
2013-01-23 12:41:52 +01:00
|
|
|
rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_NULLVALS) + aStrSep;
|
2014-10-22 12:03:38 +02:00
|
|
|
rText += static_cast<const SfxBoolItem&>(rItem).GetValue() ? aStrYes : aStrNo ;
|
2000-09-18 23:16:46 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ATTR_PAGE_FORMULAS:
|
2013-01-23 12:41:52 +01:00
|
|
|
rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_FORMULAS) + aStrSep;
|
2014-10-22 12:03:38 +02:00
|
|
|
rText += static_cast<const SfxBoolItem&>(rItem).GetValue() ? aStrYes : aStrNo ;
|
2000-09-18 23:16:46 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ATTR_PAGE_NOTES:
|
2013-01-23 12:41:52 +01:00
|
|
|
rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_NOTES) + aStrSep;
|
2014-10-22 12:03:38 +02:00
|
|
|
rText += static_cast<const SfxBoolItem&>(rItem).GetValue() ? aStrYes : aStrNo ;
|
2000-09-18 23:16:46 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ATTR_PAGE_GRID:
|
2013-01-23 12:41:52 +01:00
|
|
|
rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_GRID) + aStrSep;
|
2014-10-22 12:03:38 +02:00
|
|
|
rText += static_cast<const SfxBoolItem&>(rItem).GetValue() ? aStrYes : aStrNo ;
|
2000-09-18 23:16:46 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ATTR_PAGE_SCALETOPAGES:
|
|
|
|
{
|
2014-10-22 12:03:38 +02:00
|
|
|
sal_uInt16 nPagNo = static_cast<const SfxUInt16Item&>(rItem).GetValue();
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
if( nPagNo )
|
|
|
|
{
|
2014-07-21 15:53:14 +02:00
|
|
|
rText = ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALETOPAGES ) + aStrSep;
|
|
|
|
OUString aPages( ScGlobal::GetRscString( STR_SCATTR_PAGE_SCALE_PAGES ) );
|
|
|
|
aPages = aPages.replaceFirst( "%1", OUString::number( nPagNo ) );
|
|
|
|
rText += aPages;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-07-24 11:31:39 +02:00
|
|
|
ePresentationRet = false;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ATTR_PAGE_FIRSTPAGENO:
|
|
|
|
{
|
2014-10-22 12:03:38 +02:00
|
|
|
sal_uInt16 nPagNo = static_cast<const SfxUInt16Item&>(rItem).GetValue();
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
if( nPagNo )
|
|
|
|
{
|
2014-07-21 15:53:14 +02:00
|
|
|
rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_FIRSTPAGENO) + aStrSep;
|
|
|
|
rText += OUString::number( nPagNo );
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-07-24 11:31:39 +02:00
|
|
|
ePresentationRet = false;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ATTR_PAGE_SCALE:
|
|
|
|
{
|
2014-10-22 12:03:38 +02:00
|
|
|
sal_uInt16 nPercent = static_cast<const SfxUInt16Item &>(rItem).GetValue();
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
if( nPercent )
|
|
|
|
{
|
2014-07-21 15:53:14 +02:00
|
|
|
rText = ScGlobal::GetRscString(STR_SCATTR_PAGE_SCALE) + aStrSep;
|
|
|
|
rText = rText + unicode::formatPercent(nPercent,
|
|
|
|
Application::GetSettings().GetUILanguageTag());
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-07-24 11:31:39 +02:00
|
|
|
ePresentationRet = false;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ATTR_PAGE_HEADERSET:
|
|
|
|
{
|
2013-01-23 12:41:52 +01:00
|
|
|
OUString aBuffer;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2014-07-24 11:31:39 +02:00
|
|
|
if( lcl_HFPresentation( rItem, GetMetric( nW ), ePresentationMetric, aBuffer, pIntl ) )
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2013-02-14 20:15:38 +01:00
|
|
|
rText = ScGlobal::GetRscString(STR_HEADER) + " ( " + aBuffer + " ) ";
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ATTR_PAGE_FOOTERSET:
|
|
|
|
{
|
2013-01-23 12:41:52 +01:00
|
|
|
OUString aBuffer;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2014-07-24 11:31:39 +02:00
|
|
|
if( lcl_HFPresentation( rItem, GetMetric( nW ), ePresentationMetric, aBuffer, pIntl ) )
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2013-02-14 20:15:38 +01:00
|
|
|
rText = ScGlobal::GetRscString(STR_FOOTER) + " ( " + aBuffer + " ) ";
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
if ( !pIntl )
|
2009-09-08 04:57:32 +00:00
|
|
|
pIntl = ScGlobal::GetScIntlWrapper();
|
2016-09-21 10:37:51 +02:00
|
|
|
ePresentationRet = rItem.GetPresentation( SfxItemPresentation::Complete, GetMetric( nW ), ePresentationMetric, rText, pIntl );
|
2000-09-18 23:16:46 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2014-07-21 15:53:14 +02:00
|
|
|
return ePresentationRet;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
|
2016-08-19 09:31:35 +01:00
|
|
|
MapUnit ScDocumentPool::GetMetric( sal_uInt16 nWhich ) const
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2014-08-23 23:41:33 +02:00
|
|
|
// Own attributes in Twips, everything else in 1/100 mm
|
2000-09-18 23:16:46 +00:00
|
|
|
if ( nWhich >= ATTR_STARTINDEX && nWhich <= ATTR_ENDINDEX )
|
2016-09-20 16:41:39 +02:00
|
|
|
return MapUnit::MapTwip;
|
2000-09-18 23:16:46 +00:00
|
|
|
else
|
2016-09-20 16:41:39 +02:00
|
|
|
return MapUnit::Map100thMM;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
|
2010-10-12 15:59:00 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|