summaryrefslogtreecommitdiff
path: root/svx/source/customshapes
diff options
context:
space:
mode:
authorArmin Le Grand (Allotropia) <Armin.Le.Grand@me.com>2021-11-18 18:06:39 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-12-09 15:48:27 +0100
commitecd615ab32fcacf8f8116672ebe631d1db72cb4e (patch)
tree213941d2752fc3bcafa788b33dbe11fcbe1b9376 /svx/source/customshapes
parent8677e994d37329a28ca8278358a99d18b9cada69 (diff)
VCL implement GetGlyphOutline fallback
Change-Id: Ia0b32f7fb9f39d8bea18afd12df3cc95ba8077ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126463 Tested-by: Jenkins Tested-by: Armin Le Grand <Armin.Le.Grand@me.com> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'svx/source/customshapes')
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx40
1 files changed, 40 insertions, 0 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index e5756f8ef37d..1284b11e4c65 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -376,6 +376,46 @@ static void GetTextAreaOutline(
{
rParagraph.vCharacters.push_back( aCharacterData );
}
+ else
+ {
+ // GetTextOutlines failed what usually means that it is
+ // not implemented. To make FontWork not fail (it is
+ // dependent of graphic content to get a Range) create
+ // a rectangle substitution for now
+ pVirDev->GetTextArray( rText, &aDXArry);
+ aCharacterData.vOutlines.clear();
+
+ if(aDXArry.size())
+ {
+ for(size_t a(0); a < aDXArry.size(); a++)
+ {
+ const basegfx::B2DPolygon aPolygon(
+ basegfx::utils::createPolygonFromRect(
+ basegfx::B2DRange(
+ 0 == a ? 0 : aDXArry[a - 1],
+ 0,
+ aDXArry[a],
+ aFont.GetFontHeight()
+ )));
+ aCharacterData.vOutlines.push_back(tools::PolyPolygon(tools::Polygon(aPolygon)));
+ }
+ }
+ else
+ {
+ const basegfx::B2DPolygon aPolygon(
+ basegfx::utils::createPolygonFromRect(
+ basegfx::B2DRange(
+ 0,
+ 0,
+ aDXArry.empty() ? 10 : aDXArry.back(),
+ aFont.GetFontHeight()
+ )));
+ aCharacterData.vOutlines.push_back(tools::PolyPolygon(tools::Polygon(aPolygon)));
+ }
+
+
+ rParagraph.vCharacters.push_back( aCharacterData );
+ }
}
// vertical alignment