2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
re-base on ALv2 code. Includes (at least) relevant parts of:
linecap: Reintegrating finished LineCap feature
Patch contributed by Regina Henschel
http://svn.apache.org/viewvc?view=revision&revision=1232507
Patches contributed by Sven Jacobi
impress212: #i81610# fixed animation export
http://svn.apache.org/viewvc?view=revision&revision=1167620
impress212: drawinglayer gbuild environment changes
http://svn.apache.org/viewvc?view=revision&revision=1167627
http://svn.apache.org/viewvc?view=revision&revision=1167628
impress212: DffPropSet -> minor code improvements, removing table
http://svn.apache.org/viewvc?view=revision&revision=1167634
impress212: #158494# fixed excel import (text rotation)
http://svn.apache.org/viewvc?view=revision&revision=1167638
Patches contributed by Armin Le Grand
Svg: Reintegrated Svg replacement from /branches/alg/svgreplavement
http://svn.apache.org/viewvc?view=revision&revision=1220836
#118728# changed indentifying definitions for Svg file detection
http://svn.apache.org/viewvc?view=revision&revision=1229961
#118838# LineGeometry creation for complicated cases optimized to
create single Polygons
http://svn.apache.org/viewvc?view=revision&revision=1236232
#119176# corrected file type detection for SVG for svg files
without xml header
http://svn.apache.org/viewvc?view=revision&revision=1309445
#118728# Extended Svg file detection
http://svn.apache.org/viewvc?view=revision&revision=1230531
#118529# solve break converters and convert commands for OLEs and images
http://svn.apache.org/viewvc?view=revision&revision=1186168
svg: added WaE changes from branch svgreplacement to trunc
http://svn.apache.org/viewvc?view=revision&revision=1222974
svg: corrected missing member initialization
http://svn.apache.org/viewvc?view=revision&revision=1226134
fix for #118525#: Using primitives for chart sub-geometry visualisation
http://svn.apache.org/viewvc?view=revision&revision=1226879
#118898# Adapted ImpGraphic::ImplGetBitmap to correctly convert
metafiles to bitmapEx ...
http://svn.apache.org/viewvc?view=revision&revision=1293316
fix for #118525#: removed no longer used variable maOriginalMapMode, one
more exception eliminated
http://svn.apache.org/viewvc?view=revision&revision=1227097
#16758# Added buffering to the VDev usages of the VclProcessor2D derivates...
http://svn.apache.org/viewvc?view=revision&revision=1229521
#116758# Secured VDev buffer device to Vcl deinit
http://svn.apache.org/viewvc?view=revision&revision=1230574
#116758# added remembering allocated VDevs for VDevBuffer to be able to also
delete these when vcl goes down; it should never happen, but You never know
http://svn.apache.org/viewvc?view=revision&revision=1230927
#118730# Changed SvgClipPathNode to use MaskPrimitive2D for primitive
representation instead of TransparencePrimitive2D
http://svn.apache.org/viewvc?view=revision&revision=1231198
#118822# secured 3D geometry creation (slices) by subdividing the 2D
source polyPolygon early
http://svn.apache.org/viewvc?view=revision&revision=1234749
#118829# enhanced Svg gradient quality, obstacles avoided
http://svn.apache.org/viewvc?view=revision&revision=1235361
#118834# Unified usage of TextBreakupHelper as single tooling class
for i18n text primitive breakup
http://svn.apache.org/viewvc?view=revision&revision=1236110
#118853# added square pixel size limit to conversion of
TransparencePrimitive2D to Metafile action
http://svn.apache.org/viewvc?view=revision&revision=1237656
#118824# coreccted mirroring and boundrect when the graphicmanager
is used for bitmap output
http://svn.apache.org/viewvc?view=revision&revision=1240097
#115092# Corrected VclProcessor2D::RenderPolygonStrokePrimitive2D for
various optimization scenarios
http://svn.apache.org/viewvc?view=revision&revision=1241434
#118783# Corrected errors in ID strings, corrected Svg line/fill export,
corrected polygon close state
http://svn.apache.org/viewvc?view=revision&revision=1232006
#118796# corrected null-pointer usage in SVG text exporter
http://svn.apache.org/viewvc?view=revision&revision=1240262
#118729# Use GraphicStreamUrl and GraphicUrl to allow multi image
import with linked graphics, too
http://svn.apache.org/viewvc?view=revision&revision=1229962
#118898# corrected error in GDIMetaFile::GetBoundRect in handling
MetaFloatTransparentAction
http://svn.apache.org/viewvc?view=revision&revision=1293349
#118855# Corrected handling of possibly created empty clipRegions
after PolyPolygon clipping
http://svn.apache.org/viewvc?view=revision&revision=1237725
#115962# Better (but not yet optimal, see comments in task) handling
of MetaFloatTransparentAction in PDF export
http://svn.apache.org/viewvc?view=revision&revision=1241078
IP clearance: #118466# This patch removes librsvg, libcroco, libgsf, ...
http://svn.apache.org/viewvc?view=revision&revision=1200879
118779# Added svg content streaming in/out to ImpGraphic stream operators
http://svn.apache.org/viewvc?view=revision&revision=1231908
linecap: correctons for WaE and mac drawing
http://svn.apache.org/viewvc?view=revision&revision=1232793
svg: uses current system Dpi for Svg replacement image creation
http://svn.apache.org/viewvc?view=revision&revision=1233948
Patches contributed by Mathias Bauer (and others)
gnumake4 work variously
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
http://svn.apache.org/viewvc?view=revision&revision=1394326
Remove duplicate header includes.
cws mba34issues01: #i117720#: convert assertion into warning
http://svn.apache.org/viewvc?view=revision&revision=1172352
118485 - Styles for OLEs are not saved. Submitted by Armin Le Grand.
http://svn.apache.org/viewvc?view=revision&revision=1182166
cws mba34issues01: #i117714#: remove assertion
http://svn.apache.org/viewvc?view=revision&revision=1172357
Patch contributed by Jurgen Schmidt
add some additional checks to ensure proper reading operations
http://svn.apache.org/viewvc?view=revision&revision=1209022
mostly prefer our stream / bounds checking work.
Patches contributed by Herbert Duerr
#i118816# add clarifying comment regarding Font::*Color*() methods
http://svn.apache.org/viewvc?view=revision&revision=1233833
extend macro->string handling for empty strings
http://svn.apache.org/viewvc?view=revision&revision=1175801
avoid magic constants for SALCOLOR_NONE
http://svn.apache.org/viewvc?view=revision&revision=1177543
initialize slant properly in ImplFontMetricData constructor (author=iorsh)
http://svn.apache.org/viewvc?view=revision&revision=1177551
#i118675# make check for extension updates more stable
http://svn.apache.org/viewvc?view=revision&revision=1214797
#a118617# remove VBasicEventListener.dll binary
There are no known users depending on its CLSID
http://svn.apache.org/viewvc?view=revision&revision=1203697
Patches contributed by Ariel Constenla-Haile
Fix build breaker on Linux/gcc
http://svn.apache.org/viewvc?view=revision&revision=1221104
Fix crash when trying to instantiate css.graphic.GraphicRasterizer_RSVG
http://svn.apache.org/viewvc?view=revision&revision=1215559
Patches contributed by Oliver-Rainer Wittmann
sw34bf06: #i117962# - method <SwFlyFrm::IsPaint(..)> - consider
instances of <SwFlyDrawObj>
http://svn.apache.org/viewvc?view=revision&revision=1172120
sw34bf06: #i117783# - Writer's implementation of XPagePrintable -
apply print settings to new printing routines
http://svn.apache.org/viewvc?view=revision&revision=1172115
gnumake4 work variously from Hans-Joachim Lankenau
http://svn.apache.org/viewvc?view=revision&revision=1397315
http://svn.apache.org/viewvc?view=revision&revision=1396797
http://svn.apache.org/viewvc?view=revision&revision=1396782
http://svn.apache.org/viewvc?view=revision&revision=1394707
plus some amount of re-splitting of legacy headers.
Patch contributed by Pavel Janik
WaE: Remove unused variables.
http://svn.apache.org/viewvc?view=revision&revision=1230697
Patches contributed by Takashi Ono
mingwport35: i#117795: MinGW port fix for vcl2gnumake
http://svn.apache.org/viewvc?view=revision&revision=1172091
mingwport35: i#117795: MinGW port fix for vcl2gnumake
http://svn.apache.org/viewvc?view=revision&revision=1172091
Patch contributed by Christian Lippka
impress212: #i98044# re enable Text menu for outline and title shapes
http://svn.apache.org/viewvc?view=revision&revision=1167639
Patch contributed by Andre Fischer
118674: Made category B code optional and disabled by default.
http://svn.apache.org/viewvc?view=revision&revision=1215131
118881: Ignore empty paragraphs after bullets.
http://svn.apache.org/viewvc?view=revision&revision=1296205
Patches contributed by Philipp Lohmann
ooo340fixes: #i117780# use rtl allocator
http://svn.apache.org/viewvc?view=revision&revision=1172087
ooo34gsl02: #i117807# fix an off by one error (index actually
inside the pfb section header)
http://svn.apache.org/viewvc?view=revision&revision=1167576
various cleanups, related compilation fixes, warning cleanups, re-working
of obsolete stl template pieces to use boost instead, changed string
classes, re-adapt KDE about data, about dialog, fixing warnings,
and other fixes & improvements.
Disable svg import / render for about/ branding code-paths for now.
Restore full icon theme set.
Remove OS/2 conditionals and sources.
Remove conflicting gtk/full-screen monitors support.
Retain existing svg rasterizer files - temporarily disabled.
Standardize stringificaiton and fixup dllpostfix issues.
Rename SvgGradientHelper::== to equalTo to avoid overloading issues.
Use the flat GdiPlus API for LineCaps calls.
2012-10-09 12:22:23 +01: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 .
|
|
|
|
*/
|
2006-10-19 09:40:02 +00:00
|
|
|
|
2014-11-03 18:11:01 +01:00
|
|
|
#include <sal/config.h>
|
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
|
2006-10-19 09:40:02 +00:00
|
|
|
#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
|
2011-05-11 11:24:22 +01:00
|
|
|
#include <comphelper/processfactory.hxx>
|
2015-02-17 13:43:17 +00:00
|
|
|
#include <comphelper/unique_disposing_ptr.hxx>
|
2006-10-19 09:40:02 +00:00
|
|
|
#include <vcl/timer.hxx>
|
|
|
|
#include <vcl/virdev.hxx>
|
|
|
|
#include <vcl/font.hxx>
|
2007-02-14 13:53:01 +00:00
|
|
|
#include <vcl/metric.hxx>
|
2013-04-05 18:40:39 +02:00
|
|
|
#include <i18nlangtag/languagetag.hxx>
|
2006-10-19 09:40:02 +00:00
|
|
|
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
|
2009-09-17 10:29:02 +00:00
|
|
|
#include <vcl/svapp.hxx>
|
2007-11-19 09:21:42 +00:00
|
|
|
|
2014-02-25 18:21:10 +01:00
|
|
|
|
2006-10-19 09:40:02 +00:00
|
|
|
// VDev RevDevice provider
|
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
2011-05-11 11:24:22 +01:00
|
|
|
class ImpTimedRefDev;
|
|
|
|
|
|
|
|
//the scoped_timed_RefDev owns a ImpTimeRefDev and releases it on dtor
|
|
|
|
//or disposing of the default XComponentContext which causes the underlying
|
|
|
|
//OutputDevice to get released
|
2014-02-25 18:21:10 +01:00
|
|
|
|
2011-05-11 11:24:22 +01:00
|
|
|
//The ImpTimerRefDev itself, if the timeout ever gets hit, will call
|
|
|
|
//reset on the scoped_timed_RefDev to release the ImpTimerRefDev early
|
|
|
|
//if its unused for a few minutes
|
2015-02-17 13:43:17 +00:00
|
|
|
class scoped_timed_RefDev : public comphelper::unique_disposing_ptr<ImpTimedRefDev>
|
2011-05-11 11:24:22 +01:00
|
|
|
{
|
|
|
|
public:
|
2015-09-11 14:46:52 +02:00
|
|
|
scoped_timed_RefDev() : comphelper::unique_disposing_ptr<ImpTimedRefDev>((css::uno::Reference<css::lang::XComponent>(::comphelper::getProcessComponentContext(), css::uno::UNO_QUERY_THROW)))
|
2011-05-11 11:24:22 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class the_scoped_timed_RefDev : public rtl::Static<scoped_timed_RefDev, the_scoped_timed_RefDev> {};
|
|
|
|
|
2006-10-19 09:40:02 +00:00
|
|
|
class ImpTimedRefDev : public Timer
|
|
|
|
{
|
2011-05-11 11:24:22 +01:00
|
|
|
scoped_timed_RefDev& mrOwnerOfMe;
|
2015-03-19 13:54:12 +02:00
|
|
|
VclPtr<VirtualDevice> mpVirDev;
|
2006-10-19 09:40:02 +00:00
|
|
|
sal_uInt32 mnUseCount;
|
|
|
|
|
|
|
|
public:
|
2012-07-02 17:52:13 +02:00
|
|
|
explicit ImpTimedRefDev(scoped_timed_RefDev& rOwnerofMe);
|
2014-04-01 19:18:35 +02:00
|
|
|
virtual ~ImpTimedRefDev();
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Invoke() override;
|
2006-10-19 09:40:02 +00:00
|
|
|
|
|
|
|
VirtualDevice& acquireVirtualDevice();
|
|
|
|
void releaseVirtualDevice();
|
|
|
|
};
|
|
|
|
|
2011-05-11 11:24:22 +01:00
|
|
|
ImpTimedRefDev::ImpTimedRefDev(scoped_timed_RefDev& rOwnerOfMe)
|
|
|
|
: mrOwnerOfMe(rOwnerOfMe),
|
2006-10-19 09:40:02 +00:00
|
|
|
mpVirDev(0L),
|
|
|
|
mnUseCount(0L)
|
|
|
|
{
|
|
|
|
SetTimeout(3L * 60L * 1000L); // three minutes
|
|
|
|
Start();
|
|
|
|
}
|
|
|
|
|
|
|
|
ImpTimedRefDev::~ImpTimedRefDev()
|
|
|
|
{
|
|
|
|
OSL_ENSURE(0L == mnUseCount, "destruction of a still used ImpTimedRefDev (!)");
|
2013-07-29 18:24:23 +03:00
|
|
|
const SolarMutexGuard aGuard;
|
2015-03-19 13:54:12 +02:00
|
|
|
mpVirDev.disposeAndClear();
|
2006-10-19 09:40:02 +00:00
|
|
|
}
|
|
|
|
|
2015-03-06 14:48:18 +01:00
|
|
|
void ImpTimedRefDev::Invoke()
|
2006-10-19 09:40:02 +00:00
|
|
|
{
|
|
|
|
// for obvious reasons, do not call anything after this
|
2011-05-11 11:24:22 +01:00
|
|
|
mrOwnerOfMe.reset();
|
2006-10-19 09:40:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
VirtualDevice& ImpTimedRefDev::acquireVirtualDevice()
|
|
|
|
{
|
|
|
|
if(!mpVirDev)
|
|
|
|
{
|
2015-04-16 22:09:41 +01:00
|
|
|
mpVirDev = VclPtr<VirtualDevice>::Create();
|
2007-01-25 11:15:23 +00:00
|
|
|
mpVirDev->SetReferenceDevice( VirtualDevice::REFDEV_MODE_MSO1 );
|
2006-10-19 09:40:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(!mnUseCount)
|
|
|
|
{
|
|
|
|
Stop();
|
|
|
|
}
|
|
|
|
|
|
|
|
mnUseCount++;
|
|
|
|
|
|
|
|
return *mpVirDev;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ImpTimedRefDev::releaseVirtualDevice()
|
|
|
|
{
|
|
|
|
OSL_ENSURE(mnUseCount, "mismatch call number to releaseVirtualDevice() (!)");
|
|
|
|
mnUseCount--;
|
|
|
|
|
|
|
|
if(!mnUseCount)
|
|
|
|
{
|
|
|
|
Start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // end of anonymous namespace
|
|
|
|
|
2014-02-25 18:21:10 +01:00
|
|
|
|
2006-10-19 09:40:02 +00:00
|
|
|
// access to one global ImpTimedRefDev incarnation in namespace drawinglayer::primitive
|
|
|
|
|
|
|
|
namespace drawinglayer
|
|
|
|
{
|
|
|
|
namespace primitive2d
|
|
|
|
{
|
|
|
|
// static methods here
|
|
|
|
VirtualDevice& acquireGlobalVirtualDevice()
|
|
|
|
{
|
2011-05-11 11:24:22 +01:00
|
|
|
scoped_timed_RefDev& rStdRefDevice = the_scoped_timed_RefDev::get();
|
2006-10-19 09:40:02 +00:00
|
|
|
|
2011-05-11 11:24:22 +01:00
|
|
|
if(!rStdRefDevice)
|
|
|
|
rStdRefDevice.reset(new ImpTimedRefDev(rStdRefDevice));
|
|
|
|
|
|
|
|
return rStdRefDevice->acquireVirtualDevice();
|
2006-10-19 09:40:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void releaseGlobalVirtualDevice()
|
|
|
|
{
|
2011-05-11 11:24:22 +01:00
|
|
|
scoped_timed_RefDev& rStdRefDevice = the_scoped_timed_RefDev::get();
|
|
|
|
|
|
|
|
OSL_ENSURE(rStdRefDevice, "releaseGlobalVirtualDevice() without prior acquireGlobalVirtualDevice() call(!)");
|
|
|
|
rStdRefDevice->releaseVirtualDevice();
|
2006-10-19 09:40:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
TextLayouterDevice::TextLayouterDevice()
|
|
|
|
: mrDevice(acquireGlobalVirtualDevice())
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
TextLayouterDevice::~TextLayouterDevice()
|
|
|
|
{
|
|
|
|
releaseGlobalVirtualDevice();
|
|
|
|
}
|
|
|
|
|
2014-09-16 10:09:58 +02:00
|
|
|
void TextLayouterDevice::setFont(const vcl::Font& rFont)
|
2006-10-19 09:40:02 +00:00
|
|
|
{
|
2007-01-25 11:15:23 +00:00
|
|
|
mrDevice.SetFont( rFont );
|
2006-10-19 09:40:02 +00:00
|
|
|
}
|
|
|
|
|
2009-11-12 11:26:43 +01:00
|
|
|
void TextLayouterDevice::setFontAttribute(
|
|
|
|
const attribute::FontAttribute& rFontAttribute,
|
2009-09-17 10:29:02 +00:00
|
|
|
double fFontScaleX,
|
|
|
|
double fFontScaleY,
|
2015-09-11 14:46:52 +02:00
|
|
|
const css::lang::Locale& rLocale)
|
2007-11-19 09:21:42 +00:00
|
|
|
{
|
2009-11-12 11:26:43 +01:00
|
|
|
setFont(getVclFontFromFontAttribute(
|
|
|
|
rFontAttribute,
|
2009-09-17 10:29:02 +00:00
|
|
|
fFontScaleX,
|
|
|
|
fFontScaleY,
|
|
|
|
0.0,
|
|
|
|
rLocale));
|
2006-10-19 09:40:02 +00:00
|
|
|
}
|
|
|
|
|
2009-01-05 17:49:45 +00:00
|
|
|
double TextLayouterDevice::getOverlineOffset() const
|
|
|
|
{
|
|
|
|
const ::FontMetric& rMetric = mrDevice.GetFontMetric();
|
|
|
|
double fRet = (rMetric.GetIntLeading() / 2.0) - rMetric.GetAscent();
|
|
|
|
return fRet;
|
|
|
|
}
|
|
|
|
|
2007-02-14 13:53:01 +00:00
|
|
|
double TextLayouterDevice::getUnderlineOffset() const
|
|
|
|
{
|
|
|
|
const ::FontMetric& rMetric = mrDevice.GetFontMetric();
|
|
|
|
double fRet = rMetric.GetDescent() / 2.0;
|
|
|
|
return fRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
double TextLayouterDevice::getStrikeoutOffset() const
|
|
|
|
{
|
|
|
|
const ::FontMetric& rMetric = mrDevice.GetFontMetric();
|
|
|
|
double fRet = (rMetric.GetAscent() - rMetric.GetIntLeading()) / 3.0;
|
|
|
|
return fRet;
|
|
|
|
}
|
|
|
|
|
2009-01-05 17:49:45 +00:00
|
|
|
double TextLayouterDevice::getOverlineHeight() const
|
|
|
|
{
|
|
|
|
const ::FontMetric& rMetric = mrDevice.GetFontMetric();
|
|
|
|
double fRet = rMetric.GetIntLeading() / 2.5;
|
|
|
|
return fRet;
|
|
|
|
}
|
|
|
|
|
2007-02-14 13:53:01 +00:00
|
|
|
double TextLayouterDevice::getUnderlineHeight() const
|
|
|
|
{
|
|
|
|
const ::FontMetric& rMetric = mrDevice.GetFontMetric();
|
|
|
|
double fRet = rMetric.GetDescent() / 4.0;
|
|
|
|
return fRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
double TextLayouterDevice::getTextHeight() const
|
2006-10-19 09:40:02 +00:00
|
|
|
{
|
|
|
|
return mrDevice.GetTextHeight();
|
|
|
|
}
|
|
|
|
|
2007-10-01 08:14:08 +00:00
|
|
|
double TextLayouterDevice::getTextWidth(
|
2013-08-21 13:18:34 +02:00
|
|
|
const OUString& rText,
|
2010-02-02 12:16:54 +01:00
|
|
|
sal_uInt32 nIndex,
|
|
|
|
sal_uInt32 nLength) const
|
2006-10-19 09:40:02 +00:00
|
|
|
{
|
2007-10-01 08:14:08 +00:00
|
|
|
return mrDevice.GetTextWidth(rText, nIndex, nLength);
|
2006-10-19 09:40:02 +00:00
|
|
|
}
|
|
|
|
|
2007-10-01 08:14:08 +00:00
|
|
|
bool TextLayouterDevice::getTextOutlines(
|
|
|
|
basegfx::B2DPolyPolygonVector& rB2DPolyPolyVector,
|
2013-08-21 13:18:34 +02:00
|
|
|
const OUString& rText,
|
2010-02-02 12:16:54 +01:00
|
|
|
sal_uInt32 nIndex,
|
|
|
|
sal_uInt32 nLength,
|
|
|
|
const ::std::vector< double >& rDXArray) const
|
2006-10-19 09:40:02 +00:00
|
|
|
{
|
2009-09-17 10:29:02 +00:00
|
|
|
const sal_uInt32 nDXArrayCount(rDXArray.size());
|
2010-02-02 12:16:54 +01:00
|
|
|
sal_uInt32 nTextLength(nLength);
|
2013-08-21 13:18:34 +02:00
|
|
|
const sal_uInt32 nStringLength(rText.getLength());
|
2010-02-02 12:16:54 +01:00
|
|
|
|
|
|
|
if(nTextLength + nIndex > nStringLength)
|
|
|
|
{
|
|
|
|
nTextLength = nStringLength - nIndex;
|
|
|
|
}
|
CWS-TOOLING: integrate CWS aw065
2009-06-17 13:48:12 +0200 aw r273068 : #99385# corrected small error in SCs selection visualisation
2009-06-16 15:45:28 +0200 wg r273021 : i102838
2009-06-16 12:46:07 +0200 wg r273016 : i102833
2009-06-11 17:40:29 +0200 aw r272895 : #i98870# added implementation for getPageCount helper
2009-06-11 16:39:54 +0200 aw r272885 : #i102663#, #i102667#, #i98870# incluide file typo corrected
2009-06-11 16:24:07 +0200 aw r272881 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-11 16:23:52 +0200 aw r272880 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-09 13:50:29 +0200 aw r272769 : #i98917# added support for the OverlayHatchRectanglePrimitive to follow rotation with it's hatch; simplified OverlayHatchRect
2009-06-09 13:04:06 +0200 aw r272766 : #i98870# re-added PageNumber identification in SdrTextPrimitive2D::get2DDecomposition
2009-06-08 18:56:05 +0200 aw r272744 : #i99385# added some last corrections to OverlayObjects in SD (had to do some merges on resync, needed to optically check and correct)
2009-06-08 11:17:57 +0200 aw r272725 : cws aw065: corrections after resync
2009-06-08 11:02:25 +0200 aw r272723 : cws aw065: corrections after resync
2009-06-08 10:36:22 +0200 aw r272722 : cws aw065: corrections after resync
2009-06-05 18:57:06 +0200 aw r272712 : CWS-TOOLING: rebase CWS aw065 to trunk@272291 (milestone: DEV300:m49)
2009-06-05 14:56:34 +0200 aw r272690 : #i89784# stripped old stuff no longer needed due to text-to-polygon conversion using primitives
2009-06-05 14:50:07 +0200 aw r272688 : #102091# removed on-model-lock suppression for SdrObject::ActionChanged()
2009-06-05 14:47:29 +0200 aw r272687 : #102091# corrected local value buffering in ScenePrimitive2D::get2DDecomposition
2009-06-03 17:53:32 +0200 aw r272599 : #i89784# version before stripping
2009-06-03 17:52:18 +0200 aw r272598 : #i89784# version before stripping
2009-05-28 17:15:47 +0200 aw r272420 : #i101872# old stuff removed/stripped
2009-05-28 17:15:32 +0200 aw r272419 : #i101872# old stuff removed/stripped
2009-05-28 17:15:15 +0200 aw r272418 : #i101872# old stuff removed/stripped
2009-05-28 17:14:45 +0200 aw r272417 : #i101872# old stuff removed/stripped
2009-05-28 12:13:56 +0200 aw r272396 : #i101872# stable hybrid state
2009-05-28 12:13:46 +0200 aw r272395 : #i101872# stable hybrid state
2009-05-28 12:13:35 +0200 aw r272394 : #i101872# stable hybrid state
2009-05-28 12:13:20 +0200 aw r272393 : #i101872# stable hybrid state
2009-05-28 12:13:05 +0200 aw r272392 : #i101872# stable hybrid state
2009-05-28 12:12:51 +0200 aw r272391 : #i101872# stable hybrid state
2009-05-15 16:56:02 +0200 aw r271952 : #i101872# HitTest unifications
2009-05-15 16:55:22 +0200 aw r271951 : #i101872# HitTest unifications
2009-05-15 16:55:12 +0200 aw r271950 : #i101872# HitTest unifications
2009-05-15 16:55:01 +0200 aw r271949 : #i101872# HitTest unifications
2009-05-15 16:54:51 +0200 aw r271948 : #i101872# HitTest unifications
2009-05-15 16:54:35 +0200 aw r271947 : #i101872# HitTest unifications
2009-05-15 16:54:22 +0200 aw r271946 : #i101872# HitTest unifications
2009-05-12 19:08:38 +0200 aw r271834 : #i101684# corrected AutoShape's preparation of text transformation due to different definitions in TextBounds
2009-05-12 15:44:49 +0200 aw r271827 : #i89784# expanded TextLayouterDevice::getTextOutlines() to support DXArray and X-Font scaling
2009-05-11 19:40:40 +0200 aw r271790 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:25 +0200 aw r271789 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:12 +0200 aw r271788 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 13:01:53 +0200 aw r271765 : #i99385# corrections and optimizations
2009-05-08 14:48:40 +0200 aw r271718 : #i1016180# added optimizations in model operations when model is locked
2009-05-08 14:11:45 +0200 aw r271716 : #i101679# added flush() calls to OverlayManager when interaction step is prepared
2009-05-07 17:44:03 +0200 aw r271689 : #i99385# last corrections/changes
2009-05-07 17:43:47 +0200 aw r271688 : #i99385# last corrections/changes
2009-05-07 13:20:09 +0200 aw r271654 : #i99385# added changes from WFH
2009-05-07 13:19:38 +0200 aw r271653 : #i99385# added changes from WFH
2009-05-07 13:19:11 +0200 aw r271652 : #i99385# added changes from WFH
2009-05-07 11:33:17 +0200 aw r271643 : #i99385# corrections after resync
2009-05-07 11:17:31 +0200 aw r271642 : #i99385# corrections after resync
2009-05-06 18:46:53 +0200 aw r271609 : CWS-TOOLING: rebase CWS aw065 to trunk@271427 (milestone: DEV300:m47)
2009-05-05 18:24:03 +0200 aw r271548 : #i101443# force new text decomposition when TextBackgroundColor has changed
2009-05-05 17:44:42 +0200 aw r271542 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:32 +0200 aw r271541 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:20 +0200 aw r271540 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:09 +0200 aw r271539 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 15:48:38 +0200 aw r271527 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:15 +0200 aw r271526 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:03 +0200 aw r271525 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:47:51 +0200 aw r271524 : #i99385# 2nd round, usages checked and corrected
2009-04-27 18:33:10 +0200 aw r271300 : #i99385# state commit after all implementations are done
2009-04-27 15:36:53 +0200 aw r271283 : #i99385# state commit after all implementations are done
2009-04-27 15:27:49 +0200 aw r271280 : #i99385# state commit after all implementations are done
2009-04-27 15:27:33 +0200 aw r271279 : #i99385# state commit after all implementations are done
2009-04-27 15:27:00 +0200 aw r271278 : #i99385# state commit after all implementations are done
2009-04-27 15:26:15 +0200 aw r271277 : #i99385# state commit after all implementations are done
2009-04-27 15:25:40 +0200 aw r271275 : #i99385# state commit after all implementations are done
2009-04-27 15:25:19 +0200 aw r271274 : #i99385# state commit after all implementations are done
2009-04-27 15:24:00 +0200 aw r271272 : #i99385# state commit after all implementations are done
2009-03-19 17:12:00 +0100 aw r269757 : #i100360# corrected bitmap's PefSize calculation for bitmap filled objects when Bitmap is Pixel-based on it's mapping
2009-02-19 17:09:47 +0100 aw r268298 : #i98917# corrected attributes
2009-02-19 17:09:30 +0100 aw r268297 : #i98917# corrected attributes
2009-02-19 17:08:22 +0100 aw r268296 : #i98917# corrected attributes
2009-02-19 11:56:25 +0100 aw r268268 : #i98870# added extra code to react on PageNumber change
2009-02-18 16:57:24 +0100 aw r268243 : #i98917# in OverlayHatchRect::getGeometry the rotation was not applied to the TopLeft of the centered rectangle, but to the already extended one, thus the visualisation was rotating around the wrong edge
2009-07-02 14:28:15 +00:00
|
|
|
|
2009-09-17 10:29:02 +00:00
|
|
|
if(nDXArrayCount)
|
CWS-TOOLING: integrate CWS aw065
2009-06-17 13:48:12 +0200 aw r273068 : #99385# corrected small error in SCs selection visualisation
2009-06-16 15:45:28 +0200 wg r273021 : i102838
2009-06-16 12:46:07 +0200 wg r273016 : i102833
2009-06-11 17:40:29 +0200 aw r272895 : #i98870# added implementation for getPageCount helper
2009-06-11 16:39:54 +0200 aw r272885 : #i102663#, #i102667#, #i98870# incluide file typo corrected
2009-06-11 16:24:07 +0200 aw r272881 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-11 16:23:52 +0200 aw r272880 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-09 13:50:29 +0200 aw r272769 : #i98917# added support for the OverlayHatchRectanglePrimitive to follow rotation with it's hatch; simplified OverlayHatchRect
2009-06-09 13:04:06 +0200 aw r272766 : #i98870# re-added PageNumber identification in SdrTextPrimitive2D::get2DDecomposition
2009-06-08 18:56:05 +0200 aw r272744 : #i99385# added some last corrections to OverlayObjects in SD (had to do some merges on resync, needed to optically check and correct)
2009-06-08 11:17:57 +0200 aw r272725 : cws aw065: corrections after resync
2009-06-08 11:02:25 +0200 aw r272723 : cws aw065: corrections after resync
2009-06-08 10:36:22 +0200 aw r272722 : cws aw065: corrections after resync
2009-06-05 18:57:06 +0200 aw r272712 : CWS-TOOLING: rebase CWS aw065 to trunk@272291 (milestone: DEV300:m49)
2009-06-05 14:56:34 +0200 aw r272690 : #i89784# stripped old stuff no longer needed due to text-to-polygon conversion using primitives
2009-06-05 14:50:07 +0200 aw r272688 : #102091# removed on-model-lock suppression for SdrObject::ActionChanged()
2009-06-05 14:47:29 +0200 aw r272687 : #102091# corrected local value buffering in ScenePrimitive2D::get2DDecomposition
2009-06-03 17:53:32 +0200 aw r272599 : #i89784# version before stripping
2009-06-03 17:52:18 +0200 aw r272598 : #i89784# version before stripping
2009-05-28 17:15:47 +0200 aw r272420 : #i101872# old stuff removed/stripped
2009-05-28 17:15:32 +0200 aw r272419 : #i101872# old stuff removed/stripped
2009-05-28 17:15:15 +0200 aw r272418 : #i101872# old stuff removed/stripped
2009-05-28 17:14:45 +0200 aw r272417 : #i101872# old stuff removed/stripped
2009-05-28 12:13:56 +0200 aw r272396 : #i101872# stable hybrid state
2009-05-28 12:13:46 +0200 aw r272395 : #i101872# stable hybrid state
2009-05-28 12:13:35 +0200 aw r272394 : #i101872# stable hybrid state
2009-05-28 12:13:20 +0200 aw r272393 : #i101872# stable hybrid state
2009-05-28 12:13:05 +0200 aw r272392 : #i101872# stable hybrid state
2009-05-28 12:12:51 +0200 aw r272391 : #i101872# stable hybrid state
2009-05-15 16:56:02 +0200 aw r271952 : #i101872# HitTest unifications
2009-05-15 16:55:22 +0200 aw r271951 : #i101872# HitTest unifications
2009-05-15 16:55:12 +0200 aw r271950 : #i101872# HitTest unifications
2009-05-15 16:55:01 +0200 aw r271949 : #i101872# HitTest unifications
2009-05-15 16:54:51 +0200 aw r271948 : #i101872# HitTest unifications
2009-05-15 16:54:35 +0200 aw r271947 : #i101872# HitTest unifications
2009-05-15 16:54:22 +0200 aw r271946 : #i101872# HitTest unifications
2009-05-12 19:08:38 +0200 aw r271834 : #i101684# corrected AutoShape's preparation of text transformation due to different definitions in TextBounds
2009-05-12 15:44:49 +0200 aw r271827 : #i89784# expanded TextLayouterDevice::getTextOutlines() to support DXArray and X-Font scaling
2009-05-11 19:40:40 +0200 aw r271790 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:25 +0200 aw r271789 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:12 +0200 aw r271788 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 13:01:53 +0200 aw r271765 : #i99385# corrections and optimizations
2009-05-08 14:48:40 +0200 aw r271718 : #i1016180# added optimizations in model operations when model is locked
2009-05-08 14:11:45 +0200 aw r271716 : #i101679# added flush() calls to OverlayManager when interaction step is prepared
2009-05-07 17:44:03 +0200 aw r271689 : #i99385# last corrections/changes
2009-05-07 17:43:47 +0200 aw r271688 : #i99385# last corrections/changes
2009-05-07 13:20:09 +0200 aw r271654 : #i99385# added changes from WFH
2009-05-07 13:19:38 +0200 aw r271653 : #i99385# added changes from WFH
2009-05-07 13:19:11 +0200 aw r271652 : #i99385# added changes from WFH
2009-05-07 11:33:17 +0200 aw r271643 : #i99385# corrections after resync
2009-05-07 11:17:31 +0200 aw r271642 : #i99385# corrections after resync
2009-05-06 18:46:53 +0200 aw r271609 : CWS-TOOLING: rebase CWS aw065 to trunk@271427 (milestone: DEV300:m47)
2009-05-05 18:24:03 +0200 aw r271548 : #i101443# force new text decomposition when TextBackgroundColor has changed
2009-05-05 17:44:42 +0200 aw r271542 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:32 +0200 aw r271541 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:20 +0200 aw r271540 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:09 +0200 aw r271539 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 15:48:38 +0200 aw r271527 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:15 +0200 aw r271526 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:03 +0200 aw r271525 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:47:51 +0200 aw r271524 : #i99385# 2nd round, usages checked and corrected
2009-04-27 18:33:10 +0200 aw r271300 : #i99385# state commit after all implementations are done
2009-04-27 15:36:53 +0200 aw r271283 : #i99385# state commit after all implementations are done
2009-04-27 15:27:49 +0200 aw r271280 : #i99385# state commit after all implementations are done
2009-04-27 15:27:33 +0200 aw r271279 : #i99385# state commit after all implementations are done
2009-04-27 15:27:00 +0200 aw r271278 : #i99385# state commit after all implementations are done
2009-04-27 15:26:15 +0200 aw r271277 : #i99385# state commit after all implementations are done
2009-04-27 15:25:40 +0200 aw r271275 : #i99385# state commit after all implementations are done
2009-04-27 15:25:19 +0200 aw r271274 : #i99385# state commit after all implementations are done
2009-04-27 15:24:00 +0200 aw r271272 : #i99385# state commit after all implementations are done
2009-03-19 17:12:00 +0100 aw r269757 : #i100360# corrected bitmap's PefSize calculation for bitmap filled objects when Bitmap is Pixel-based on it's mapping
2009-02-19 17:09:47 +0100 aw r268298 : #i98917# corrected attributes
2009-02-19 17:09:30 +0100 aw r268297 : #i98917# corrected attributes
2009-02-19 17:08:22 +0100 aw r268296 : #i98917# corrected attributes
2009-02-19 11:56:25 +0100 aw r268268 : #i98870# added extra code to react on PageNumber change
2009-02-18 16:57:24 +0100 aw r268243 : #i98917# in OverlayHatchRect::getGeometry the rotation was not applied to the TopLeft of the centered rectangle, but to the already extended one, thus the visualisation was rotating around the wrong edge
2009-07-02 14:28:15 +00:00
|
|
|
{
|
2010-02-02 12:16:54 +01:00
|
|
|
OSL_ENSURE(nDXArrayCount == nTextLength, "DXArray size does not correspond to text portion size (!)");
|
2014-07-18 18:21:12 +02:00
|
|
|
std::vector< long > aIntegerDXArray(nDXArrayCount);
|
CWS-TOOLING: integrate CWS aw065
2009-06-17 13:48:12 +0200 aw r273068 : #99385# corrected small error in SCs selection visualisation
2009-06-16 15:45:28 +0200 wg r273021 : i102838
2009-06-16 12:46:07 +0200 wg r273016 : i102833
2009-06-11 17:40:29 +0200 aw r272895 : #i98870# added implementation for getPageCount helper
2009-06-11 16:39:54 +0200 aw r272885 : #i102663#, #i102667#, #i98870# incluide file typo corrected
2009-06-11 16:24:07 +0200 aw r272881 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-11 16:23:52 +0200 aw r272880 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-09 13:50:29 +0200 aw r272769 : #i98917# added support for the OverlayHatchRectanglePrimitive to follow rotation with it's hatch; simplified OverlayHatchRect
2009-06-09 13:04:06 +0200 aw r272766 : #i98870# re-added PageNumber identification in SdrTextPrimitive2D::get2DDecomposition
2009-06-08 18:56:05 +0200 aw r272744 : #i99385# added some last corrections to OverlayObjects in SD (had to do some merges on resync, needed to optically check and correct)
2009-06-08 11:17:57 +0200 aw r272725 : cws aw065: corrections after resync
2009-06-08 11:02:25 +0200 aw r272723 : cws aw065: corrections after resync
2009-06-08 10:36:22 +0200 aw r272722 : cws aw065: corrections after resync
2009-06-05 18:57:06 +0200 aw r272712 : CWS-TOOLING: rebase CWS aw065 to trunk@272291 (milestone: DEV300:m49)
2009-06-05 14:56:34 +0200 aw r272690 : #i89784# stripped old stuff no longer needed due to text-to-polygon conversion using primitives
2009-06-05 14:50:07 +0200 aw r272688 : #102091# removed on-model-lock suppression for SdrObject::ActionChanged()
2009-06-05 14:47:29 +0200 aw r272687 : #102091# corrected local value buffering in ScenePrimitive2D::get2DDecomposition
2009-06-03 17:53:32 +0200 aw r272599 : #i89784# version before stripping
2009-06-03 17:52:18 +0200 aw r272598 : #i89784# version before stripping
2009-05-28 17:15:47 +0200 aw r272420 : #i101872# old stuff removed/stripped
2009-05-28 17:15:32 +0200 aw r272419 : #i101872# old stuff removed/stripped
2009-05-28 17:15:15 +0200 aw r272418 : #i101872# old stuff removed/stripped
2009-05-28 17:14:45 +0200 aw r272417 : #i101872# old stuff removed/stripped
2009-05-28 12:13:56 +0200 aw r272396 : #i101872# stable hybrid state
2009-05-28 12:13:46 +0200 aw r272395 : #i101872# stable hybrid state
2009-05-28 12:13:35 +0200 aw r272394 : #i101872# stable hybrid state
2009-05-28 12:13:20 +0200 aw r272393 : #i101872# stable hybrid state
2009-05-28 12:13:05 +0200 aw r272392 : #i101872# stable hybrid state
2009-05-28 12:12:51 +0200 aw r272391 : #i101872# stable hybrid state
2009-05-15 16:56:02 +0200 aw r271952 : #i101872# HitTest unifications
2009-05-15 16:55:22 +0200 aw r271951 : #i101872# HitTest unifications
2009-05-15 16:55:12 +0200 aw r271950 : #i101872# HitTest unifications
2009-05-15 16:55:01 +0200 aw r271949 : #i101872# HitTest unifications
2009-05-15 16:54:51 +0200 aw r271948 : #i101872# HitTest unifications
2009-05-15 16:54:35 +0200 aw r271947 : #i101872# HitTest unifications
2009-05-15 16:54:22 +0200 aw r271946 : #i101872# HitTest unifications
2009-05-12 19:08:38 +0200 aw r271834 : #i101684# corrected AutoShape's preparation of text transformation due to different definitions in TextBounds
2009-05-12 15:44:49 +0200 aw r271827 : #i89784# expanded TextLayouterDevice::getTextOutlines() to support DXArray and X-Font scaling
2009-05-11 19:40:40 +0200 aw r271790 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:25 +0200 aw r271789 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:12 +0200 aw r271788 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 13:01:53 +0200 aw r271765 : #i99385# corrections and optimizations
2009-05-08 14:48:40 +0200 aw r271718 : #i1016180# added optimizations in model operations when model is locked
2009-05-08 14:11:45 +0200 aw r271716 : #i101679# added flush() calls to OverlayManager when interaction step is prepared
2009-05-07 17:44:03 +0200 aw r271689 : #i99385# last corrections/changes
2009-05-07 17:43:47 +0200 aw r271688 : #i99385# last corrections/changes
2009-05-07 13:20:09 +0200 aw r271654 : #i99385# added changes from WFH
2009-05-07 13:19:38 +0200 aw r271653 : #i99385# added changes from WFH
2009-05-07 13:19:11 +0200 aw r271652 : #i99385# added changes from WFH
2009-05-07 11:33:17 +0200 aw r271643 : #i99385# corrections after resync
2009-05-07 11:17:31 +0200 aw r271642 : #i99385# corrections after resync
2009-05-06 18:46:53 +0200 aw r271609 : CWS-TOOLING: rebase CWS aw065 to trunk@271427 (milestone: DEV300:m47)
2009-05-05 18:24:03 +0200 aw r271548 : #i101443# force new text decomposition when TextBackgroundColor has changed
2009-05-05 17:44:42 +0200 aw r271542 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:32 +0200 aw r271541 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:20 +0200 aw r271540 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:09 +0200 aw r271539 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 15:48:38 +0200 aw r271527 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:15 +0200 aw r271526 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:03 +0200 aw r271525 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:47:51 +0200 aw r271524 : #i99385# 2nd round, usages checked and corrected
2009-04-27 18:33:10 +0200 aw r271300 : #i99385# state commit after all implementations are done
2009-04-27 15:36:53 +0200 aw r271283 : #i99385# state commit after all implementations are done
2009-04-27 15:27:49 +0200 aw r271280 : #i99385# state commit after all implementations are done
2009-04-27 15:27:33 +0200 aw r271279 : #i99385# state commit after all implementations are done
2009-04-27 15:27:00 +0200 aw r271278 : #i99385# state commit after all implementations are done
2009-04-27 15:26:15 +0200 aw r271277 : #i99385# state commit after all implementations are done
2009-04-27 15:25:40 +0200 aw r271275 : #i99385# state commit after all implementations are done
2009-04-27 15:25:19 +0200 aw r271274 : #i99385# state commit after all implementations are done
2009-04-27 15:24:00 +0200 aw r271272 : #i99385# state commit after all implementations are done
2009-03-19 17:12:00 +0100 aw r269757 : #i100360# corrected bitmap's PefSize calculation for bitmap filled objects when Bitmap is Pixel-based on it's mapping
2009-02-19 17:09:47 +0100 aw r268298 : #i98917# corrected attributes
2009-02-19 17:09:30 +0100 aw r268297 : #i98917# corrected attributes
2009-02-19 17:08:22 +0100 aw r268296 : #i98917# corrected attributes
2009-02-19 11:56:25 +0100 aw r268268 : #i98870# added extra code to react on PageNumber change
2009-02-18 16:57:24 +0100 aw r268243 : #i98917# in OverlayHatchRect::getGeometry the rotation was not applied to the TopLeft of the centered rectangle, but to the already extended one, thus the visualisation was rotating around the wrong edge
2009-07-02 14:28:15 +00:00
|
|
|
|
2009-09-17 10:29:02 +00:00
|
|
|
for(sal_uInt32 a(0); a < nDXArrayCount; a++)
|
CWS-TOOLING: integrate CWS aw065
2009-06-17 13:48:12 +0200 aw r273068 : #99385# corrected small error in SCs selection visualisation
2009-06-16 15:45:28 +0200 wg r273021 : i102838
2009-06-16 12:46:07 +0200 wg r273016 : i102833
2009-06-11 17:40:29 +0200 aw r272895 : #i98870# added implementation for getPageCount helper
2009-06-11 16:39:54 +0200 aw r272885 : #i102663#, #i102667#, #i98870# incluide file typo corrected
2009-06-11 16:24:07 +0200 aw r272881 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-11 16:23:52 +0200 aw r272880 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-09 13:50:29 +0200 aw r272769 : #i98917# added support for the OverlayHatchRectanglePrimitive to follow rotation with it's hatch; simplified OverlayHatchRect
2009-06-09 13:04:06 +0200 aw r272766 : #i98870# re-added PageNumber identification in SdrTextPrimitive2D::get2DDecomposition
2009-06-08 18:56:05 +0200 aw r272744 : #i99385# added some last corrections to OverlayObjects in SD (had to do some merges on resync, needed to optically check and correct)
2009-06-08 11:17:57 +0200 aw r272725 : cws aw065: corrections after resync
2009-06-08 11:02:25 +0200 aw r272723 : cws aw065: corrections after resync
2009-06-08 10:36:22 +0200 aw r272722 : cws aw065: corrections after resync
2009-06-05 18:57:06 +0200 aw r272712 : CWS-TOOLING: rebase CWS aw065 to trunk@272291 (milestone: DEV300:m49)
2009-06-05 14:56:34 +0200 aw r272690 : #i89784# stripped old stuff no longer needed due to text-to-polygon conversion using primitives
2009-06-05 14:50:07 +0200 aw r272688 : #102091# removed on-model-lock suppression for SdrObject::ActionChanged()
2009-06-05 14:47:29 +0200 aw r272687 : #102091# corrected local value buffering in ScenePrimitive2D::get2DDecomposition
2009-06-03 17:53:32 +0200 aw r272599 : #i89784# version before stripping
2009-06-03 17:52:18 +0200 aw r272598 : #i89784# version before stripping
2009-05-28 17:15:47 +0200 aw r272420 : #i101872# old stuff removed/stripped
2009-05-28 17:15:32 +0200 aw r272419 : #i101872# old stuff removed/stripped
2009-05-28 17:15:15 +0200 aw r272418 : #i101872# old stuff removed/stripped
2009-05-28 17:14:45 +0200 aw r272417 : #i101872# old stuff removed/stripped
2009-05-28 12:13:56 +0200 aw r272396 : #i101872# stable hybrid state
2009-05-28 12:13:46 +0200 aw r272395 : #i101872# stable hybrid state
2009-05-28 12:13:35 +0200 aw r272394 : #i101872# stable hybrid state
2009-05-28 12:13:20 +0200 aw r272393 : #i101872# stable hybrid state
2009-05-28 12:13:05 +0200 aw r272392 : #i101872# stable hybrid state
2009-05-28 12:12:51 +0200 aw r272391 : #i101872# stable hybrid state
2009-05-15 16:56:02 +0200 aw r271952 : #i101872# HitTest unifications
2009-05-15 16:55:22 +0200 aw r271951 : #i101872# HitTest unifications
2009-05-15 16:55:12 +0200 aw r271950 : #i101872# HitTest unifications
2009-05-15 16:55:01 +0200 aw r271949 : #i101872# HitTest unifications
2009-05-15 16:54:51 +0200 aw r271948 : #i101872# HitTest unifications
2009-05-15 16:54:35 +0200 aw r271947 : #i101872# HitTest unifications
2009-05-15 16:54:22 +0200 aw r271946 : #i101872# HitTest unifications
2009-05-12 19:08:38 +0200 aw r271834 : #i101684# corrected AutoShape's preparation of text transformation due to different definitions in TextBounds
2009-05-12 15:44:49 +0200 aw r271827 : #i89784# expanded TextLayouterDevice::getTextOutlines() to support DXArray and X-Font scaling
2009-05-11 19:40:40 +0200 aw r271790 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:25 +0200 aw r271789 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:12 +0200 aw r271788 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 13:01:53 +0200 aw r271765 : #i99385# corrections and optimizations
2009-05-08 14:48:40 +0200 aw r271718 : #i1016180# added optimizations in model operations when model is locked
2009-05-08 14:11:45 +0200 aw r271716 : #i101679# added flush() calls to OverlayManager when interaction step is prepared
2009-05-07 17:44:03 +0200 aw r271689 : #i99385# last corrections/changes
2009-05-07 17:43:47 +0200 aw r271688 : #i99385# last corrections/changes
2009-05-07 13:20:09 +0200 aw r271654 : #i99385# added changes from WFH
2009-05-07 13:19:38 +0200 aw r271653 : #i99385# added changes from WFH
2009-05-07 13:19:11 +0200 aw r271652 : #i99385# added changes from WFH
2009-05-07 11:33:17 +0200 aw r271643 : #i99385# corrections after resync
2009-05-07 11:17:31 +0200 aw r271642 : #i99385# corrections after resync
2009-05-06 18:46:53 +0200 aw r271609 : CWS-TOOLING: rebase CWS aw065 to trunk@271427 (milestone: DEV300:m47)
2009-05-05 18:24:03 +0200 aw r271548 : #i101443# force new text decomposition when TextBackgroundColor has changed
2009-05-05 17:44:42 +0200 aw r271542 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:32 +0200 aw r271541 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:20 +0200 aw r271540 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:09 +0200 aw r271539 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 15:48:38 +0200 aw r271527 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:15 +0200 aw r271526 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:03 +0200 aw r271525 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:47:51 +0200 aw r271524 : #i99385# 2nd round, usages checked and corrected
2009-04-27 18:33:10 +0200 aw r271300 : #i99385# state commit after all implementations are done
2009-04-27 15:36:53 +0200 aw r271283 : #i99385# state commit after all implementations are done
2009-04-27 15:27:49 +0200 aw r271280 : #i99385# state commit after all implementations are done
2009-04-27 15:27:33 +0200 aw r271279 : #i99385# state commit after all implementations are done
2009-04-27 15:27:00 +0200 aw r271278 : #i99385# state commit after all implementations are done
2009-04-27 15:26:15 +0200 aw r271277 : #i99385# state commit after all implementations are done
2009-04-27 15:25:40 +0200 aw r271275 : #i99385# state commit after all implementations are done
2009-04-27 15:25:19 +0200 aw r271274 : #i99385# state commit after all implementations are done
2009-04-27 15:24:00 +0200 aw r271272 : #i99385# state commit after all implementations are done
2009-03-19 17:12:00 +0100 aw r269757 : #i100360# corrected bitmap's PefSize calculation for bitmap filled objects when Bitmap is Pixel-based on it's mapping
2009-02-19 17:09:47 +0100 aw r268298 : #i98917# corrected attributes
2009-02-19 17:09:30 +0100 aw r268297 : #i98917# corrected attributes
2009-02-19 17:08:22 +0100 aw r268296 : #i98917# corrected attributes
2009-02-19 11:56:25 +0100 aw r268268 : #i98870# added extra code to react on PageNumber change
2009-02-18 16:57:24 +0100 aw r268243 : #i98917# in OverlayHatchRect::getGeometry the rotation was not applied to the TopLeft of the centered rectangle, but to the already extended one, thus the visualisation was rotating around the wrong edge
2009-07-02 14:28:15 +00:00
|
|
|
{
|
2009-09-17 10:29:02 +00:00
|
|
|
aIntegerDXArray[a] = basegfx::fround(rDXArray[a]);
|
CWS-TOOLING: integrate CWS aw065
2009-06-17 13:48:12 +0200 aw r273068 : #99385# corrected small error in SCs selection visualisation
2009-06-16 15:45:28 +0200 wg r273021 : i102838
2009-06-16 12:46:07 +0200 wg r273016 : i102833
2009-06-11 17:40:29 +0200 aw r272895 : #i98870# added implementation for getPageCount helper
2009-06-11 16:39:54 +0200 aw r272885 : #i102663#, #i102667#, #i98870# incluide file typo corrected
2009-06-11 16:24:07 +0200 aw r272881 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-11 16:23:52 +0200 aw r272880 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
2009-06-09 13:50:29 +0200 aw r272769 : #i98917# added support for the OverlayHatchRectanglePrimitive to follow rotation with it's hatch; simplified OverlayHatchRect
2009-06-09 13:04:06 +0200 aw r272766 : #i98870# re-added PageNumber identification in SdrTextPrimitive2D::get2DDecomposition
2009-06-08 18:56:05 +0200 aw r272744 : #i99385# added some last corrections to OverlayObjects in SD (had to do some merges on resync, needed to optically check and correct)
2009-06-08 11:17:57 +0200 aw r272725 : cws aw065: corrections after resync
2009-06-08 11:02:25 +0200 aw r272723 : cws aw065: corrections after resync
2009-06-08 10:36:22 +0200 aw r272722 : cws aw065: corrections after resync
2009-06-05 18:57:06 +0200 aw r272712 : CWS-TOOLING: rebase CWS aw065 to trunk@272291 (milestone: DEV300:m49)
2009-06-05 14:56:34 +0200 aw r272690 : #i89784# stripped old stuff no longer needed due to text-to-polygon conversion using primitives
2009-06-05 14:50:07 +0200 aw r272688 : #102091# removed on-model-lock suppression for SdrObject::ActionChanged()
2009-06-05 14:47:29 +0200 aw r272687 : #102091# corrected local value buffering in ScenePrimitive2D::get2DDecomposition
2009-06-03 17:53:32 +0200 aw r272599 : #i89784# version before stripping
2009-06-03 17:52:18 +0200 aw r272598 : #i89784# version before stripping
2009-05-28 17:15:47 +0200 aw r272420 : #i101872# old stuff removed/stripped
2009-05-28 17:15:32 +0200 aw r272419 : #i101872# old stuff removed/stripped
2009-05-28 17:15:15 +0200 aw r272418 : #i101872# old stuff removed/stripped
2009-05-28 17:14:45 +0200 aw r272417 : #i101872# old stuff removed/stripped
2009-05-28 12:13:56 +0200 aw r272396 : #i101872# stable hybrid state
2009-05-28 12:13:46 +0200 aw r272395 : #i101872# stable hybrid state
2009-05-28 12:13:35 +0200 aw r272394 : #i101872# stable hybrid state
2009-05-28 12:13:20 +0200 aw r272393 : #i101872# stable hybrid state
2009-05-28 12:13:05 +0200 aw r272392 : #i101872# stable hybrid state
2009-05-28 12:12:51 +0200 aw r272391 : #i101872# stable hybrid state
2009-05-15 16:56:02 +0200 aw r271952 : #i101872# HitTest unifications
2009-05-15 16:55:22 +0200 aw r271951 : #i101872# HitTest unifications
2009-05-15 16:55:12 +0200 aw r271950 : #i101872# HitTest unifications
2009-05-15 16:55:01 +0200 aw r271949 : #i101872# HitTest unifications
2009-05-15 16:54:51 +0200 aw r271948 : #i101872# HitTest unifications
2009-05-15 16:54:35 +0200 aw r271947 : #i101872# HitTest unifications
2009-05-15 16:54:22 +0200 aw r271946 : #i101872# HitTest unifications
2009-05-12 19:08:38 +0200 aw r271834 : #i101684# corrected AutoShape's preparation of text transformation due to different definitions in TextBounds
2009-05-12 15:44:49 +0200 aw r271827 : #i89784# expanded TextLayouterDevice::getTextOutlines() to support DXArray and X-Font scaling
2009-05-11 19:40:40 +0200 aw r271790 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:25 +0200 aw r271789 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 19:40:12 +0200 aw r271788 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
2009-05-11 13:01:53 +0200 aw r271765 : #i99385# corrections and optimizations
2009-05-08 14:48:40 +0200 aw r271718 : #i1016180# added optimizations in model operations when model is locked
2009-05-08 14:11:45 +0200 aw r271716 : #i101679# added flush() calls to OverlayManager when interaction step is prepared
2009-05-07 17:44:03 +0200 aw r271689 : #i99385# last corrections/changes
2009-05-07 17:43:47 +0200 aw r271688 : #i99385# last corrections/changes
2009-05-07 13:20:09 +0200 aw r271654 : #i99385# added changes from WFH
2009-05-07 13:19:38 +0200 aw r271653 : #i99385# added changes from WFH
2009-05-07 13:19:11 +0200 aw r271652 : #i99385# added changes from WFH
2009-05-07 11:33:17 +0200 aw r271643 : #i99385# corrections after resync
2009-05-07 11:17:31 +0200 aw r271642 : #i99385# corrections after resync
2009-05-06 18:46:53 +0200 aw r271609 : CWS-TOOLING: rebase CWS aw065 to trunk@271427 (milestone: DEV300:m47)
2009-05-05 18:24:03 +0200 aw r271548 : #i101443# force new text decomposition when TextBackgroundColor has changed
2009-05-05 17:44:42 +0200 aw r271542 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:32 +0200 aw r271541 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:20 +0200 aw r271540 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 17:44:09 +0200 aw r271539 : #i99385# 3rd round, simplifications and corrections done
2009-05-05 15:48:38 +0200 aw r271527 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:15 +0200 aw r271526 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:48:03 +0200 aw r271525 : #i99385# 2nd round, usages checked and corrected
2009-05-05 15:47:51 +0200 aw r271524 : #i99385# 2nd round, usages checked and corrected
2009-04-27 18:33:10 +0200 aw r271300 : #i99385# state commit after all implementations are done
2009-04-27 15:36:53 +0200 aw r271283 : #i99385# state commit after all implementations are done
2009-04-27 15:27:49 +0200 aw r271280 : #i99385# state commit after all implementations are done
2009-04-27 15:27:33 +0200 aw r271279 : #i99385# state commit after all implementations are done
2009-04-27 15:27:00 +0200 aw r271278 : #i99385# state commit after all implementations are done
2009-04-27 15:26:15 +0200 aw r271277 : #i99385# state commit after all implementations are done
2009-04-27 15:25:40 +0200 aw r271275 : #i99385# state commit after all implementations are done
2009-04-27 15:25:19 +0200 aw r271274 : #i99385# state commit after all implementations are done
2009-04-27 15:24:00 +0200 aw r271272 : #i99385# state commit after all implementations are done
2009-03-19 17:12:00 +0100 aw r269757 : #i100360# corrected bitmap's PefSize calculation for bitmap filled objects when Bitmap is Pixel-based on it's mapping
2009-02-19 17:09:47 +0100 aw r268298 : #i98917# corrected attributes
2009-02-19 17:09:30 +0100 aw r268297 : #i98917# corrected attributes
2009-02-19 17:08:22 +0100 aw r268296 : #i98917# corrected attributes
2009-02-19 11:56:25 +0100 aw r268268 : #i98870# added extra code to react on PageNumber change
2009-02-18 16:57:24 +0100 aw r268243 : #i98917# in OverlayHatchRect::getGeometry the rotation was not applied to the TopLeft of the centered rectangle, but to the already extended one, thus the visualisation was rotating around the wrong edge
2009-07-02 14:28:15 +00:00
|
|
|
}
|
|
|
|
|
2009-09-17 10:29:02 +00:00
|
|
|
return mrDevice.GetTextOutlines(
|
|
|
|
rB2DPolyPolyVector,
|
|
|
|
rText,
|
|
|
|
nIndex,
|
|
|
|
nIndex,
|
|
|
|
nLength,
|
|
|
|
true,
|
|
|
|
0,
|
|
|
|
&(aIntegerDXArray[0]));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return mrDevice.GetTextOutlines(
|
|
|
|
rB2DPolyPolyVector,
|
|
|
|
rText,
|
|
|
|
nIndex,
|
|
|
|
nIndex,
|
2015-10-20 11:45:15 +02:00
|
|
|
nLength);
|
2009-09-17 10:29:02 +00:00
|
|
|
}
|
2006-10-19 09:40:02 +00:00
|
|
|
}
|
|
|
|
|
2007-10-01 08:14:08 +00:00
|
|
|
basegfx::B2DRange TextLayouterDevice::getTextBoundRect(
|
2013-08-21 13:18:34 +02:00
|
|
|
const OUString& rText,
|
2010-02-02 12:16:54 +01:00
|
|
|
sal_uInt32 nIndex,
|
|
|
|
sal_uInt32 nLength) const
|
2006-10-19 09:40:02 +00:00
|
|
|
{
|
2010-02-02 12:16:54 +01:00
|
|
|
sal_uInt32 nTextLength(nLength);
|
2013-08-21 13:18:34 +02:00
|
|
|
const sal_uInt32 nStringLength(rText.getLength());
|
2010-02-02 12:16:54 +01:00
|
|
|
|
|
|
|
if(nTextLength + nIndex > nStringLength)
|
|
|
|
{
|
|
|
|
nTextLength = nStringLength - nIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(nTextLength)
|
2006-10-19 09:40:02 +00:00
|
|
|
{
|
|
|
|
Rectangle aRect;
|
2007-10-01 08:14:08 +00:00
|
|
|
|
2007-09-26 10:36:58 +00:00
|
|
|
mrDevice.GetTextBoundRect(
|
|
|
|
aRect,
|
|
|
|
rText,
|
2007-10-01 08:14:08 +00:00
|
|
|
nIndex,
|
|
|
|
nIndex,
|
|
|
|
nLength);
|
2006-10-19 09:40:02 +00:00
|
|
|
|
2009-09-17 10:29:02 +00:00
|
|
|
// #i104432#, #i102556# take empty results into account
|
2009-08-26 14:41:39 +00:00
|
|
|
if(!aRect.IsEmpty())
|
|
|
|
{
|
2010-02-02 12:16:54 +01:00
|
|
|
return basegfx::B2DRange(
|
|
|
|
aRect.Left(), aRect.Top(),
|
|
|
|
aRect.Right(), aRect.Bottom());
|
2009-08-26 14:41:39 +00:00
|
|
|
}
|
2006-10-19 09:40:02 +00:00
|
|
|
}
|
2009-08-26 14:41:39 +00:00
|
|
|
|
|
|
|
return basegfx::B2DRange();
|
2006-10-19 09:40:02 +00:00
|
|
|
}
|
2009-11-12 11:26:43 +01:00
|
|
|
|
|
|
|
double TextLayouterDevice::getFontAscent() const
|
|
|
|
{
|
|
|
|
const ::FontMetric& rMetric = mrDevice.GetFontMetric();
|
|
|
|
return rMetric.GetAscent();
|
|
|
|
}
|
|
|
|
|
|
|
|
double TextLayouterDevice::getFontDescent() const
|
|
|
|
{
|
|
|
|
const ::FontMetric& rMetric = mrDevice.GetFontMetric();
|
|
|
|
return rMetric.GetDescent();
|
|
|
|
}
|
2009-11-23 12:30:29 +01:00
|
|
|
|
|
|
|
void TextLayouterDevice::addTextRectActions(
|
|
|
|
const Rectangle& rRectangle,
|
2013-08-21 13:18:34 +02:00
|
|
|
const OUString& rText,
|
2015-05-18 13:36:39 +02:00
|
|
|
DrawTextFlags nStyle,
|
2010-02-02 12:16:54 +01:00
|
|
|
GDIMetaFile& rGDIMetaFile) const
|
2009-11-23 12:30:29 +01:00
|
|
|
{
|
|
|
|
mrDevice.AddTextRectActions(
|
|
|
|
rRectangle, rText, nStyle, rGDIMetaFile);
|
|
|
|
}
|
2010-02-02 12:16:54 +01:00
|
|
|
|
|
|
|
::std::vector< double > TextLayouterDevice::getTextArray(
|
2013-08-21 13:18:34 +02:00
|
|
|
const OUString& rText,
|
2010-02-02 12:16:54 +01:00
|
|
|
sal_uInt32 nIndex,
|
|
|
|
sal_uInt32 nLength) const
|
|
|
|
{
|
|
|
|
::std::vector< double > aRetval;
|
|
|
|
sal_uInt32 nTextLength(nLength);
|
2013-08-21 13:18:34 +02:00
|
|
|
const sal_uInt32 nStringLength(rText.getLength());
|
2010-02-02 12:16:54 +01:00
|
|
|
|
|
|
|
if(nTextLength + nIndex > nStringLength)
|
|
|
|
{
|
|
|
|
nTextLength = nStringLength - nIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(nTextLength)
|
|
|
|
{
|
|
|
|
aRetval.reserve(nTextLength);
|
2014-07-18 18:21:12 +02:00
|
|
|
::std::vector<long> aArray(nTextLength);
|
2011-05-16 13:27:04 +02:00
|
|
|
mrDevice.GetTextArray(rText, &aArray[0], nIndex, nLength);
|
|
|
|
aRetval.assign(aArray.begin(), aArray.end());
|
2010-02-02 12:16:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return aRetval;
|
|
|
|
}
|
|
|
|
|
2006-10-19 09:40:02 +00:00
|
|
|
} // end of namespace primitive2d
|
|
|
|
} // end of namespace drawinglayer
|
|
|
|
|
2014-02-25 18:21:10 +01:00
|
|
|
|
2007-11-19 09:21:42 +00:00
|
|
|
// helper methods for vcl font handling
|
|
|
|
|
|
|
|
namespace drawinglayer
|
|
|
|
{
|
|
|
|
namespace primitive2d
|
|
|
|
{
|
2014-09-16 10:09:58 +02:00
|
|
|
vcl::Font getVclFontFromFontAttribute(
|
2009-11-12 11:26:43 +01:00
|
|
|
const attribute::FontAttribute& rFontAttribute,
|
2007-11-19 09:21:42 +00:00
|
|
|
double fFontScaleX,
|
|
|
|
double fFontScaleY,
|
|
|
|
double fFontRotation,
|
2015-09-11 14:46:52 +02:00
|
|
|
const css::lang::Locale& rLocale)
|
2007-11-19 09:21:42 +00:00
|
|
|
{
|
2009-09-17 10:29:02 +00:00
|
|
|
// detect FontScaling
|
|
|
|
const sal_uInt32 nHeight(basegfx::fround(fabs(fFontScaleY)));
|
|
|
|
const sal_uInt32 nWidth(basegfx::fround(fabs(fFontScaleX)));
|
|
|
|
const bool bFontIsScaled(nHeight != nWidth);
|
|
|
|
|
|
|
|
#ifdef WIN32
|
|
|
|
// for WIN32 systems, start with creating an unscaled font. If FontScaling
|
|
|
|
// is wanted, that width needs to be adapted using FontMetric again to get a
|
|
|
|
// width of the unscaled font
|
2014-09-16 10:09:58 +02:00
|
|
|
vcl::Font aRetval(
|
2009-11-12 11:26:43 +01:00
|
|
|
rFontAttribute.getFamilyName(),
|
|
|
|
rFontAttribute.getStyleName(),
|
2007-11-19 09:21:42 +00:00
|
|
|
Size(0, nHeight));
|
|
|
|
#else
|
2009-09-17 10:29:02 +00:00
|
|
|
// for non-WIN32 systems things are easier since these accept a Font creation
|
|
|
|
// with initially nWidth != nHeight for FontScaling. Despite that, use zero for
|
2011-12-01 23:41:42 +02:00
|
|
|
// FontWidth when no scaling is used to explicitly have that zero when e.g. the
|
2009-09-17 10:29:02 +00:00
|
|
|
// Font would be recorded in a MetaFile (The MetaFile FontAction WILL record a
|
|
|
|
// set FontWidth; import that in a WIN32 system, and trouble is there)
|
2014-09-16 10:09:58 +02:00
|
|
|
vcl::Font aRetval(
|
2009-11-12 11:26:43 +01:00
|
|
|
rFontAttribute.getFamilyName(),
|
|
|
|
rFontAttribute.getStyleName(),
|
2014-11-03 18:11:01 +01:00
|
|
|
Size(bFontIsScaled ? std::max<sal_uInt32>(nWidth, 1) : 0, nHeight));
|
2007-11-19 09:21:42 +00:00
|
|
|
#endif
|
2009-11-12 11:26:43 +01:00
|
|
|
// define various other FontAttribute
|
2007-11-19 09:21:42 +00:00
|
|
|
aRetval.SetAlign(ALIGN_BASELINE);
|
2009-11-12 11:26:43 +01:00
|
|
|
aRetval.SetCharSet(rFontAttribute.getSymbol() ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE);
|
2015-04-24 12:25:35 +02:00
|
|
|
aRetval.SetVertical(rFontAttribute.getVertical());
|
2009-11-12 11:26:43 +01:00
|
|
|
aRetval.SetWeight(static_cast<FontWeight>(rFontAttribute.getWeight()));
|
|
|
|
aRetval.SetItalic(rFontAttribute.getItalic() ? ITALIC_NORMAL : ITALIC_NONE);
|
|
|
|
aRetval.SetOutline(rFontAttribute.getOutline());
|
2010-09-30 16:10:11 +01:00
|
|
|
aRetval.SetPitch(rFontAttribute.getMonospaced() ? PITCH_FIXED : PITCH_VARIABLE);
|
2013-07-13 02:54:05 +02:00
|
|
|
aRetval.SetLanguage(LanguageTag::convertToLanguageType( rLocale, false));
|
2007-11-19 09:21:42 +00:00
|
|
|
|
|
|
|
#ifdef WIN32
|
2009-09-17 10:29:02 +00:00
|
|
|
// for WIN32 systems, correct the FontWidth if FontScaling is used
|
|
|
|
if(bFontIsScaled && nHeight > 0)
|
2007-11-19 09:21:42 +00:00
|
|
|
{
|
2009-09-17 10:29:02 +00:00
|
|
|
const FontMetric aUnscaledFontMetric(Application::GetDefaultDevice()->GetFontMetric(aRetval));
|
|
|
|
|
|
|
|
if(aUnscaledFontMetric.GetWidth() > 0)
|
|
|
|
{
|
|
|
|
const double fScaleFactor((double)nWidth / (double)nHeight);
|
|
|
|
const sal_uInt32 nScaledWidth(basegfx::fround((double)aUnscaledFontMetric.GetWidth() * fScaleFactor));
|
|
|
|
aRetval.SetWidth(nScaledWidth);
|
|
|
|
}
|
2007-11-19 09:21:42 +00:00
|
|
|
}
|
|
|
|
#endif
|
2009-09-17 10:29:02 +00:00
|
|
|
// handle FontRotation (if defined)
|
2007-11-19 09:21:42 +00:00
|
|
|
if(!basegfx::fTools::equalZero(fFontRotation))
|
|
|
|
{
|
|
|
|
sal_Int16 aRotate10th((sal_Int16)(fFontRotation * (-1800.0/F_PI)));
|
|
|
|
aRetval.SetOrientation(aRotate10th % 3600);
|
|
|
|
}
|
|
|
|
|
|
|
|
return aRetval;
|
|
|
|
}
|
|
|
|
|
2009-11-12 11:26:43 +01:00
|
|
|
attribute::FontAttribute getFontAttributeFromVclFont(
|
2009-09-17 10:29:02 +00:00
|
|
|
basegfx::B2DVector& o_rSize,
|
2014-09-16 10:09:58 +02:00
|
|
|
const vcl::Font& rFont,
|
2009-09-17 10:29:02 +00:00
|
|
|
bool bRTL,
|
|
|
|
bool bBiDiStrong)
|
2007-11-19 09:21:42 +00:00
|
|
|
{
|
2009-11-12 11:26:43 +01:00
|
|
|
const attribute::FontAttribute aRetval(
|
2007-11-19 09:21:42 +00:00
|
|
|
rFont.GetName(),
|
|
|
|
rFont.GetStyleName(),
|
|
|
|
static_cast<sal_uInt16>(rFont.GetWeight()),
|
|
|
|
RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet(),
|
|
|
|
rFont.IsVertical(),
|
|
|
|
ITALIC_NONE != rFont.GetItalic(),
|
2010-09-30 16:10:11 +01:00
|
|
|
PITCH_FIXED == rFont.GetPitch(),
|
2007-11-19 09:21:42 +00:00
|
|
|
rFont.IsOutline(),
|
|
|
|
bRTL,
|
|
|
|
bBiDiStrong);
|
|
|
|
// TODO: eKerning
|
|
|
|
|
2009-09-17 10:29:02 +00:00
|
|
|
// set FontHeight and init to no FontScaling
|
|
|
|
o_rSize.setY(rFont.GetSize().getHeight() > 0 ? rFont.GetSize().getHeight() : 0);
|
|
|
|
o_rSize.setX(o_rSize.getY());
|
2007-11-19 09:21:42 +00:00
|
|
|
|
2009-09-17 10:29:02 +00:00
|
|
|
#ifdef WIN32
|
|
|
|
// for WIN32 systems, the FontScaling at the Font is detected by
|
|
|
|
// checking that FontWidth != 0. When FontScaling is used, WIN32
|
|
|
|
// needs to do extra stuff to detect the correct width (since it's
|
2014-04-10 19:59:38 +03:00
|
|
|
// zero and not equal the font height) and its relationship to
|
2009-09-17 10:29:02 +00:00
|
|
|
// the height
|
|
|
|
if(rFont.GetSize().getWidth() > 0)
|
|
|
|
{
|
2014-09-18 11:59:42 +02:00
|
|
|
vcl::Font aUnscaledFont(rFont);
|
2009-09-17 10:29:02 +00:00
|
|
|
aUnscaledFont.SetWidth(0);
|
|
|
|
const FontMetric aUnscaledFontMetric(Application::GetDefaultDevice()->GetFontMetric(aUnscaledFont));
|
2007-11-19 09:21:42 +00:00
|
|
|
|
2009-09-17 10:29:02 +00:00
|
|
|
if(aUnscaledFontMetric.GetWidth() > 0)
|
|
|
|
{
|
|
|
|
const double fScaleFactor((double)rFont.GetSize().getWidth() / (double)aUnscaledFontMetric.GetWidth());
|
|
|
|
o_rSize.setX(fScaleFactor * o_rSize.getY());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
// For non-WIN32 systems the detection is the same, but the value
|
|
|
|
// is easier achieved since width == height is interpreted as no
|
|
|
|
// scaling. Ergo, Width == 0 means width == height, and width != 0
|
|
|
|
// means the scaling is in the direct relation of width to height
|
|
|
|
if(rFont.GetSize().getWidth() > 0)
|
|
|
|
{
|
|
|
|
o_rSize.setX((double)rFont.GetSize().getWidth());
|
|
|
|
}
|
|
|
|
#endif
|
2007-11-19 09:21:42 +00:00
|
|
|
return aRetval;
|
|
|
|
}
|
|
|
|
} // end of namespace primitive2d
|
|
|
|
} // end of namespace drawinglayer
|
|
|
|
|
2010-10-12 15:53:47 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|