Files
libreoffice/sc/source/core/data/patattr.cxx

1428 lines
58 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patches contributed by Herbert Duerr i#118735 prevent endless loop if vlookup/hlookup doesn't find anything http://svn.apache.org/viewvc?view=revision&revision=1239673 Patches contributed by Andre Fischer remove lp_solver http://svn.apache.org/viewvc?view=revision&revision=1199180 i#118160: Added external CoinMP library. http://svn.apache.org/viewvc?view=revision&revision=1233909 Patches contributed by Armin Le-Grand i#118485 - Styles for OLEs are not saved. http://svn.apache.org/viewvc?view=revision&revision=1182166 i#118524: apply patch, followup fixes to 118485 http://svn.apache.org/viewvc?view=revision&revision=1186077 Patches contributed by lihuiibm i#108860 - Fix range validation. http://svn.apache.org/viewvc?view=revision&revision=1242846 i#118954 Chart data will lost after copy to different file http://svn.apache.org/viewvc?view=revision&revision=1301345 Patches contributed by Ariel Constenla-Haile Fix Linux build breaker: extra qualification on member http://svn.apache.org/viewvc?view=revision&revision=1301591 i#118696 - i#118697 - Fix some Sheet Tab Color API issues http://svn.apache.org/viewvc?view=revision&revision=1225428 i#118697 - Fix uninitialized variable http://svn.apache.org/viewvc?view=revision&revision=1225859 i#118771 - ScUndoImportTab should preserve tab background color http://svn.apache.org/viewvc?view=revision&revision=1230356 i#118921 - Repaint linked sheet tab background color after updating link http://svn.apache.org/viewvc?view=revision&revision=1245177 i#118927 - Undo/Redo "Update Link" does not reset sheet tab color http://svn.apache.org/viewvc?view=revision&revision=1245241 i#118747 - Copy tab color when transferring sheets across documents http://svn.apache.org/viewvc?view=revision&revision=1230355 Patch contributed by Oliver Rainer-Wittman i#118012 - methods <ScBroadcastAreaSlot::AreaBroadcast(..)> and <ScBroadcastAreaSlot::AreaBroadcastInRange(..)> adapt stl-container iteration in order to avoid destroyed iterators during iteration. http://svn.apache.org/viewvc?view=revision&revision=1297916 Patches contributed by Mathias Bauer gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1397315 Patch contributed by Daniel Rentz calc69: #i116936# fix VBA symbol Cells http://svn.apache.org/viewvc?view=revision&revision=1172135 Patches contributed by leiw: i#118546 CPU 100% on switched off AutoCalculate with Conditional Formatting on date values http://svn.apache.org/viewvc?view=revision&revision=1301380 Re-add new function documentation. Many various cleanups. Add missing calc66: #o11817313# also look at formula result number format, remove redundant binaries.
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
#include <memory>
#include <utility>
2000-09-18 23:16:46 +00:00
#include "scitems.hxx"
#include <editeng/adjustitem.hxx>
#include <o3tl/make_unique.hxx>
2000-09-18 23:16:46 +00:00
#include <svx/algitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/lineitem.hxx>
#include <editeng/brushitem.hxx>
#include <editeng/charreliefitem.hxx>
#include <editeng/contouritem.hxx>
#include <svtools/colorcfg.hxx>
#include <editeng/colritem.hxx>
#include <editeng/crossedoutitem.hxx>
#include <editeng/emphasismarkitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/forbiddenruleitem.hxx>
#include <editeng/frmdiritem.hxx>
#include <editeng/langitem.hxx>
#include <editeng/postitem.hxx>
2000-09-18 23:16:46 +00:00
#include <svx/rotmodit.hxx>
#include <editeng/scriptspaceitem.hxx>
#include <editeng/scripttypeitem.hxx>
#include <editeng/shaditem.hxx>
#include <editeng/shdditem.hxx>
#include <editeng/udlnitem.hxx>
#include <editeng/wghtitem.hxx>
#include <editeng/wrlmitem.hxx>
#include <editeng/justifyitem.hxx>
#include <svl/intitem.hxx>
#include <svl/zforlist.hxx>
2000-09-18 23:16:46 +00:00
#include <vcl/outdev.hxx>
#include <vcl/svapp.hxx>
#include <tools/fract.hxx>
2000-09-18 23:16:46 +00:00
#include "patattr.hxx"
#include "docpool.hxx"
#include "stlsheet.hxx"
#include "stlpool.hxx"
#include "document.hxx"
#include "global.hxx"
#include "globstr.hrc"
#include "conditio.hxx"
#include "validat.hxx"
#include "scmod.hxx"
#include "fillinfo.hxx"
2000-09-18 23:16:46 +00:00
using sc::HMMToTwips;
using sc::TwipsToHMM;
2000-11-23 19:18:50 +00:00
ScPatternAttr::ScPatternAttr( std::unique_ptr<SfxItemSet>&& pItemSet, const OUString& rStyleName )
: SfxSetItem ( ATTR_PATTERN, std::move(pItemSet) ),
pName ( new OUString( rStyleName ) ),
pStyle ( nullptr ),
mnKey(0)
2000-09-18 23:16:46 +00:00
{
}
ScPatternAttr::ScPatternAttr( std::unique_ptr<SfxItemSet>&& pItemSet )
: SfxSetItem ( ATTR_PATTERN, std::move(pItemSet) ),
pName ( nullptr ),
pStyle ( nullptr ),
mnKey(0)
2000-09-18 23:16:46 +00:00
{
}
ScPatternAttr::ScPatternAttr( SfxItemPool* pItemPool )
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
: SfxSetItem ( ATTR_PATTERN, o3tl::make_unique<SfxItemSet>( *pItemPool, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} ) ),
pName ( nullptr ),
pStyle ( nullptr ),
mnKey(0)
2000-09-18 23:16:46 +00:00
{
}
ScPatternAttr::ScPatternAttr( const ScPatternAttr& rPatternAttr )
: SfxSetItem ( rPatternAttr ),
pStyle ( rPatternAttr.pStyle ),
mnKey(rPatternAttr.mnKey)
2000-09-18 23:16:46 +00:00
{
if (rPatternAttr.pName)
pName.reset( new OUString(*rPatternAttr.pName) );
2000-09-18 23:16:46 +00:00
}
2010-12-11 23:25:30 +01:00
ScPatternAttr::~ScPatternAttr()
2000-09-18 23:16:46 +00:00
{
}
2010-12-11 23:25:30 +01:00
SfxPoolItem* ScPatternAttr::Clone( SfxItemPool *pPool ) const
2000-09-18 23:16:46 +00:00
{
ScPatternAttr* pPattern = new ScPatternAttr( std::unique_ptr<SfxItemSet>(GetItemSet().Clone(true, pPool)) );
2000-09-18 23:16:46 +00:00
pPattern->pStyle = pStyle;
pPattern->pName.reset( pName ? new OUString(*pName) : nullptr );
2000-09-18 23:16:46 +00:00
return pPattern;
}
inline bool StrCmp( const OUString* pStr1, const OUString* pStr2 )
2000-09-18 23:16:46 +00:00
{
return ( pStr1 ? ( pStr2 && ( *pStr1 == *pStr2 ) ) : ( pStr2 == nullptr ) );
2000-09-18 23:16:46 +00:00
}
inline bool EqualPatternSets( const SfxItemSet& rSet1, const SfxItemSet& rSet2 )
{
// #i62090# The SfxItemSet in the SfxSetItem base class always has the same ranges
// (single range from ATTR_PATTERN_START to ATTR_PATTERN_END), and the items are pooled,
// so it's enough to compare just the pointers (Count just because it's even faster).
if ( rSet1.Count() != rSet2.Count() )
return false;
SfxItemArray pItems1 = rSet1.GetItems_Impl(); // inline method of SfxItemSet
SfxItemArray pItems2 = rSet2.GetItems_Impl();
return ( 0 == memcmp( pItems1, pItems2, (ATTR_PATTERN_END - ATTR_PATTERN_START + 1) * sizeof(pItems1[0]) ) );
}
bool ScPatternAttr::operator==( const SfxPoolItem& rCmp ) const
2000-09-18 23:16:46 +00:00
{
// #i62090# Use quick comparison between ScPatternAttr's ItemSets
return ( EqualPatternSets( GetItemSet(), static_cast<const ScPatternAttr&>(rCmp).GetItemSet() ) &&
StrCmp( GetStyleName(), static_cast<const ScPatternAttr&>(rCmp).GetStyleName() ) );
2000-09-18 23:16:46 +00:00
}
SfxPoolItem* ScPatternAttr::Create( SvStream& rStream, sal_uInt16 /* nVersion */ ) const
2000-09-18 23:16:46 +00:00
{
OUString* pStr;
bool bHasStyle;
2000-09-18 23:16:46 +00:00
rStream.ReadCharAsBool( bHasStyle );
2000-09-18 23:16:46 +00:00
if ( bHasStyle )
{
2011-02-05 23:59:52 +01:00
short eFamDummy;
pStr = new OUString;
*pStr = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
rStream.ReadInt16( eFamDummy ); // due to old data format
2000-09-18 23:16:46 +00:00
}
else
pStr = new OUString( ScGlobal::GetRscString(STR_STYLENAME_STANDARD) );
2000-09-18 23:16:46 +00:00
auto pNewSet = o3tl::make_unique<SfxItemSet>( *GetItemSet().GetPool(),
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_PATTERN_START, ATTR_PATTERN_END>{} );
pNewSet->Load( rStream );
2000-09-18 23:16:46 +00:00
ScPatternAttr* pPattern = new ScPatternAttr( std::move(pNewSet) );
2000-09-18 23:16:46 +00:00
pPattern->pName.reset( pStr );
2000-09-18 23:16:46 +00:00
return pPattern;
}
SvStream& ScPatternAttr::Store(SvStream& rStream, sal_uInt16 /* nItemVersion */) const
2000-09-18 23:16:46 +00:00
{
rStream.WriteBool( true );
2000-09-18 23:16:46 +00:00
if ( pStyle )
rStream.WriteUniOrByteString( pStyle->GetName(), rStream.GetStreamCharSet() );
else if ( pName ) // when style is/was deleted
rStream.WriteUniOrByteString( *pName, rStream.GetStreamCharSet() );
2000-09-18 23:16:46 +00:00
else
rStream.WriteUniOrByteString( ScGlobal::GetRscString(STR_STYLENAME_STANDARD),
2000-09-18 23:16:46 +00:00
rStream.GetStreamCharSet() );
rStream.WriteInt16( (sal_uInt16) SfxStyleFamily::Para ); // due to old data format
2000-09-18 23:16:46 +00:00
GetItemSet().Store( rStream );
return rStream;
}
SvxCellOrientation ScPatternAttr::GetCellOrientation( const SfxItemSet& rItemSet, const SfxItemSet* pCondSet )
{
SvxCellOrientation eOrient = SVX_ORIENTATION_STANDARD;
if( static_cast<const SfxBoolItem&>(GetItem( ATTR_STACKED, rItemSet, pCondSet )).GetValue() )
{
eOrient = SVX_ORIENTATION_STACKED;
}
else
{
sal_Int32 nAngle = static_cast<const SfxInt32Item&>(GetItem( ATTR_ROTATE_VALUE, rItemSet, pCondSet )).GetValue();
if( nAngle == 9000 )
eOrient = SVX_ORIENTATION_BOTTOMTOP;
else if( nAngle == 27000 )
eOrient = SVX_ORIENTATION_TOPBOTTOM;
}
return eOrient;
}
SvxCellOrientation ScPatternAttr::GetCellOrientation( const SfxItemSet* pCondSet ) const
{
return GetCellOrientation( GetItemSet(), pCondSet );
}
namespace {
2000-09-18 23:16:46 +00:00
void getFontIDsByScriptType(SvtScriptType nScript,
sal_uInt16& nFontId, sal_uInt16& nHeightId, sal_uInt16& nWeightId, sal_uInt16& nPostureId, sal_uInt16& nLangId)
{
if ( nScript == SvtScriptType::ASIAN )
2000-11-23 19:18:50 +00:00
{
nFontId = ATTR_CJK_FONT;
nHeightId = ATTR_CJK_FONT_HEIGHT;
nWeightId = ATTR_CJK_FONT_WEIGHT;
nPostureId = ATTR_CJK_FONT_POSTURE;
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
nLangId = ATTR_CJK_FONT_LANGUAGE;
2000-11-23 19:18:50 +00:00
}
else if ( nScript == SvtScriptType::COMPLEX )
2000-11-23 19:18:50 +00:00
{
nFontId = ATTR_CTL_FONT;
nHeightId = ATTR_CTL_FONT_HEIGHT;
nWeightId = ATTR_CTL_FONT_WEIGHT;
nPostureId = ATTR_CTL_FONT_POSTURE;
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
nLangId = ATTR_CTL_FONT_LANGUAGE;
2000-11-23 19:18:50 +00:00
}
else
{
nFontId = ATTR_FONT;
nHeightId = ATTR_FONT_HEIGHT;
nWeightId = ATTR_FONT_WEIGHT;
nPostureId = ATTR_FONT_POSTURE;
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
nLangId = ATTR_FONT_LANGUAGE;
2000-11-23 19:18:50 +00:00
}
}
}
void ScPatternAttr::GetFont(
vcl::Font& rFont, const SfxItemSet& rItemSet, ScAutoFontColorMode eAutoMode,
OutputDevice* pOutDev, const Fraction* pScale,
const SfxItemSet* pCondSet, SvtScriptType nScript,
const Color* pBackConfigColor, const Color* pTextConfigColor )
{
// Read items
const SvxFontItem* pFontAttr;
sal_uInt32 nFontHeight;
FontWeight eWeight;
FontItalic eItalic;
FontLineStyle eUnder;
FontLineStyle eOver;
bool bWordLine;
FontStrikeout eStrike;
bool bOutline;
bool bShadow;
FontEmphasisMark eEmphasis;
FontRelief eRelief;
Color aColor;
LanguageType eLang;
sal_uInt16 nFontId, nHeightId, nWeightId, nPostureId, nLangId;
getFontIDsByScriptType(nScript, nFontId, nHeightId, nWeightId, nPostureId, nLangId);
2000-11-23 19:18:50 +00:00
2000-09-18 23:16:46 +00:00
if ( pCondSet )
{
const SfxPoolItem* pItem;
if ( pCondSet->GetItemState( nFontId, true, &pItem ) != SfxItemState::SET )
pItem = &rItemSet.Get( nFontId );
pFontAttr = static_cast<const SvxFontItem*>(pItem);
2000-09-18 23:16:46 +00:00
if ( pCondSet->GetItemState( nHeightId, true, &pItem ) != SfxItemState::SET )
pItem = &rItemSet.Get( nHeightId );
nFontHeight = static_cast<const SvxFontHeightItem*>(pItem)->GetHeight();
2000-09-18 23:16:46 +00:00
if ( pCondSet->GetItemState( nWeightId, true, &pItem ) != SfxItemState::SET )
pItem = &rItemSet.Get( nWeightId );
eWeight = static_cast<const SvxWeightItem*>(pItem)->GetValue();
2000-09-18 23:16:46 +00:00
if ( pCondSet->GetItemState( nPostureId, true, &pItem ) != SfxItemState::SET )
pItem = &rItemSet.Get( nPostureId );
eItalic = static_cast<const SvxPostureItem*>(pItem)->GetValue();
2000-09-18 23:16:46 +00:00
if ( pCondSet->GetItemState( ATTR_FONT_UNDERLINE, true, &pItem ) != SfxItemState::SET )
pItem = &rItemSet.Get( ATTR_FONT_UNDERLINE );
eUnder = static_cast<const SvxUnderlineItem*>(pItem)->GetValue();
2000-09-18 23:16:46 +00:00
if ( pCondSet->GetItemState( ATTR_FONT_OVERLINE, true, &pItem ) != SfxItemState::SET )
pItem = &rItemSet.Get( ATTR_FONT_OVERLINE );
eOver = static_cast<const SvxOverlineItem*>(pItem)->GetValue();
if ( pCondSet->GetItemState( ATTR_FONT_WORDLINE, true, &pItem ) != SfxItemState::SET )
pItem = &rItemSet.Get( ATTR_FONT_WORDLINE );
bWordLine = static_cast<const SvxWordLineModeItem*>(pItem)->GetValue();
if ( pCondSet->GetItemState( ATTR_FONT_CROSSEDOUT, true, &pItem ) != SfxItemState::SET )
pItem = &rItemSet.Get( ATTR_FONT_CROSSEDOUT );
eStrike = static_cast<const SvxCrossedOutItem*>(pItem)->GetValue();
2000-09-18 23:16:46 +00:00
if ( pCondSet->GetItemState( ATTR_FONT_CONTOUR, true, &pItem ) != SfxItemState::SET )
pItem = &rItemSet.Get( ATTR_FONT_CONTOUR );
bOutline = static_cast<const SvxContourItem*>(pItem)->GetValue();
2000-09-18 23:16:46 +00:00
if ( pCondSet->GetItemState( ATTR_FONT_SHADOWED, true, &pItem ) != SfxItemState::SET )
pItem = &rItemSet.Get( ATTR_FONT_SHADOWED );
bShadow = static_cast<const SvxShadowedItem*>(pItem)->GetValue();
2000-09-18 23:16:46 +00:00
if ( pCondSet->GetItemState( ATTR_FONT_EMPHASISMARK, true, &pItem ) != SfxItemState::SET )
pItem = &rItemSet.Get( ATTR_FONT_EMPHASISMARK );
eEmphasis = static_cast<const SvxEmphasisMarkItem*>(pItem)->GetEmphasisMark();
2001-04-24 16:31:21 +00:00
if ( pCondSet->GetItemState( ATTR_FONT_RELIEF, true, &pItem ) != SfxItemState::SET )
pItem = &rItemSet.Get( ATTR_FONT_RELIEF );
eRelief = static_cast<const SvxCharReliefItem*>(pItem)->GetValue();
if ( pCondSet->GetItemState( ATTR_FONT_COLOR, true, &pItem ) != SfxItemState::SET )
pItem = &rItemSet.Get( ATTR_FONT_COLOR );
aColor = static_cast<const SvxColorItem*>(pItem)->GetValue();
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
if ( pCondSet->GetItemState( nLangId, true, &pItem ) != SfxItemState::SET )
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
pItem = &rItemSet.Get( nLangId );
eLang = static_cast<const SvxLanguageItem*>(pItem)->GetLanguage();
2000-09-18 23:16:46 +00:00
}
else // Everything from rItemSet
2000-09-18 23:16:46 +00:00
{
pFontAttr = &static_cast<const SvxFontItem&>(rItemSet.Get( nFontId ));
nFontHeight = static_cast<const SvxFontHeightItem&>(
rItemSet.Get( nHeightId )).GetHeight();
eWeight = static_cast<const SvxWeightItem&>(
rItemSet.Get( nWeightId )).GetValue();
eItalic = static_cast<const SvxPostureItem&>(
rItemSet.Get( nPostureId )).GetValue();
eUnder = static_cast<const SvxUnderlineItem&>(
rItemSet.Get( ATTR_FONT_UNDERLINE )).GetValue();
eOver = static_cast<const SvxOverlineItem&>(
rItemSet.Get( ATTR_FONT_OVERLINE )).GetValue();
bWordLine = static_cast<const SvxWordLineModeItem&>(
rItemSet.Get( ATTR_FONT_WORDLINE )).GetValue();
eStrike = static_cast<const SvxCrossedOutItem&>(
rItemSet.Get( ATTR_FONT_CROSSEDOUT )).GetValue();
bOutline = static_cast<const SvxContourItem&>(
rItemSet.Get( ATTR_FONT_CONTOUR )).GetValue();
bShadow = static_cast<const SvxShadowedItem&>(
rItemSet.Get( ATTR_FONT_SHADOWED )).GetValue();
eEmphasis = static_cast<const SvxEmphasisMarkItem&>(
rItemSet.Get( ATTR_FONT_EMPHASISMARK )).GetEmphasisMark();
eRelief = static_cast<const SvxCharReliefItem&>(
rItemSet.Get( ATTR_FONT_RELIEF )).GetValue();
aColor = static_cast<const SvxColorItem&>(
rItemSet.Get( ATTR_FONT_COLOR )).GetValue();
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
// for graphite language features
eLang = static_cast<const SvxLanguageItem&>(rItemSet.Get( nLangId )).GetLanguage();
2000-09-18 23:16:46 +00:00
}
OSL_ENSURE(pFontAttr,"Oops?");
2000-09-18 23:16:46 +00:00
// Evaluate
2000-09-18 23:16:46 +00:00
// FontItem:
if (rFont.GetFamilyName() != pFontAttr->GetFamilyName())
rFont.SetFamilyName( pFontAttr->GetFamilyName() );
2000-09-18 23:16:46 +00:00
if (rFont.GetStyleName() != pFontAttr->GetStyleName())
rFont.SetStyleName( pFontAttr->GetStyleName() );
rFont.SetFamily( pFontAttr->GetFamily() );
rFont.SetCharSet( pFontAttr->GetCharSet() );
rFont.SetPitch( pFontAttr->GetPitch() );
2000-09-18 23:16:46 +00:00
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
rFont.SetLanguage(eLang);
// Size
2000-09-18 23:16:46 +00:00
if ( pOutDev != nullptr )
2000-09-18 23:16:46 +00:00
{
Size aEffSize;
Fraction aFraction( 1,1 );
2000-09-18 23:16:46 +00:00
if (pScale)
aFraction = *pScale;
Size aSize( 0, (long) nFontHeight );
MapMode aDestMode = pOutDev->GetMapMode();
MapMode aSrcMode( MapUnit::MapTwip, Point(), aFraction, aFraction );
if (aDestMode.GetMapUnit() == MapUnit::MapPixel && pOutDev->GetDPIX() > 0)
2000-09-18 23:16:46 +00:00
aEffSize = pOutDev->LogicToPixel( aSize, aSrcMode );
else
{
Fraction aFractOne(1,1);
2000-09-18 23:16:46 +00:00
aDestMode.SetScaleX( aFractOne );
aDestMode.SetScaleY( aFractOne );
aEffSize = OutputDevice::LogicToLogic( aSize, aSrcMode, aDestMode );
}
rFont.SetFontSize( aEffSize );
2000-09-18 23:16:46 +00:00
}
else /* if pOutDev != NULL */
{
rFont.SetFontSize( Size( 0, (long) nFontHeight ) );
2000-09-18 23:16:46 +00:00
}
// determine effective font color
2000-09-18 23:16:46 +00:00
if ( ( aColor.GetColor() == COL_AUTO && eAutoMode != SC_AUTOCOL_RAW ) ||
eAutoMode == SC_AUTOCOL_IGNOREFONT || eAutoMode == SC_AUTOCOL_IGNOREALL )
{
if ( eAutoMode == SC_AUTOCOL_BLACK )
aColor.SetColor( COL_BLACK );
else
{
// get background color from conditional or own set
Color aBackColor;
if ( pCondSet )
{
const SfxPoolItem* pItem;
if ( pCondSet->GetItemState( ATTR_BACKGROUND, true, &pItem ) != SfxItemState::SET )
pItem = &rItemSet.Get( ATTR_BACKGROUND );
aBackColor = static_cast<const SvxBrushItem*>(pItem)->GetColor();
}
else
aBackColor = static_cast<const SvxBrushItem&>(rItemSet.Get( ATTR_BACKGROUND )).GetColor();
// if background color attribute is transparent, use window color for brightness comparisons
if ( aBackColor == COL_TRANSPARENT ||
eAutoMode == SC_AUTOCOL_IGNOREBACK || eAutoMode == SC_AUTOCOL_IGNOREALL )
{
if ( eAutoMode == SC_AUTOCOL_PRINT )
aBackColor.SetColor( COL_WHITE );
else if ( pBackConfigColor )
{
// pBackConfigColor can be used to avoid repeated lookup of the configured color
aBackColor = *pBackConfigColor;
}
else
aBackColor.SetColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor );
}
// get system text color for comparison
Color aSysTextColor;
if ( eAutoMode == SC_AUTOCOL_PRINT )
aSysTextColor.SetColor( COL_BLACK );
else if ( pTextConfigColor )
{
// pTextConfigColor can be used to avoid repeated lookup of the configured color
aSysTextColor = *pTextConfigColor;
}
else
aSysTextColor.SetColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
// select the resulting color
if ( aBackColor.IsDark() && aSysTextColor.IsDark() )
{
// use white instead of dark on dark
aColor.SetColor( COL_WHITE );
}
else if ( aBackColor.IsBright() && aSysTextColor.IsBright() )
{
// use black instead of bright on bright
aColor.SetColor( COL_BLACK );
}
else
{
// use aSysTextColor (black for SC_AUTOCOL_PRINT, from style settings otherwise)
aColor = aSysTextColor;
}
}
}
// set font effects
rFont.SetWeight( eWeight );
rFont.SetItalic( eItalic );
rFont.SetUnderline( eUnder );
rFont.SetOverline( eOver );
rFont.SetWordLineMode( bWordLine );
rFont.SetStrikeout( eStrike );
rFont.SetOutline( bOutline );
rFont.SetShadow( bShadow );
rFont.SetEmphasisMark( eEmphasis );
rFont.SetRelief( eRelief );
rFont.SetColor( aColor );
2011-11-10 15:54:13 +01:00
rFont.SetTransparent( true );
2000-09-18 23:16:46 +00:00
}
void ScPatternAttr::GetFont(
vcl::Font& rFont, ScAutoFontColorMode eAutoMode,
OutputDevice* pOutDev, const Fraction* pScale,
const SfxItemSet* pCondSet, SvtScriptType nScript,
const Color* pBackConfigColor, const Color* pTextConfigColor ) const
{
GetFont( rFont, GetItemSet(), eAutoMode, pOutDev, pScale, pCondSet, nScript, pBackConfigColor, pTextConfigColor );
}
ScDxfFont ScPatternAttr::GetDxfFont(const SfxItemSet& rItemSet, SvtScriptType nScript)
{
sal_uInt16 nFontId, nHeightId, nWeightId, nPostureId, nLangId;
getFontIDsByScriptType(nScript, nFontId, nHeightId, nWeightId, nPostureId, nLangId);
const SfxPoolItem* pItem;
ScDxfFont aReturn;
if ( rItemSet.GetItemState( nFontId, true, &pItem ) == SfxItemState::SET )
{
pItem = &rItemSet.Get( nFontId );
aReturn.pFontAttr = static_cast<const SvxFontItem*>(pItem);
}
if ( rItemSet.GetItemState( nHeightId, true, &pItem ) == SfxItemState::SET )
{
pItem = &rItemSet.Get( nHeightId );
aReturn.nFontHeight = static_cast<const SvxFontHeightItem*>(pItem)->GetHeight();
}
if ( rItemSet.GetItemState( nWeightId, true, &pItem ) == SfxItemState::SET )
{
pItem = &rItemSet.Get( nWeightId );
aReturn.eWeight = static_cast<const SvxWeightItem*>(pItem)->GetValue();
}
if ( rItemSet.GetItemState( nPostureId, true, &pItem ) == SfxItemState::SET )
{
pItem = &rItemSet.Get( nPostureId );
aReturn.eItalic = static_cast<const SvxPostureItem*>(pItem)->GetValue();
}
if ( rItemSet.GetItemState( ATTR_FONT_UNDERLINE, true, &pItem ) == SfxItemState::SET )
{
pItem = &rItemSet.Get( ATTR_FONT_UNDERLINE );
aReturn.eUnder = static_cast<const SvxUnderlineItem*>(pItem)->GetValue();
}
if ( rItemSet.GetItemState( ATTR_FONT_OVERLINE, true, &pItem ) == SfxItemState::SET )
{
pItem = &rItemSet.Get( ATTR_FONT_OVERLINE );
aReturn.eOver = static_cast<const SvxOverlineItem*>(pItem)->GetValue();
}
if ( rItemSet.GetItemState( ATTR_FONT_WORDLINE, true, &pItem ) == SfxItemState::SET )
{
pItem = &rItemSet.Get( ATTR_FONT_WORDLINE );
aReturn.bWordLine = static_cast<const SvxWordLineModeItem*>(pItem)->GetValue();
}
if ( rItemSet.GetItemState( ATTR_FONT_CROSSEDOUT, true, &pItem ) == SfxItemState::SET )
{
pItem = &rItemSet.Get( ATTR_FONT_CROSSEDOUT );
aReturn.eStrike = static_cast<const SvxCrossedOutItem*>(pItem)->GetValue();
}
if ( rItemSet.GetItemState( ATTR_FONT_CONTOUR, true, &pItem ) == SfxItemState::SET )
{
pItem = &rItemSet.Get( ATTR_FONT_CONTOUR );
aReturn.bOutline = static_cast<const SvxContourItem*>(pItem)->GetValue();
}
if ( rItemSet.GetItemState( ATTR_FONT_SHADOWED, true, &pItem ) == SfxItemState::SET )
{
pItem = &rItemSet.Get( ATTR_FONT_SHADOWED );
aReturn.bShadow = static_cast<const SvxShadowedItem*>(pItem)->GetValue();
}
if ( rItemSet.GetItemState( ATTR_FONT_EMPHASISMARK, true, &pItem ) == SfxItemState::SET )
{
pItem = &rItemSet.Get( ATTR_FONT_EMPHASISMARK );
aReturn.eEmphasis = static_cast<const SvxEmphasisMarkItem*>(pItem)->GetEmphasisMark();
}
if ( rItemSet.GetItemState( ATTR_FONT_RELIEF, true, &pItem ) == SfxItemState::SET )
{
pItem = &rItemSet.Get( ATTR_FONT_RELIEF );
aReturn.eRelief = static_cast<const SvxCharReliefItem*>(pItem)->GetValue();
}
if ( rItemSet.GetItemState( ATTR_FONT_COLOR, true, &pItem ) == SfxItemState::SET )
{
pItem = &rItemSet.Get( ATTR_FONT_COLOR );
aReturn.aColor = static_cast<const SvxColorItem*>(pItem)->GetValue();
}
if ( rItemSet.GetItemState( nLangId, true, &pItem ) == SfxItemState::SET )
{
pItem = &rItemSet.Get( nLangId );
aReturn.eLang = static_cast<const SvxLanguageItem*>(pItem)->GetLanguage();
}
return aReturn;
}
void ScPatternAttr::FillToEditItemSet( SfxItemSet& rEditSet, const SfxItemSet& rSrcSet, const SfxItemSet* pCondSet )
2000-09-18 23:16:46 +00:00
{
// Read Items
2000-09-18 23:16:46 +00:00
2000-11-23 19:18:50 +00:00
SvxColorItem aColorItem(EE_CHAR_COLOR); // use item as-is
SvxFontItem aFontItem(EE_CHAR_FONTINFO); // use item as-is
SvxFontItem aCjkFontItem(EE_CHAR_FONTINFO_CJK);
SvxFontItem aCtlFontItem(EE_CHAR_FONTINFO_CTL);
long nTHeight, nCjkTHeight, nCtlTHeight; // Twips
FontWeight eWeight, eCjkWeight, eCtlWeight;
SvxUnderlineItem aUnderlineItem(LINESTYLE_NONE, EE_CHAR_UNDERLINE);
SvxOverlineItem aOverlineItem(LINESTYLE_NONE, EE_CHAR_OVERLINE);
2011-11-10 15:54:13 +01:00
bool bWordLine;
2000-09-18 23:16:46 +00:00
FontStrikeout eStrike;
2000-11-23 19:18:50 +00:00
FontItalic eItalic, eCjkItalic, eCtlItalic;
2011-11-10 15:54:13 +01:00
bool bOutline;
bool bShadow;
bool bForbidden;
2001-04-24 16:31:21 +00:00
FontEmphasisMark eEmphasis;
FontRelief eRelief;
LanguageType eLang, eCjkLang, eCtlLang;
2011-11-10 15:54:13 +01:00
bool bHyphenate;
SvxFrameDirection eDirection;
//TODO: additional parameter to control if language is needed?
2000-09-18 23:16:46 +00:00
if ( pCondSet )
{
const SfxPoolItem* pItem;
if ( pCondSet->GetItemState( ATTR_FONT_COLOR, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_FONT_COLOR );
aColorItem = *static_cast<const SvxColorItem*>(pItem);
2000-09-18 23:16:46 +00:00
if ( pCondSet->GetItemState( ATTR_FONT, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_FONT );
aFontItem = *static_cast<const SvxFontItem*>(pItem);
if ( pCondSet->GetItemState( ATTR_CJK_FONT, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_CJK_FONT );
aCjkFontItem = *static_cast<const SvxFontItem*>(pItem);
if ( pCondSet->GetItemState( ATTR_CTL_FONT, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_CTL_FONT );
aCtlFontItem = *static_cast<const SvxFontItem*>(pItem);
2000-09-18 23:16:46 +00:00
if ( pCondSet->GetItemState( ATTR_FONT_HEIGHT, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_FONT_HEIGHT );
nTHeight = static_cast<const SvxFontHeightItem*>(pItem)->GetHeight();
if ( pCondSet->GetItemState( ATTR_CJK_FONT_HEIGHT, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_CJK_FONT_HEIGHT );
nCjkTHeight = static_cast<const SvxFontHeightItem*>(pItem)->GetHeight();
if ( pCondSet->GetItemState( ATTR_CTL_FONT_HEIGHT, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_CTL_FONT_HEIGHT );
nCtlTHeight = static_cast<const SvxFontHeightItem*>(pItem)->GetHeight();
2000-09-18 23:16:46 +00:00
if ( pCondSet->GetItemState( ATTR_FONT_WEIGHT, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_FONT_WEIGHT );
eWeight = static_cast<const SvxWeightItem*>(pItem)->GetValue();
if ( pCondSet->GetItemState( ATTR_CJK_FONT_WEIGHT, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_CJK_FONT_WEIGHT );
eCjkWeight = static_cast<const SvxWeightItem*>(pItem)->GetValue();
if ( pCondSet->GetItemState( ATTR_CTL_FONT_WEIGHT, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_CTL_FONT_WEIGHT );
eCtlWeight = static_cast<const SvxWeightItem*>(pItem)->GetValue();
2000-09-18 23:16:46 +00:00
if ( pCondSet->GetItemState( ATTR_FONT_POSTURE, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_FONT_POSTURE );
eItalic = static_cast<const SvxPostureItem*>(pItem)->GetValue();
if ( pCondSet->GetItemState( ATTR_CJK_FONT_POSTURE, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_CJK_FONT_POSTURE );
eCjkItalic = static_cast<const SvxPostureItem*>(pItem)->GetValue();
if ( pCondSet->GetItemState( ATTR_CTL_FONT_POSTURE, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_CTL_FONT_POSTURE );
eCtlItalic = static_cast<const SvxPostureItem*>(pItem)->GetValue();
2000-09-18 23:16:46 +00:00
if ( pCondSet->GetItemState( ATTR_FONT_UNDERLINE, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_FONT_UNDERLINE );
aUnderlineItem = *static_cast<const SvxUnderlineItem*>(pItem);
2000-09-18 23:16:46 +00:00
if ( pCondSet->GetItemState( ATTR_FONT_OVERLINE, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_FONT_OVERLINE );
aOverlineItem = *static_cast<const SvxOverlineItem*>(pItem);
if ( pCondSet->GetItemState( ATTR_FONT_WORDLINE, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_FONT_WORDLINE );
bWordLine = static_cast<const SvxWordLineModeItem*>(pItem)->GetValue();
if ( pCondSet->GetItemState( ATTR_FONT_CROSSEDOUT, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_FONT_CROSSEDOUT );
eStrike = static_cast<const SvxCrossedOutItem*>(pItem)->GetValue();
2000-09-18 23:16:46 +00:00
if ( pCondSet->GetItemState( ATTR_FONT_CONTOUR, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_FONT_CONTOUR );
bOutline = static_cast<const SvxContourItem*>(pItem)->GetValue();
2000-09-18 23:16:46 +00:00
if ( pCondSet->GetItemState( ATTR_FONT_SHADOWED, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_FONT_SHADOWED );
bShadow = static_cast<const SvxShadowedItem*>(pItem)->GetValue();
if ( pCondSet->GetItemState( ATTR_FORBIDDEN_RULES, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_FORBIDDEN_RULES );
bForbidden = static_cast<const SvxForbiddenRuleItem*>(pItem)->GetValue();
if ( pCondSet->GetItemState( ATTR_FONT_EMPHASISMARK, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_FONT_EMPHASISMARK );
eEmphasis = static_cast<const SvxEmphasisMarkItem*>(pItem)->GetEmphasisMark();
if ( pCondSet->GetItemState( ATTR_FONT_RELIEF, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_FONT_RELIEF );
eRelief = static_cast<const SvxCharReliefItem*>(pItem)->GetValue();
2001-04-24 16:31:21 +00:00
if ( pCondSet->GetItemState( ATTR_FONT_LANGUAGE, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_FONT_LANGUAGE );
eLang = static_cast<const SvxLanguageItem*>(pItem)->GetLanguage();
if ( pCondSet->GetItemState( ATTR_CJK_FONT_LANGUAGE, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_CJK_FONT_LANGUAGE );
eCjkLang = static_cast<const SvxLanguageItem*>(pItem)->GetLanguage();
if ( pCondSet->GetItemState( ATTR_CTL_FONT_LANGUAGE, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_CTL_FONT_LANGUAGE );
eCtlLang = static_cast<const SvxLanguageItem*>(pItem)->GetLanguage();
2001-05-18 18:45:24 +00:00
if ( pCondSet->GetItemState( ATTR_HYPHENATE, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_HYPHENATE );
bHyphenate = static_cast<const SfxBoolItem*>(pItem)->GetValue();
if ( pCondSet->GetItemState( ATTR_WRITINGDIR, true, &pItem ) != SfxItemState::SET )
pItem = &rSrcSet.Get( ATTR_WRITINGDIR );
eDirection = static_cast<const SvxFrameDirectionItem*>(pItem)->GetValue();
2000-09-18 23:16:46 +00:00
}
else // Everything directly from Pattern
2000-09-18 23:16:46 +00:00
{
aColorItem = static_cast<const SvxColorItem&>( rSrcSet.Get( ATTR_FONT_COLOR ) );
aFontItem = static_cast<const SvxFontItem&>( rSrcSet.Get( ATTR_FONT ) );
aCjkFontItem = static_cast<const SvxFontItem&>( rSrcSet.Get( ATTR_CJK_FONT ) );
aCtlFontItem = static_cast<const SvxFontItem&>( rSrcSet.Get( ATTR_CTL_FONT ) );
nTHeight = static_cast<const SvxFontHeightItem&>(
rSrcSet.Get( ATTR_FONT_HEIGHT )).GetHeight();
nCjkTHeight = static_cast<const SvxFontHeightItem&>(
rSrcSet.Get( ATTR_CJK_FONT_HEIGHT )).GetHeight();
nCtlTHeight = static_cast<const SvxFontHeightItem&>(
rSrcSet.Get( ATTR_CTL_FONT_HEIGHT )).GetHeight();
eWeight = static_cast<const SvxWeightItem&>(
rSrcSet.Get( ATTR_FONT_WEIGHT )).GetValue();
eCjkWeight = static_cast<const SvxWeightItem&>(
rSrcSet.Get( ATTR_CJK_FONT_WEIGHT )).GetValue();
eCtlWeight = static_cast<const SvxWeightItem&>(
rSrcSet.Get( ATTR_CTL_FONT_WEIGHT )).GetValue();
eItalic = static_cast<const SvxPostureItem&>(
rSrcSet.Get( ATTR_FONT_POSTURE )).GetValue();
eCjkItalic = static_cast<const SvxPostureItem&>(
rSrcSet.Get( ATTR_CJK_FONT_POSTURE )).GetValue();
eCtlItalic = static_cast<const SvxPostureItem&>(
rSrcSet.Get( ATTR_CTL_FONT_POSTURE )).GetValue();
aUnderlineItem = static_cast<const SvxUnderlineItem&>( rSrcSet.Get( ATTR_FONT_UNDERLINE ) );
aOverlineItem = static_cast<const SvxOverlineItem&>( rSrcSet.Get( ATTR_FONT_OVERLINE ) );
bWordLine = static_cast<const SvxWordLineModeItem&>(
rSrcSet.Get( ATTR_FONT_WORDLINE )).GetValue();
eStrike = static_cast<const SvxCrossedOutItem&>(
rSrcSet.Get( ATTR_FONT_CROSSEDOUT )).GetValue();
bOutline = static_cast<const SvxContourItem&>(
rSrcSet.Get( ATTR_FONT_CONTOUR )).GetValue();
bShadow = static_cast<const SvxShadowedItem&>(
rSrcSet.Get( ATTR_FONT_SHADOWED )).GetValue();
bForbidden = static_cast<const SvxForbiddenRuleItem&>(
rSrcSet.Get( ATTR_FORBIDDEN_RULES )).GetValue();
eEmphasis = static_cast<const SvxEmphasisMarkItem&>(
rSrcSet.Get( ATTR_FONT_EMPHASISMARK )).GetEmphasisMark();
eRelief = static_cast<const SvxCharReliefItem&>(
rSrcSet.Get( ATTR_FONT_RELIEF )).GetValue();
eLang = static_cast<const SvxLanguageItem&>(
rSrcSet.Get( ATTR_FONT_LANGUAGE )).GetLanguage();
eCjkLang = static_cast<const SvxLanguageItem&>(
rSrcSet.Get( ATTR_CJK_FONT_LANGUAGE )).GetLanguage();
eCtlLang = static_cast<const SvxLanguageItem&>(
rSrcSet.Get( ATTR_CTL_FONT_LANGUAGE )).GetLanguage();
bHyphenate = static_cast<const SfxBoolItem&>(
rSrcSet.Get( ATTR_HYPHENATE )).GetValue();
eDirection = static_cast<const SvxFrameDirectionItem&>(
rSrcSet.Get( ATTR_WRITINGDIR )).GetValue();
2000-09-18 23:16:46 +00:00
}
// Expect to be compatible to LogicToLogic, ie. 2540/1440 = 127/72, and round
2000-09-18 23:16:46 +00:00
2000-11-23 19:18:50 +00:00
long nHeight = TwipsToHMM(nTHeight);
long nCjkHeight = TwipsToHMM(nCjkTHeight);
long nCtlHeight = TwipsToHMM(nCtlTHeight);
2000-09-18 23:16:46 +00:00
// put items into EditEngine ItemSet
2000-09-18 23:16:46 +00:00
if ( aColorItem.GetValue().GetColor() == COL_AUTO )
{
2011-02-27 23:59:21 +01:00
// When cell attributes are converted to EditEngine paragraph attributes,
// don't create a hard item for automatic color, because that would be converted
// to black when the item's Store method is used in CreateTransferable/WriteBin.
// COL_AUTO is the EditEngine's pool default, so ClearItem will result in automatic
// color, too, without having to store the item.
rEditSet.ClearItem( EE_CHAR_COLOR );
}
else
rEditSet.Put( aColorItem );
rEditSet.Put( aFontItem );
rEditSet.Put( aCjkFontItem );
rEditSet.Put( aCtlFontItem );
rEditSet.Put( SvxFontHeightItem( nHeight, 100, EE_CHAR_FONTHEIGHT ) );
rEditSet.Put( SvxFontHeightItem( nCjkHeight, 100, EE_CHAR_FONTHEIGHT_CJK ) );
rEditSet.Put( SvxFontHeightItem( nCtlHeight, 100, EE_CHAR_FONTHEIGHT_CTL ) );
rEditSet.Put( SvxWeightItem ( eWeight, EE_CHAR_WEIGHT ) );
rEditSet.Put( SvxWeightItem ( eCjkWeight, EE_CHAR_WEIGHT_CJK ) );
rEditSet.Put( SvxWeightItem ( eCtlWeight, EE_CHAR_WEIGHT_CTL ) );
rEditSet.Put( aUnderlineItem );
rEditSet.Put( aOverlineItem );
rEditSet.Put( SvxWordLineModeItem( bWordLine, EE_CHAR_WLM ) );
rEditSet.Put( SvxCrossedOutItem( eStrike, EE_CHAR_STRIKEOUT ) );
rEditSet.Put( SvxPostureItem ( eItalic, EE_CHAR_ITALIC ) );
rEditSet.Put( SvxPostureItem ( eCjkItalic, EE_CHAR_ITALIC_CJK ) );
rEditSet.Put( SvxPostureItem ( eCtlItalic, EE_CHAR_ITALIC_CTL ) );
rEditSet.Put( SvxContourItem ( bOutline, EE_CHAR_OUTLINE ) );
rEditSet.Put( SvxShadowedItem ( bShadow, EE_CHAR_SHADOW ) );
rEditSet.Put( SvxForbiddenRuleItem(bForbidden, EE_PARA_FORBIDDENRULES) );
rEditSet.Put( SvxEmphasisMarkItem( eEmphasis, EE_CHAR_EMPHASISMARK ) );
rEditSet.Put( SvxCharReliefItem( eRelief, EE_CHAR_RELIEF ) );
rEditSet.Put( SvxLanguageItem ( eLang, EE_CHAR_LANGUAGE ) );
rEditSet.Put( SvxLanguageItem ( eCjkLang, EE_CHAR_LANGUAGE_CJK ) );
rEditSet.Put( SvxLanguageItem ( eCtlLang, EE_CHAR_LANGUAGE_CTL ) );
rEditSet.Put( SfxBoolItem ( EE_PARA_HYPHENATE, bHyphenate ) );
rEditSet.Put( SvxFrameDirectionItem( eDirection, EE_PARA_WRITINGDIR ) );
2011-02-27 23:59:21 +01:00
// Script spacing is always off.
// The cell attribute isn't used here as long as there is no UI to set it
// (don't evaluate attributes that can't be changed).
// If a locale-dependent default is needed, it has to go into the cell
// style, like the fonts.
rEditSet.Put( SvxScriptSpaceItem( false, EE_PARA_ASIANCJKSPACING ) );
2000-09-18 23:16:46 +00:00
}
void ScPatternAttr::FillEditItemSet( SfxItemSet* pEditSet, const SfxItemSet* pCondSet ) const
{
if( pEditSet )
FillToEditItemSet( *pEditSet, GetItemSet(), pCondSet );
}
void ScPatternAttr::GetFromEditItemSet( SfxItemSet& rDestSet, const SfxItemSet& rEditSet )
2000-09-18 23:16:46 +00:00
{
const SfxPoolItem* pItem;
if (rEditSet.GetItemState(EE_CHAR_COLOR,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxColorItem(ATTR_FONT_COLOR) = *static_cast<const SvxColorItem*>(pItem) );
2000-11-23 19:18:50 +00:00
if (rEditSet.GetItemState(EE_CHAR_FONTINFO,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxFontItem(ATTR_FONT) = *static_cast<const SvxFontItem*>(pItem) );
if (rEditSet.GetItemState(EE_CHAR_FONTINFO_CJK,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxFontItem(ATTR_CJK_FONT) = *static_cast<const SvxFontItem*>(pItem) );
if (rEditSet.GetItemState(EE_CHAR_FONTINFO_CTL,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxFontItem(ATTR_CTL_FONT) = *static_cast<const SvxFontItem*>(pItem) );
2000-11-23 19:18:50 +00:00
if (rEditSet.GetItemState(EE_CHAR_FONTHEIGHT,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxFontHeightItem( HMMToTwips( static_cast<const SvxFontHeightItem*>(pItem)->GetHeight() ),
2000-11-23 19:18:50 +00:00
100, ATTR_FONT_HEIGHT ) );
if (rEditSet.GetItemState(EE_CHAR_FONTHEIGHT_CJK,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxFontHeightItem( HMMToTwips( static_cast<const SvxFontHeightItem*>(pItem)->GetHeight() ),
2000-11-23 19:18:50 +00:00
100, ATTR_CJK_FONT_HEIGHT ) );
if (rEditSet.GetItemState(EE_CHAR_FONTHEIGHT_CTL,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxFontHeightItem( HMMToTwips( static_cast<const SvxFontHeightItem*>(pItem)->GetHeight() ),
2000-11-23 19:18:50 +00:00
100, ATTR_CTL_FONT_HEIGHT ) );
2000-09-18 23:16:46 +00:00
if (rEditSet.GetItemState(EE_CHAR_WEIGHT,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxWeightItem( static_cast<const SvxWeightItem*>(pItem)->GetValue(),
2000-09-18 23:16:46 +00:00
ATTR_FONT_WEIGHT) );
if (rEditSet.GetItemState(EE_CHAR_WEIGHT_CJK,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxWeightItem( static_cast<const SvxWeightItem*>(pItem)->GetValue(),
2000-11-23 19:18:50 +00:00
ATTR_CJK_FONT_WEIGHT) );
if (rEditSet.GetItemState(EE_CHAR_WEIGHT_CTL,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxWeightItem( static_cast<const SvxWeightItem*>(pItem)->GetValue(),
2000-11-23 19:18:50 +00:00
ATTR_CTL_FONT_WEIGHT) );
// SvxTextLineItem contains enum and color
if (rEditSet.GetItemState(EE_CHAR_UNDERLINE,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxUnderlineItem(LINESTYLE_NONE,ATTR_FONT_UNDERLINE) = *static_cast<const SvxUnderlineItem*>(pItem) );
if (rEditSet.GetItemState(EE_CHAR_OVERLINE,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxOverlineItem(LINESTYLE_NONE,ATTR_FONT_OVERLINE) = *static_cast<const SvxOverlineItem*>(pItem) );
if (rEditSet.GetItemState(EE_CHAR_WLM,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxWordLineModeItem( static_cast<const SvxWordLineModeItem*>(pItem)->GetValue(),
ATTR_FONT_WORDLINE) );
if (rEditSet.GetItemState(EE_CHAR_STRIKEOUT,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxCrossedOutItem( static_cast<const SvxCrossedOutItem*>(pItem)->GetValue(),
2000-09-18 23:16:46 +00:00
ATTR_FONT_CROSSEDOUT) );
2000-11-23 19:18:50 +00:00
if (rEditSet.GetItemState(EE_CHAR_ITALIC,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxPostureItem( static_cast<const SvxPostureItem*>(pItem)->GetValue(),
2000-09-18 23:16:46 +00:00
ATTR_FONT_POSTURE) );
if (rEditSet.GetItemState(EE_CHAR_ITALIC_CJK,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxPostureItem( static_cast<const SvxPostureItem*>(pItem)->GetValue(),
2000-11-23 19:18:50 +00:00
ATTR_CJK_FONT_POSTURE) );
if (rEditSet.GetItemState(EE_CHAR_ITALIC_CTL,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxPostureItem( static_cast<const SvxPostureItem*>(pItem)->GetValue(),
2000-11-23 19:18:50 +00:00
ATTR_CTL_FONT_POSTURE) );
if (rEditSet.GetItemState(EE_CHAR_OUTLINE,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxContourItem( static_cast<const SvxContourItem*>(pItem)->GetValue(),
2000-09-18 23:16:46 +00:00
ATTR_FONT_CONTOUR) );
if (rEditSet.GetItemState(EE_CHAR_SHADOW,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxShadowedItem( static_cast<const SvxShadowedItem*>(pItem)->GetValue(),
2000-09-18 23:16:46 +00:00
ATTR_FONT_SHADOWED) );
if (rEditSet.GetItemState(EE_CHAR_EMPHASISMARK,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxEmphasisMarkItem( static_cast<const SvxEmphasisMarkItem*>(pItem)->GetEmphasisMark(),
2001-04-24 16:31:21 +00:00
ATTR_FONT_EMPHASISMARK) );
if (rEditSet.GetItemState(EE_CHAR_RELIEF,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxCharReliefItem( static_cast<const SvxCharReliefItem*>(pItem)->GetValue(),
ATTR_FONT_RELIEF) );
2000-11-23 19:18:50 +00:00
if (rEditSet.GetItemState(EE_CHAR_LANGUAGE,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxLanguageItem(static_cast<const SvxLanguageItem*>(pItem)->GetValue(), ATTR_FONT_LANGUAGE) );
if (rEditSet.GetItemState(EE_CHAR_LANGUAGE_CJK,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxLanguageItem(static_cast<const SvxLanguageItem*>(pItem)->GetValue(), ATTR_CJK_FONT_LANGUAGE) );
if (rEditSet.GetItemState(EE_CHAR_LANGUAGE_CTL,true,&pItem) == SfxItemState::SET)
rDestSet.Put( SvxLanguageItem(static_cast<const SvxLanguageItem*>(pItem)->GetValue(), ATTR_CTL_FONT_LANGUAGE) );
if (rEditSet.GetItemState(EE_PARA_JUST,true,&pItem) == SfxItemState::SET)
2000-09-18 23:16:46 +00:00
{
SvxCellHorJustify eVal;
switch ( static_cast<const SvxAdjustItem*>(pItem)->GetAdjust() )
2000-09-18 23:16:46 +00:00
{
case SvxAdjust::Left:
// EditEngine Default is always set in the GetAttribs() ItemSet !
// whether left or right, is decided in text / number
eVal = SvxCellHorJustify::Standard;
2000-09-18 23:16:46 +00:00
break;
case SvxAdjust::Right:
eVal = SvxCellHorJustify::Right;
2000-09-18 23:16:46 +00:00
break;
case SvxAdjust::Block:
eVal = SvxCellHorJustify::Block;
2000-09-18 23:16:46 +00:00
break;
case SvxAdjust::Center:
eVal = SvxCellHorJustify::Center;
2000-09-18 23:16:46 +00:00
break;
case SvxAdjust::BlockLine:
eVal = SvxCellHorJustify::Block;
2000-09-18 23:16:46 +00:00
break;
case SvxAdjust::End:
eVal = SvxCellHorJustify::Right;
2000-09-18 23:16:46 +00:00
break;
default:
eVal = SvxCellHorJustify::Standard;
2000-09-18 23:16:46 +00:00
}
if ( eVal != SvxCellHorJustify::Standard )
rDestSet.Put( SvxHorJustifyItem( eVal, ATTR_HOR_JUSTIFY) );
2000-09-18 23:16:46 +00:00
}
}
void ScPatternAttr::GetFromEditItemSet( const SfxItemSet* pEditSet )
{
if( pEditSet )
GetFromEditItemSet( GetItemSet(), *pEditSet );
}
2000-09-18 23:16:46 +00:00
void ScPatternAttr::FillEditParaItems( SfxItemSet* pEditSet ) const
{
// already there in GetFromEditItemSet, but not in FillEditItemSet
// Default horizontal alignment is always implemented as left
2000-09-18 23:16:46 +00:00
const SfxItemSet& rMySet = GetItemSet();
SvxCellHorJustify eHorJust = (SvxCellHorJustify)
static_cast<const SvxHorJustifyItem&>(rMySet.Get(ATTR_HOR_JUSTIFY)).GetValue();
2000-09-18 23:16:46 +00:00
SvxAdjust eSvxAdjust;
switch (eHorJust)
{
case SvxCellHorJustify::Right: eSvxAdjust = SvxAdjust::Right; break;
case SvxCellHorJustify::Center: eSvxAdjust = SvxAdjust::Center; break;
case SvxCellHorJustify::Block: eSvxAdjust = SvxAdjust::Block; break;
default: eSvxAdjust = SvxAdjust::Left; break;
2000-09-18 23:16:46 +00:00
}
pEditSet->Put( SvxAdjustItem( eSvxAdjust, EE_PARA_JUST ) );
}
void ScPatternAttr::DeleteUnchanged( const ScPatternAttr* pOldAttrs )
{
2001-04-19 17:49:33 +00:00
SfxItemSet& rThisSet = GetItemSet();
const SfxItemSet& rOldSet = pOldAttrs->GetItemSet();
const SfxPoolItem* pThisItem;
const SfxPoolItem* pOldItem;
2000-09-18 23:16:46 +00:00
for ( sal_uInt16 nSubWhich=ATTR_PATTERN_START; nSubWhich<=ATTR_PATTERN_END; nSubWhich++ )
2000-09-18 23:16:46 +00:00
{
2001-04-19 17:49:33 +00:00
// only items that are set are interesting
if ( rThisSet.GetItemState( nSubWhich, false, &pThisItem ) == SfxItemState::SET )
2001-04-19 17:49:33 +00:00
{
2011-11-10 15:54:13 +01:00
SfxItemState eOldState = rOldSet.GetItemState( nSubWhich, true, &pOldItem );
if ( eOldState == SfxItemState::SET )
2001-04-19 17:49:33 +00:00
{
// item is set in OldAttrs (or its parent) -> compare pointers
if ( pThisItem == pOldItem )
rThisSet.ClearItem( nSubWhich );
2001-04-19 17:49:33 +00:00
}
else if ( eOldState != SfxItemState::DONTCARE )
2001-04-19 17:49:33 +00:00
{
// not set in OldAttrs -> compare item value to default item
if ( *pThisItem == rThisSet.GetPool()->GetDefaultItem( nSubWhich ) )
rThisSet.ClearItem( nSubWhich );
2001-04-19 17:49:33 +00:00
}
}
2000-09-18 23:16:46 +00:00
}
}
2011-11-10 15:54:13 +01:00
bool ScPatternAttr::HasItemsSet( const sal_uInt16* pWhich ) const
2000-09-18 23:16:46 +00:00
{
const SfxItemSet& rSet = GetItemSet();
for (sal_uInt16 i=0; pWhich[i]; i++)
if ( rSet.GetItemState( pWhich[i], false ) == SfxItemState::SET )
2011-11-10 15:54:13 +01:00
return true;
return false;
2000-09-18 23:16:46 +00:00
}
void ScPatternAttr::ClearItems( const sal_uInt16* pWhich )
2000-09-18 23:16:46 +00:00
{
SfxItemSet& rSet = GetItemSet();
for (sal_uInt16 i=0; pWhich[i]; i++)
2000-09-18 23:16:46 +00:00
rSet.ClearItem(pWhich[i]);
}
static SfxStyleSheetBase* lcl_CopyStyleToPool
2000-09-18 23:16:46 +00:00
(
SfxStyleSheetBase* pSrcStyle,
SfxStyleSheetBasePool* pSrcPool,
SfxStyleSheetBasePool* pDestPool,
const SvNumberFormatterIndexTable* pFormatExchangeList
2000-09-18 23:16:46 +00:00
)
{
if ( !pSrcStyle || !pDestPool || !pSrcPool )
{
2011-03-01 19:05:02 +01:00
OSL_FAIL( "CopyStyleToPool: Invalid Arguments :-/" );
return nullptr;
2000-09-18 23:16:46 +00:00
}
const OUString aStrSrcStyle = pSrcStyle->GetName();
2000-09-18 23:16:46 +00:00
const SfxStyleFamily eFamily = pSrcStyle->GetFamily();
SfxStyleSheetBase* pDestStyle = pDestPool->Find( aStrSrcStyle, eFamily );
if ( !pDestStyle )
{
const OUString aStrParent = pSrcStyle->GetParent();
const SfxItemSet& rSrcSet = pSrcStyle->GetItemSet();
2000-09-18 23:16:46 +00:00
pDestStyle = &pDestPool->Make( aStrSrcStyle, eFamily, SFXSTYLEBIT_USERDEF );
SfxItemSet& rDestSet = pDestStyle->GetItemSet();
rDestSet.Put( rSrcSet );
2011-02-27 23:59:21 +01:00
// number format exchange list has to be handled here, too
// (only called for cell styles)
const SfxPoolItem* pSrcItem;
if ( pFormatExchangeList &&
rSrcSet.GetItemState( ATTR_VALUE_FORMAT, false, &pSrcItem ) == SfxItemState::SET )
{
sal_uLong nOldFormat = static_cast<const SfxUInt32Item*>(pSrcItem)->GetValue();
SvNumberFormatterIndexTable::const_iterator it = pFormatExchangeList->find(nOldFormat);
if (it != pFormatExchangeList->end())
{
sal_uInt32 nNewFormat = it->second;
rDestSet.Put( SfxUInt32Item( ATTR_VALUE_FORMAT, nNewFormat ) );
}
}
2000-09-18 23:16:46 +00:00
// if necessary create derivative Styles, if not available:
2000-09-18 23:16:46 +00:00
if ( ScGlobal::GetRscString(STR_STYLENAME_STANDARD) != aStrParent &&
aStrSrcStyle != aStrParent &&
!pDestPool->Find( aStrParent, eFamily ) )
{
lcl_CopyStyleToPool( pSrcPool->Find( aStrParent, eFamily ),
pSrcPool, pDestPool, pFormatExchangeList );
2000-09-18 23:16:46 +00:00
}
pDestStyle->SetParent( aStrParent );
}
return pDestStyle;
}
ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcDoc ) const
{
const SfxItemSet* pSrcSet = &GetItemSet();
std::unique_ptr<ScPatternAttr> pDestPattern( new ScPatternAttr(pDestDoc->GetPool()) );
2000-09-18 23:16:46 +00:00
SfxItemSet* pDestSet = &pDestPattern->GetItemSet();
// Copy cell pattern style to other document:
2000-09-18 23:16:46 +00:00
if ( pDestDoc != pSrcDoc )
{
OSL_ENSURE( pStyle, "Missing Pattern-Style! :-/" );
2000-09-18 23:16:46 +00:00
// if pattern in DestDoc is available, use this, otherwise copy
// parent style to style or create if necessary and attach DestDoc
2000-09-18 23:16:46 +00:00
SfxStyleSheetBase* pStyleCpy = lcl_CopyStyleToPool( pStyle,
pSrcDoc->GetStyleSheetPool(),
pDestDoc->GetStyleSheetPool(),
pDestDoc->GetFormatExchangeList() );
2000-09-18 23:16:46 +00:00
pDestPattern->SetStyleSheet( static_cast<ScStyleSheet*>(pStyleCpy) );
2000-09-18 23:16:46 +00:00
}
for ( sal_uInt16 nAttrId = ATTR_PATTERN_START; nAttrId <= ATTR_PATTERN_END; nAttrId++ )
2000-09-18 23:16:46 +00:00
{
const SfxPoolItem* pSrcItem;
SfxItemState eItemState = pSrcSet->GetItemState( nAttrId, false, &pSrcItem );
if (eItemState==SfxItemState::SET)
2000-09-18 23:16:46 +00:00
{
SfxPoolItem* pNewItem = nullptr;
2000-09-18 23:16:46 +00:00
if ( nAttrId == ATTR_VALIDDATA )
2000-09-18 23:16:46 +00:00
{
// Copy validity to the new document
2000-09-18 23:16:46 +00:00
sal_uLong nNewIndex = 0;
2000-09-18 23:16:46 +00:00
ScValidationDataList* pSrcList = pSrcDoc->GetValidationList();
if ( pSrcList )
{
sal_uLong nOldIndex = static_cast<const SfxUInt32Item*>(pSrcItem)->GetValue();
2000-09-18 23:16:46 +00:00
const ScValidationData* pOldData = pSrcList->GetData( nOldIndex );
if ( pOldData )
nNewIndex = pDestDoc->AddValidationEntry( *pOldData );
}
pNewItem = new SfxUInt32Item( ATTR_VALIDDATA, nNewIndex );
}
else if ( nAttrId == ATTR_VALUE_FORMAT && pDestDoc->GetFormatExchangeList() )
{
// Number format to Exchange List
2000-09-18 23:16:46 +00:00
sal_uLong nOldFormat = static_cast<const SfxUInt32Item*>(pSrcItem)->GetValue();
SvNumberFormatterIndexTable::const_iterator it = pDestDoc->GetFormatExchangeList()->find(nOldFormat);
if (it != pDestDoc->GetFormatExchangeList()->end())
{
sal_uInt32 nNewFormat = it->second;
pNewItem = new SfxUInt32Item( ATTR_VALUE_FORMAT, nNewFormat );
}
2000-09-18 23:16:46 +00:00
}
if ( pNewItem )
{
pDestSet->Put(*pNewItem);
delete pNewItem;
}
else
pDestSet->Put(*pSrcItem);
}
}
ScPatternAttr* pPatternAttr =
const_cast<ScPatternAttr*>( static_cast<const ScPatternAttr*>( &pDestDoc->GetPool()->Put(*pDestPattern) ) );
2000-09-18 23:16:46 +00:00
return pPatternAttr;
}
2011-11-10 15:54:13 +01:00
bool ScPatternAttr::IsVisible() const
2000-09-18 23:16:46 +00:00
{
const SfxItemSet& rSet = GetItemSet();
const SfxPoolItem* pItem;
SfxItemState eState;
2011-11-10 15:54:13 +01:00
eState = rSet.GetItemState( ATTR_BACKGROUND, true, &pItem );
if ( eState == SfxItemState::SET )
if ( static_cast<const SvxBrushItem*>(pItem)->GetColor().GetColor() != COL_TRANSPARENT )
2011-11-10 15:54:13 +01:00
return true;
2000-09-18 23:16:46 +00:00
2011-11-10 15:54:13 +01:00
eState = rSet.GetItemState( ATTR_BORDER, true, &pItem );
if ( eState == SfxItemState::SET )
2000-09-18 23:16:46 +00:00
{
const SvxBoxItem* pBoxItem = static_cast<const SvxBoxItem*>(pItem);
2000-09-18 23:16:46 +00:00
if ( pBoxItem->GetTop() || pBoxItem->GetBottom() ||
pBoxItem->GetLeft() || pBoxItem->GetRight() )
2011-11-10 15:54:13 +01:00
return true;
2000-09-18 23:16:46 +00:00
}
2011-11-10 15:54:13 +01:00
eState = rSet.GetItemState( ATTR_BORDER_TLBR, true, &pItem );
if ( eState == SfxItemState::SET )
if( static_cast< const SvxLineItem* >( pItem )->GetLine() )
2011-11-10 15:54:13 +01:00
return true;
2011-11-10 15:54:13 +01:00
eState = rSet.GetItemState( ATTR_BORDER_BLTR, true, &pItem );
if ( eState == SfxItemState::SET )
if( static_cast< const SvxLineItem* >( pItem )->GetLine() )
2011-11-10 15:54:13 +01:00
return true;
2011-11-10 15:54:13 +01:00
eState = rSet.GetItemState( ATTR_SHADOW, true, &pItem );
if ( eState == SfxItemState::SET )
if ( static_cast<const SvxShadowItem*>(pItem)->GetLocation() != SvxShadowLocation::NONE )
2011-11-10 15:54:13 +01:00
return true;
2000-09-18 23:16:46 +00:00
return false;
2000-09-18 23:16:46 +00:00
}
2011-11-10 15:54:13 +01:00
inline bool OneEqual( const SfxItemSet& rSet1, const SfxItemSet& rSet2, sal_uInt16 nId )
2000-09-18 23:16:46 +00:00
{
const SfxPoolItem* pItem1 = &rSet1.Get(nId);
const SfxPoolItem* pItem2 = &rSet2.Get(nId);
return ( pItem1 == pItem2 || *pItem1 == *pItem2 );
}
2011-11-10 15:54:13 +01:00
bool ScPatternAttr::IsVisibleEqual( const ScPatternAttr& rOther ) const
2000-09-18 23:16:46 +00:00
{
const SfxItemSet& rThisSet = GetItemSet();
const SfxItemSet& rOtherSet = rOther.GetItemSet();
return OneEqual( rThisSet, rOtherSet, ATTR_BACKGROUND ) &&
OneEqual( rThisSet, rOtherSet, ATTR_BORDER ) &&
OneEqual( rThisSet, rOtherSet, ATTR_BORDER_TLBR ) &&
OneEqual( rThisSet, rOtherSet, ATTR_BORDER_BLTR ) &&
2000-09-18 23:16:46 +00:00
OneEqual( rThisSet, rOtherSet, ATTR_SHADOW );
//TODO: also here only check really visible values !!!
2000-09-18 23:16:46 +00:00
}
const OUString* ScPatternAttr::GetStyleName() const
2000-09-18 23:16:46 +00:00
{
return pName ? pName.get() : ( pStyle ? &pStyle->GetName() : nullptr );
2000-09-18 23:16:46 +00:00
}
void ScPatternAttr::SetStyleSheet( ScStyleSheet* pNewStyle, bool bClearDirectFormat )
2000-09-18 23:16:46 +00:00
{
if (pNewStyle)
{
SfxItemSet& rPatternSet = GetItemSet();
const SfxItemSet& rStyleSet = pNewStyle->GetItemSet();
if (bClearDirectFormat)
2000-09-18 23:16:46 +00:00
{
for (sal_uInt16 i=ATTR_PATTERN_START; i<=ATTR_PATTERN_END; i++)
{
if (rStyleSet.GetItemState(i) == SfxItemState::SET)
rPatternSet.ClearItem(i);
}
2000-09-18 23:16:46 +00:00
}
rPatternSet.SetParent(&pNewStyle->GetItemSet());
pStyle = pNewStyle;
pName.reset();
2000-09-18 23:16:46 +00:00
}
else
{
2011-03-01 19:05:02 +01:00
OSL_FAIL( "ScPatternAttr::SetStyleSheet( NULL ) :-|" );
GetItemSet().SetParent(nullptr);
pStyle = nullptr;
2000-09-18 23:16:46 +00:00
}
}
void ScPatternAttr::UpdateStyleSheet(ScDocument* pDoc)
2000-09-18 23:16:46 +00:00
{
if (pName)
{
pStyle = static_cast<ScStyleSheet*>(pDoc->GetStyleSheetPool()->Find(*pName, SfxStyleFamily::Para));
2000-09-18 23:16:46 +00:00
// use Standard if Style is not found,
// to avoid empty display in Toolbox-Controller
// Assumes that "Standard" is always the 1st entry!
2000-09-18 23:16:46 +00:00
if (!pStyle)
{
std::shared_ptr<SfxStyleSheetIterator> pIter = pDoc->GetStyleSheetPool()->CreateIterator( SfxStyleFamily::Para, SFXSTYLEBIT_ALL );
pStyle = dynamic_cast< ScStyleSheet* >(pIter->First());
2000-09-18 23:16:46 +00:00
}
if (pStyle)
{
GetItemSet().SetParent(&pStyle->GetItemSet());
pName.reset();
2000-09-18 23:16:46 +00:00
}
}
else
pStyle = nullptr;
2000-09-18 23:16:46 +00:00
}
void ScPatternAttr::StyleToName()
{
// Style was deleted, remember name:
2000-09-18 23:16:46 +00:00
if ( pStyle )
{
if ( pName )
*pName = pStyle->GetName();
else
pName.reset( new OUString( pStyle->GetName() ) );
2000-09-18 23:16:46 +00:00
pStyle = nullptr;
GetItemSet().SetParent( nullptr );
2000-09-18 23:16:46 +00:00
}
}
2011-11-10 15:54:13 +01:00
bool ScPatternAttr::IsSymbolFont() const
2000-09-18 23:16:46 +00:00
{
const SfxPoolItem* pItem;
if( GetItemSet().GetItemState( ATTR_FONT, true, &pItem ) == SfxItemState::SET )
return static_cast<const SvxFontItem*>(pItem)->GetCharSet() == RTL_TEXTENCODING_SYMBOL;
2000-09-18 23:16:46 +00:00
else
return false;
2000-09-18 23:16:46 +00:00
}
namespace {
sal_uInt32 getNumberFormatKey(const SfxItemSet& rSet)
{
return static_cast<const SfxUInt32Item&>(rSet.Get(ATTR_VALUE_FORMAT)).GetValue();
}
LanguageType getLanguageType(const SfxItemSet& rSet)
{
return static_cast<const SvxLanguageItem&>(rSet.Get(ATTR_LANGUAGE_FORMAT)).GetLanguage();
}
}
sal_uLong ScPatternAttr::GetNumberFormat( SvNumberFormatter* pFormatter ) const
2000-09-18 23:16:46 +00:00
{
sal_uLong nFormat = getNumberFormatKey(GetItemSet());
LanguageType eLang = getLanguageType(GetItemSet());
2000-09-18 23:16:46 +00:00
if ( nFormat < SV_COUNTRY_LANGUAGE_OFFSET && eLang == LANGUAGE_SYSTEM )
; // it remains as it is
2000-09-18 23:16:46 +00:00
else if ( pFormatter )
nFormat = pFormatter->GetFormatForLanguageIfBuiltIn( nFormat, eLang );
return nFormat;
}
// the same if conditional formatting is in play:
2000-09-18 23:16:46 +00:00
sal_uLong ScPatternAttr::GetNumberFormat( SvNumberFormatter* pFormatter,
2000-09-18 23:16:46 +00:00
const SfxItemSet* pCondSet ) const
{
assert(pFormatter);
if (!pCondSet)
return GetNumberFormat(pFormatter);
2000-09-18 23:16:46 +00:00
/* In the case of a conditional format we need to overwrite a cell style
* but leave a hard cell formatting alone. So check first if the number
* format is set in the cell format, then the conditional format and
* finally in the style.
*
* The style is represented here if the name is empty.
*/
2000-09-18 23:16:46 +00:00
const SfxPoolItem* pFormItem;
sal_uLong nFormat = 0;
if (GetItemSet().GetItemState(ATTR_VALUE_FORMAT, false, &pFormItem) == SfxItemState::SET)
nFormat = static_cast<const SfxUInt32Item*>(pFormItem)->GetValue();
else if (pCondSet->GetItemState(ATTR_VALUE_FORMAT, true, &pFormItem) == SfxItemState::SET )
nFormat = getNumberFormatKey(*pCondSet);
else
nFormat = getNumberFormatKey(GetItemSet());
2000-09-18 23:16:46 +00:00
const SfxPoolItem* pLangItem;
LanguageType eLang;
if (GetItemSet().GetItemState(ATTR_LANGUAGE_FORMAT, false, &pLangItem) == SfxItemState::SET)
eLang = static_cast<const SvxLanguageItem*>(pLangItem)->GetLanguage();
else if (pCondSet->GetItemState(ATTR_LANGUAGE_FORMAT, true, &pLangItem) == SfxItemState::SET)
eLang = getLanguageType(*pCondSet);
else
eLang = getLanguageType(GetItemSet());
2000-09-18 23:16:46 +00:00
return pFormatter->GetFormatForLanguageIfBuiltIn(nFormat, eLang);
2000-09-18 23:16:46 +00:00
}
const SfxPoolItem& ScPatternAttr::GetItem( sal_uInt16 nWhich, const SfxItemSet& rItemSet, const SfxItemSet* pCondSet )
2000-09-18 23:16:46 +00:00
{
const SfxPoolItem* pCondItem;
if ( pCondSet && pCondSet->GetItemState( nWhich, true, &pCondItem ) == SfxItemState::SET )
2000-09-18 23:16:46 +00:00
return *pCondItem;
return rItemSet.Get(nWhich);
}
2000-09-18 23:16:46 +00:00
const SfxPoolItem& ScPatternAttr::GetItem( sal_uInt16 nSubWhich, const SfxItemSet* pCondSet ) const
{
return GetItem( nSubWhich, GetItemSet(), pCondSet );
2000-09-18 23:16:46 +00:00
}
// GetRotateVal is tested before ATTR_ORIENTATION
2000-09-18 23:16:46 +00:00
long ScPatternAttr::GetRotateVal( const SfxItemSet* pCondSet ) const
{
long nAttrRotate = 0;
if ( GetCellOrientation() == SVX_ORIENTATION_STANDARD )
2000-09-18 23:16:46 +00:00
{
2011-11-10 15:54:13 +01:00
bool bRepeat = ( static_cast<const SvxHorJustifyItem&>(GetItem(ATTR_HOR_JUSTIFY, pCondSet)).
GetValue() == SvxCellHorJustify::Repeat );
// ignore orientation/rotation if "repeat" is active
if ( !bRepeat )
nAttrRotate = static_cast<const SfxInt32Item&>(GetItem( ATTR_ROTATE_VALUE, pCondSet )).GetValue();
2000-09-18 23:16:46 +00:00
}
return nAttrRotate;
}
ScRotateDir ScPatternAttr::GetRotateDir( const SfxItemSet* pCondSet ) const
2000-09-18 23:16:46 +00:00
{
ScRotateDir nRet = ScRotateDir::NONE;
2000-09-18 23:16:46 +00:00
long nAttrRotate = GetRotateVal( pCondSet );
if ( nAttrRotate )
{
SvxRotateMode eRotMode = static_cast<const SvxRotateModeItem&>(
2000-09-18 23:16:46 +00:00
GetItem(ATTR_ROTATE_MODE, pCondSet)).GetValue();
if ( eRotMode == SVX_ROTATE_MODE_STANDARD || nAttrRotate == 18000 )
nRet = ScRotateDir::Standard;
2000-09-18 23:16:46 +00:00
else if ( eRotMode == SVX_ROTATE_MODE_CENTER )
nRet = ScRotateDir::Center;
2000-09-18 23:16:46 +00:00
else if ( eRotMode == SVX_ROTATE_MODE_TOP || eRotMode == SVX_ROTATE_MODE_BOTTOM )
{
long nRot180 = nAttrRotate % 18000; // 1/100 degrees
2000-09-18 23:16:46 +00:00
if ( nRot180 == 9000 )
nRet = ScRotateDir::Center;
2000-09-18 23:16:46 +00:00
else if ( ( eRotMode == SVX_ROTATE_MODE_TOP && nRot180 < 9000 ) ||
( eRotMode == SVX_ROTATE_MODE_BOTTOM && nRot180 > 9000 ) )
nRet = ScRotateDir::Left;
2000-09-18 23:16:46 +00:00
else
nRet = ScRotateDir::Right;
2000-09-18 23:16:46 +00:00
}
}
return nRet;
}
void ScPatternAttr::SetKey(sal_uInt64 nKey)
{
mnKey = nKey;
}
sal_uInt64 ScPatternAttr::GetKey() const
{
return mnKey;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */