summaryrefslogtreecommitdiff
path: root/emfio/inc/mtftools.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'emfio/inc/mtftools.hxx')
-rw-r--r--emfio/inc/mtftools.hxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/emfio/inc/mtftools.hxx b/emfio/inc/mtftools.hxx
index 736b1da2fe74..914235288a1d 100644
--- a/emfio/inc/mtftools.hxx
+++ b/emfio/inc/mtftools.hxx
@@ -27,6 +27,7 @@
#include <vcl/lineinfo.hxx>
#include <vcl/outdevstate.hxx>
#include <vcl/FilterConfigItem.hxx>
+#include <rtl/ref.hxx>
#include "emfiodllapi.h"
@@ -259,6 +260,8 @@ namespace emfio
#define HUNDREDTH_MILLIMETERS_PER_MILLIINCH 2.54
#define MILLIINCH_PER_TWIPS 1.44
+class MetaFontAction;
+
//============================ WmfReader ==================================
namespace emfio
@@ -455,6 +458,24 @@ namespace emfio
{}
};
+ // tdf#127471 implement detection and correction of wrongly scaled
+ // fonts in own-written, old (before this fix) EMF/WMF files
+ class ScaledFontDetectCorrectHelper
+ {
+ private:
+ rtl::Reference<MetaFontAction> maCurrentMetaFontAction;
+ std::vector<double> maAlternativeFontScales;
+ std::vector<std::pair<rtl::Reference<MetaFontAction>, double>> maPositiveIdentifiedCases;
+ std::vector<std::pair<rtl::Reference<MetaFontAction>, double>> maNegativeIdentifiedCases;
+
+ public:
+ ScaledFontDetectCorrectHelper();
+ void endCurrentMetaFontAction();
+ void newCurrentMetaFontAction(rtl::Reference<MetaFontAction>& rNewMetaFontAction);
+ void evaluateAlternativeFontScale(OUString const & rText, long nImportedTextLength);
+ void applyAlternativeFontScale();
+ };
+
class EMFIO_DLLPUBLIC MtfTools
{
MtfTools(MtfTools const &) = delete;
@@ -518,6 +539,9 @@ namespace emfio
sal_uInt32 mnEndPos;
std::vector<std::unique_ptr<BSaveStruct>> maBmpSaveList;
+ // tdf#127471 always try to detect - only used with ScaledText
+ ScaledFontDetectCorrectHelper maScaledFontHelper;
+
bool mbNopMode : 1;
bool mbFillStyleSelected : 1;
bool mbClipNeedsUpdate : 1;