2006-10-19 09:40:02 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
|
|
|
*
|
|
|
|
* $RCSfile: textlayoutdevice.cxx,v $
|
|
|
|
*
|
2008-05-27 13:11:34 +00:00
|
|
|
* $Revision: 1.10 $
|
2006-10-19 09:40:02 +00:00
|
|
|
*
|
2008-05-27 13:11:34 +00:00
|
|
|
* last change: $Author: aw $ $Date: 2008-05-27 14:11:20 $
|
2006-10-19 09:40:02 +00:00
|
|
|
*
|
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2008-03-05 08:18:45 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_drawinglayer.hxx"
|
|
|
|
|
2006-10-19 09:40:02 +00:00
|
|
|
#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
|
|
|
|
#include <vcl/timer.hxx>
|
|
|
|
#include <vcl/virdev.hxx>
|
|
|
|
#include <vcl/font.hxx>
|
2007-02-14 13:53:01 +00:00
|
|
|
#include <vcl/metric.hxx>
|
2006-10-19 09:40:02 +00:00
|
|
|
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
|
2007-11-19 09:21:42 +00:00
|
|
|
|
2006-10-19 09:40:02 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// VDev RevDevice provider
|
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
class ImpTimedRefDev : public Timer
|
|
|
|
{
|
|
|
|
ImpTimedRefDev** mppStaticPointerOnMe;
|
|
|
|
VirtualDevice* mpVirDev;
|
|
|
|
sal_uInt32 mnUseCount;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ImpTimedRefDev(ImpTimedRefDev** ppStaticPointerOnMe);
|
|
|
|
~ImpTimedRefDev();
|
|
|
|
virtual void Timeout();
|
|
|
|
|
|
|
|
VirtualDevice& acquireVirtualDevice();
|
|
|
|
void releaseVirtualDevice();
|
|
|
|
};
|
|
|
|
|
|
|
|
ImpTimedRefDev::ImpTimedRefDev(ImpTimedRefDev** ppStaticPointerOnMe)
|
|
|
|
: mppStaticPointerOnMe(ppStaticPointerOnMe),
|
|
|
|
mpVirDev(0L),
|
|
|
|
mnUseCount(0L)
|
|
|
|
{
|
|
|
|
SetTimeout(3L * 60L * 1000L); // three minutes
|
|
|
|
Start();
|
|
|
|
}
|
|
|
|
|
|
|
|
ImpTimedRefDev::~ImpTimedRefDev()
|
|
|
|
{
|
|
|
|
OSL_ENSURE(0L == mnUseCount, "destruction of a still used ImpTimedRefDev (!)");
|
|
|
|
|
|
|
|
if(mppStaticPointerOnMe && *mppStaticPointerOnMe)
|
|
|
|
{
|
|
|
|
*mppStaticPointerOnMe = 0L;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(mpVirDev)
|
|
|
|
{
|
|
|
|
delete mpVirDev;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ImpTimedRefDev::Timeout()
|
|
|
|
{
|
|
|
|
// for obvious reasons, do not call anything after this
|
|
|
|
delete (this);
|
|
|
|
}
|
|
|
|
|
|
|
|
VirtualDevice& ImpTimedRefDev::acquireVirtualDevice()
|
|
|
|
{
|
|
|
|
if(!mpVirDev)
|
|
|
|
{
|
|
|
|
mpVirDev = new VirtualDevice();
|
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
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// access to one global ImpTimedRefDev incarnation in namespace drawinglayer::primitive
|
|
|
|
|
|
|
|
namespace drawinglayer
|
|
|
|
{
|
|
|
|
namespace primitive2d
|
|
|
|
{
|
|
|
|
// static pointer here
|
2007-01-25 11:15:23 +00:00
|
|
|
static ImpTimedRefDev* pImpGlobalRefDev = 0L;
|
2006-10-19 09:40:02 +00:00
|
|
|
|
|
|
|
// static methods here
|
|
|
|
VirtualDevice& acquireGlobalVirtualDevice()
|
|
|
|
{
|
|
|
|
if(!pImpGlobalRefDev)
|
|
|
|
{
|
|
|
|
pImpGlobalRefDev = new ImpTimedRefDev(&pImpGlobalRefDev);
|
|
|
|
}
|
|
|
|
|
|
|
|
return pImpGlobalRefDev->acquireVirtualDevice();
|
|
|
|
}
|
|
|
|
|
|
|
|
void releaseGlobalVirtualDevice()
|
|
|
|
{
|
|
|
|
OSL_ENSURE(pImpGlobalRefDev, "releaseGlobalVirtualDevice() without prior acquireGlobalVirtualDevice() call(!)");
|
|
|
|
pImpGlobalRefDev->releaseVirtualDevice();
|
|
|
|
}
|
|
|
|
|
|
|
|
TextLayouterDevice::TextLayouterDevice()
|
|
|
|
: mrDevice(acquireGlobalVirtualDevice())
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
TextLayouterDevice::~TextLayouterDevice()
|
|
|
|
{
|
|
|
|
releaseGlobalVirtualDevice();
|
|
|
|
}
|
|
|
|
|
|
|
|
void TextLayouterDevice::setFont(const Font& rFont)
|
|
|
|
{
|
2007-01-25 11:15:23 +00:00
|
|
|
mrDevice.SetFont( rFont );
|
2006-10-19 09:40:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TextLayouterDevice::setFontAttributes(const FontAttributes& rFontAttributes, const basegfx::B2DHomMatrix& rTransform)
|
|
|
|
{
|
2007-11-19 09:21:42 +00:00
|
|
|
setFont(getVclFontFromFontAttributes(rFontAttributes, rTransform, mrDevice));
|
|
|
|
}
|
|
|
|
|
|
|
|
void TextLayouterDevice::setFontAttributes(const FontAttributes& rFontAttributes, double fFontScaleX, double fFontScaleY)
|
|
|
|
{
|
|
|
|
setFont(getVclFontFromFontAttributes(rFontAttributes, fFontScaleX, fFontScaleY, 0.0, mrDevice));
|
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;
|
|
|
|
}
|
|
|
|
|
CWS-TOOLING: integrate CWS aw059
2008-12-16 16:15:40 +0100 aw r265557 : #i95645# avoid expensive tries to stream in graphic data when stream is at end anyways
2008-12-15 16:49:58 +0100 wg r265512 : i97278
2008-12-12 16:02:15 +0100 aw r265427 : #i95645# new formulation was wrong in two places; thanks go to THB. Thanks!
2008-12-12 15:49:06 +0100 aw r265425 : #i95645# refined formulation of AA on/off constraints for VCLCanvas
2008-12-12 14:51:26 +0100 aw r265420 : #i95645# workaround for DrawTransparent of button hilighting when remote displayed; somehow GDI+ does bad dithering in that case
2008-12-12 13:23:00 +0100 aw r265414 : removed temporary build hack; it made it's way in using the rebase; with SVN the rebase is not based on pure checkouts, but uses local changes.
2008-12-11 19:35:59 +0100 aw r265352 : #i95645# need to switch off AA for WNT and UNX, the VCLCanvas is currently not able to handle AA correctly
2008-12-11 16:05:17 +0100 thb r265327 : #i95645# Changed defaults to on; as for the while svx dialog is not changed
2008-12-10 13:40:38 +0100 aw r265180 : #i95645# changed pixel snap to basegfx::fround
2008-12-10 13:25:45 +0100 aw r265177 : corrected linux warning
2008-12-10 12:28:02 +0100 aw r265167 : #i95645# added support for pixel snap/linux resp. no AA for mac (also pixel snap) when AA is switched off to the basegfx::B2DPolyPolygon painting VCL methods; needed for e.g. selection in SC and SW
2008-12-09 18:44:39 +0100 aw r265136 : #i95645# corrected filled path construction
2008-12-09 18:12:40 +0100 aw r265133 : #i95645# added support for non-AAd transparent paints
2008-12-09 18:11:58 +0100 aw r265132 : #i95645# forced selection without AA
2008-12-09 18:11:29 +0100 aw r265131 : #i88893# smoothed/corrected SW selection rects for transparent selection, forced selection without AA
2008-12-09 15:21:39 +0100 aw r265094 : #i95645# corrected FormControl full drag
2008-12-09 15:11:26 +0100 aw r265093 : #i95645# make gdiplus usages more safe when no line or fill color is selected
2008-12-09 14:30:09 +0100 aw r265085 : #i95645# added GDIPlus support
2008-12-09 13:41:06 +0100 aw r265081 : #i95645# added simple AA using GDIPlis to VCL
2008-12-09 13:40:46 +0100 aw r265080 : #i95645# added simple AA using GDIPlis to VCL
2008-12-09 13:40:29 +0100 aw r265079 : #i95645# added simple AA using GDIPlis to VCL
2008-12-09 13:33:16 +0100 aw r265078 : #i95645# changes to requirements, discussed with FPE
2008-12-08 14:11:39 +0100 aw r264995 : #i95646# added missing extra-wireframe for SdrDragObjOwn implementations when object has no border
2008-12-08 14:11:00 +0100 aw r264994 : #i95646# corrected RenderMarkerArrayPrimitive2D OutDev usage in VclProcessor2D
2008-12-08 12:15:10 +0100 ufi r264987 : aw059
2008-12-08 12:14:40 +0100 ufi r264986 : aw059
2008-12-05 13:16:18 +0100 aw r264905 : CWS-TOOLING: rebase CWS aw059 to trunk@264807 (milestone: DEV300:m37)
2008-12-04 11:29:48 +0100 aw r264827 : #i95645# corrected warning
2008-12-03 14:43:39 +0100 aw r264783 : #i95645# simplified overlay manager and objects to stl vector; added stuff to render some more overlay to primitive renderer to get AA support for WIN32
2008-12-03 14:42:43 +0100 aw r264782 : #i95645# added test for WIN32 for AA if cairo canvas is available
2008-12-03 14:42:13 +0100 aw r264781 : #i95645# removed unused options for writer selection overlay
2008-12-03 14:41:51 +0100 aw r264780 : #i95645# removed unused options for calc overlay
2008-12-03 14:41:21 +0100 aw r264779 : #i95645# small corrections in canvas renderer
2008-12-02 18:32:31 +0100 aw r264730 : #i95646# merged cairo version from THB's CWS cairosource01
2008-12-02 15:25:45 +0100 aw r264705 : #i95645# added helpers for the MarkerArrayPrimitive2D change which support buffered creation of the most used markers
2008-12-02 12:50:01 +0100 aw r264690 : #i95645# added a non-saved method IsAAPossibleOnThisSystem to SvtOptionsDrawinglayer to quickly test if AA can be offered on the system, added buffering of that check.
2008-12-02 12:48:51 +0100 aw r264689 : #i95645# unified MarkerArrayPrimitive2D to work bitmap-orientated, adapted usages. Added buffered preparation for needed markers. Minor adaptions for AA
2008-12-02 12:47:53 +0100 aw r264688 : #i95645# unified MarkerArrayPrimitive2D to no longer work on a enum and types of markers, but to use a BitmapEx (or any other Bitmap object) which will be displayed centerd and in discrete coordinates at positions. Adapted decomposition and all usages. Corrected minor stuff with grid primitive
2008-11-28 17:11:12 +0100 thb r264565 : #i95645# Added two more lists to config; to be able to differentiate canvas capabilities
2008-11-28 17:03:27 +0100 thb r264563 : #i95645# Added two more lists to config; to be able to differentiate canvas capabilities
2008-11-28 17:00:07 +0100 thb r264562 : #i95645# Added two more lists to config; to be able to differentiate canvas capabilities
2008-11-28 16:59:51 +0100 thb r264561 : #i95645# Added two more lists to config; to be able to differentiate canvas capabilities
2008-11-27 19:13:42 +0100 aw r264519 : #i95646# optimized getLength() a little bit
2008-11-27 19:12:50 +0100 aw r264518 : #i95646# corrected AA expansion of invalidate frame; buffered discrete distance at OM
2008-11-27 18:50:05 +0100 aw r264516 : #i95646# corrected fit to frame texts for WIN32
2008-11-27 15:32:15 +0100 aw r264496 : #i95646# helplines corrected
2008-11-27 15:32:05 +0100 aw r264495 : #i95646# helplines corrected
2008-11-27 15:01:30 +0100 aw r264492 : #i95646# enable AA support for old polygons, especially to get support for MetaFile output
2008-11-27 14:33:28 +0100 aw r264489 : #i95646# AA support for wireframe overlays
2008-11-27 13:40:54 +0100 aw r264485 : #i95646# added full repaint when AA option changes
2008-11-27 13:29:19 +0100 aw r264482 : #i95646# corrected handling of bSolidDragging config entries
2008-11-27 13:29:08 +0100 aw r264481 : #i95646# corrected handling of bSolidDragging config entries
2008-11-27 11:30:12 +0100 aw r264469 : #i95646# corrected IsAAPossibleOnThisSystem implementation
2008-11-26 16:33:04 +0100 aw r264420 : #i95646# adapted OfaViewTabPage to use disable mechanism for AA and HWAccel
2008-11-26 15:49:19 +0100 aw r264406 : #i95646# added DlgEdObj::getFullDragClone() to create specialized simple SdrUnoObj clones for solid dragging
2008-11-26 15:48:11 +0100 aw r264405 : #i95646# changed derivation of ViewObjectContactOfUnoControl to get a valid isPrimitiveVisible() implementation
2008-11-26 14:11:37 +0100 aw r264385 : #i88893# added new look for selection in sw
2008-11-26 11:32:33 +0100 aw r264360 : corrected compiler warning
2008-11-25 18:46:29 +0100 aw r264328 : #i95646# snapshot with FullDrag clones
2008-11-25 18:46:07 +0100 aw r264327 : #i95646# snapshot with FullDrag clones
2008-11-25 18:45:43 +0100 aw r264326 : #i95646# snapshot with FullDrag clones
2008-11-25 18:19:04 +0100 thb r264324 : #i96585# Added missing inline specifier
2008-11-25 13:16:25 +0100 aw r264285 : #i95646# next snapshot
2008-11-25 13:15:33 +0100 aw r264284 : #i95646# next snapshot
2008-11-25 13:15:12 +0100 aw r264283 : #i95646# next snapshot
2008-11-25 13:14:51 +0100 aw r264282 : #i95646# next snapshot
2008-11-20 13:40:49 +0100 aw r264045 : #i95646# stable snapshot
2008-11-20 13:40:29 +0100 aw r264044 : #i95646# stable snapshot
2008-11-20 13:40:06 +0100 aw r264043 : #i95646# stable snapshot
2008-11-20 13:39:45 +0100 aw r264042 : #i95646# stable snapshot
2008-11-18 11:53:39 +0100 aw r263758 : #i95646# snapshot for linux test build
2008-11-18 11:52:54 +0100 aw r263757 : #i95646# snapshot for linux test build
2008-11-18 11:52:02 +0100 aw r263756 : #i95646# snapshot for linux test build
2008-11-14 18:17:49 +0100 aw r263692 : #i95646# snapshot with most stuff working
2008-11-14 18:14:26 +0100 aw r263691 : #i95646# snapshot with most stuff working
2008-11-14 18:12:50 +0100 aw r263690 : #i95646# snapshot with most stuff working
2008-11-14 18:12:16 +0100 aw r263689 : #i95646# snapshot with most stuff working
2008-11-14 18:11:41 +0100 aw r263688 : #i95646# snapshot with most stuff working
2008-11-07 18:44:22 +0100 aw r263479 : #i95968# better support PrefMapMode; special for MAP_PIXEL was missing
2008-11-05 17:39:15 +0100 aw r263356 : #i95644# #i95645# #i95646# bigger change done, saving for another experiment
2008-11-05 17:39:02 +0100 aw r263355 : #i95644# #i95645# #i95646# bigger change done, saving for another experiment
2008-11-05 12:28:32 +0100 aw r263350 : #i95644# #i95645# #i95646# in-between state before bigger change
2008-11-05 12:27:51 +0100 aw r263349 : #i95644# #i95645# #i95646# in-between state before bigger change
2008-11-05 12:26:58 +0100 aw r263348 : #i95644# #i95645# #i95646# in-between state before bigger change
2008-11-05 12:26:17 +0100 aw r263347 : #i95644# #i95645# #i95646# in-between state before bigger change
2008-11-05 12:25:55 +0100 aw r263346 : #i95644# #i95645# #i95646# in-between state before bigger change
2009-01-05 13:44:12 +00:00
|
|
|
#ifdef WIN32
|
|
|
|
double TextLayouterDevice::getCurrentFontRelation() const
|
|
|
|
{
|
|
|
|
const Font aFont(mrDevice.GetFont());
|
|
|
|
const FontMetric aFontMetric(mrDevice.GetFontMetric(aFont));
|
|
|
|
const double fWidth(aFontMetric.GetWidth());
|
|
|
|
const double fHeight(aFont.GetHeight());
|
|
|
|
|
|
|
|
return basegfx::fTools::equalZero(fWidth) ? 1.0 : fHeight / fWidth;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
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(
|
|
|
|
const String& rText,
|
|
|
|
xub_StrLen nIndex,
|
|
|
|
xub_StrLen 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,
|
|
|
|
const String& rText,
|
|
|
|
xub_StrLen 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
|
|
|
xub_StrLen nLength,
|
|
|
|
// #i89784# added suppirt for DXArray for justified text
|
|
|
|
const ::std::vector< double >& rDXArray,
|
|
|
|
double fFontScaleWidth)
|
2006-10-19 09:40:02 +00:00
|
|
|
{
|
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
|
|
|
std::vector< sal_Int32 > aTransformedDXArray;
|
|
|
|
const sal_uInt32 nDXArraySize(rDXArray.size());
|
|
|
|
|
|
|
|
if(nDXArraySize && basegfx::fTools::more(fFontScaleWidth, 0.0))
|
|
|
|
{
|
|
|
|
OSL_ENSURE(nDXArraySize == nLength, "DXArray size does not correspond to text portion size (!)");
|
|
|
|
aTransformedDXArray.reserve(nDXArraySize);
|
|
|
|
|
|
|
|
for(std::vector< double >::const_iterator aStart(rDXArray.begin()); aStart != rDXArray.end(); aStart++)
|
|
|
|
{
|
|
|
|
aTransformedDXArray.push_back(basegfx::fround((*aStart) * fFontScaleWidth));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-09-26 10:36:58 +00:00
|
|
|
return mrDevice.GetTextOutlines(
|
|
|
|
rB2DPolyPolyVector,
|
|
|
|
rText,
|
2007-10-01 08:14:08 +00:00
|
|
|
nIndex,
|
|
|
|
nIndex,
|
|
|
|
nLength,
|
|
|
|
true,
|
|
|
|
0,
|
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
|
|
|
nDXArraySize ? &(aTransformedDXArray[0]) : 0);
|
2006-10-19 09:40:02 +00:00
|
|
|
}
|
|
|
|
|
2007-10-01 08:14:08 +00:00
|
|
|
basegfx::B2DRange TextLayouterDevice::getTextBoundRect(
|
|
|
|
const String& rText,
|
|
|
|
xub_StrLen nIndex,
|
|
|
|
xub_StrLen nLength) const
|
2006-10-19 09:40:02 +00:00
|
|
|
{
|
2007-10-01 08:14:08 +00:00
|
|
|
if(nLength)
|
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
|
|
|
|
|
|
|
return basegfx::B2DRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return basegfx::B2DRange();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // end of namespace primitive2d
|
|
|
|
} // end of namespace drawinglayer
|
|
|
|
|
2007-11-19 09:21:42 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// helper methods for vcl font handling
|
|
|
|
|
|
|
|
namespace drawinglayer
|
|
|
|
{
|
|
|
|
namespace primitive2d
|
|
|
|
{
|
|
|
|
Font getVclFontFromFontAttributes(
|
|
|
|
const FontAttributes& rFontAttributes,
|
|
|
|
const basegfx::B2DHomMatrix& rTransform,
|
|
|
|
const OutputDevice& rOutDev)
|
|
|
|
{
|
|
|
|
// decompose matrix to have position and size of text
|
|
|
|
basegfx::B2DVector aScale, aTranslate;
|
|
|
|
double fRotate, fShearX;
|
|
|
|
|
|
|
|
rTransform.decompose(aScale, aTranslate, fRotate, fShearX);
|
|
|
|
|
|
|
|
return getVclFontFromFontAttributes(rFontAttributes, aScale.getX(), aScale.getY(), fRotate, rOutDev);
|
|
|
|
}
|
|
|
|
|
|
|
|
Font getVclFontFromFontAttributes(
|
|
|
|
const FontAttributes& rFontAttributes,
|
|
|
|
double fFontScaleX,
|
|
|
|
double fFontScaleY,
|
|
|
|
double fFontRotation,
|
2008-10-17 08:40:10 +00:00
|
|
|
const OutputDevice& /*rOutDev*/)
|
2007-11-19 09:21:42 +00:00
|
|
|
{
|
|
|
|
sal_uInt32 nWidth(basegfx::fround(fabs(fFontScaleX)));
|
|
|
|
sal_uInt32 nHeight(basegfx::fround(fabs(fFontScaleY)));
|
|
|
|
Font aRetval(
|
|
|
|
rFontAttributes.getFamilyName(),
|
|
|
|
rFontAttributes.getStyleName(),
|
|
|
|
#ifdef WIN32
|
|
|
|
Size(0, nHeight));
|
|
|
|
#else
|
|
|
|
Size(nWidth, nHeight));
|
|
|
|
#endif
|
|
|
|
|
|
|
|
aRetval.SetAlign(ALIGN_BASELINE);
|
|
|
|
aRetval.SetCharSet(rFontAttributes.getSymbol() ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE);
|
|
|
|
aRetval.SetVertical(rFontAttributes.getVertical() ? TRUE : FALSE);
|
|
|
|
aRetval.SetWeight(static_cast<FontWeight>(rFontAttributes.getWeight()));
|
|
|
|
aRetval.SetItalic(rFontAttributes.getItalic() ? ITALIC_NORMAL : ITALIC_NONE);
|
|
|
|
aRetval.SetOutline(rFontAttributes.getOutline());
|
|
|
|
|
|
|
|
#ifdef WIN32
|
2009-04-02 12:39:35 +00:00
|
|
|
// #100424# use higher precision
|
|
|
|
if(!basegfx::fTools::equal(fFontScaleX, fFontScaleY))
|
2007-11-19 09:21:42 +00:00
|
|
|
{
|
2008-10-17 08:40:10 +00:00
|
|
|
// #i92757#
|
|
|
|
// Removed the relative calculation with GetFontMetric() usage again. On
|
|
|
|
// the one hand it was wrong (integer division always created zero), OTOH
|
|
|
|
// calculating a scale factor from current to target width and then using
|
|
|
|
// it to actually scale the current width does nothing but set the target
|
|
|
|
// value directly. Maybe more is needed here with WIN version of font
|
|
|
|
// width/height handling, but currently, this works the simple way.
|
|
|
|
//
|
|
|
|
// As can be seen, when this can stay the simple way, the OutputDevice
|
|
|
|
// can be removed from the whole getVclFontFromFontAttributes implementations
|
|
|
|
// again and make it more VCL-independent.
|
|
|
|
//
|
|
|
|
// Adapted nWidth usage to nWidth-1 to be completely compatible with
|
|
|
|
// non-primitive version.
|
|
|
|
//
|
|
|
|
// previous stuff:
|
|
|
|
// const FontMetric aFontMetric(rOutDev.GetFontMetric(aRetval));
|
|
|
|
// const double fCurrentWidth(aFontMetric.GetWidth());
|
|
|
|
// aRetval.SetWidth(basegfx::fround(fCurrentWidth * ((double)nWidth/(double)nHeight)));
|
|
|
|
aRetval.SetWidth(nWidth ? nWidth - 1 : 0);
|
2007-11-19 09:21:42 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if(!basegfx::fTools::equalZero(fFontRotation))
|
|
|
|
{
|
|
|
|
sal_Int16 aRotate10th((sal_Int16)(fFontRotation * (-1800.0/F_PI)));
|
|
|
|
aRetval.SetOrientation(aRotate10th % 3600);
|
|
|
|
}
|
|
|
|
|
|
|
|
return aRetval;
|
|
|
|
}
|
|
|
|
|
|
|
|
FontAttributes getFontAttributesFromVclFont(basegfx::B2DVector& rSize, const Font& rFont, bool bRTL, bool bBiDiStrong)
|
|
|
|
{
|
|
|
|
FontAttributes aRetval(
|
|
|
|
rFont.GetName(),
|
|
|
|
rFont.GetStyleName(),
|
|
|
|
static_cast<sal_uInt16>(rFont.GetWeight()),
|
|
|
|
RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet(),
|
|
|
|
rFont.IsVertical(),
|
|
|
|
ITALIC_NONE != rFont.GetItalic(),
|
|
|
|
rFont.IsOutline(),
|
|
|
|
bRTL,
|
|
|
|
bBiDiStrong);
|
|
|
|
// TODO: eKerning
|
|
|
|
|
|
|
|
const sal_Int32 nWidth(rFont.GetSize().getWidth());
|
|
|
|
const sal_Int32 nHeight(rFont.GetSize().getHeight());
|
|
|
|
|
|
|
|
rSize.setX(nWidth ? nWidth : nHeight);
|
|
|
|
rSize.setY(nHeight);
|
|
|
|
|
|
|
|
return aRetval;
|
|
|
|
}
|
|
|
|
} // end of namespace primitive2d
|
|
|
|
} // end of namespace drawinglayer
|
|
|
|
|
2006-10-19 09:40:02 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// eof
|