summaryrefslogtreecommitdiff
path: root/xfa/fxgraphics
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxgraphics')
-rw-r--r--xfa/fxgraphics/cfx_graphics.cpp27
-rw-r--r--xfa/fxgraphics/cfx_graphics.h8
2 files changed, 17 insertions, 18 deletions
diff --git a/xfa/fxgraphics/cfx_graphics.cpp b/xfa/fxgraphics/cfx_graphics.cpp
index b6574e800e..bc8b18ba36 100644
--- a/xfa/fxgraphics/cfx_graphics.cpp
+++ b/xfa/fxgraphics/cfx_graphics.cpp
@@ -954,20 +954,19 @@ FWL_Error CFX_Graphics::ShowText(const CFX_PointF& point,
return FWL_Error::PropertyInvalid;
}
-FWL_Error CFX_Graphics::CalcTextRect(CFX_RectF& rect,
- const CFX_WideString& text,
- FX_BOOL isMultiline,
- CFX_Matrix* matrix) {
- if (m_type == FX_CONTEXT_Device && m_renderDevice) {
- int32_t length = text.GetLength();
- uint32_t* charCodes = FX_Alloc(uint32_t, length);
- FXTEXT_CHARPOS* charPos = FX_Alloc(FXTEXT_CHARPOS, length);
- CalcTextInfo(text, charCodes, charPos, rect);
- FX_Free(charPos);
- FX_Free(charCodes);
- return FWL_Error::Succeeded;
- }
- return FWL_Error::PropertyInvalid;
+void CFX_Graphics::CalcTextRect(CFX_RectF& rect,
+ const CFX_WideString& text,
+ FX_BOOL isMultiline,
+ CFX_Matrix* matrix) {
+ if (m_type != FX_CONTEXT_Device || !m_renderDevice)
+ return;
+
+ int32_t length = text.GetLength();
+ uint32_t* charCodes = FX_Alloc(uint32_t, length);
+ FXTEXT_CHARPOS* charPos = FX_Alloc(FXTEXT_CHARPOS, length);
+ CalcTextInfo(text, charCodes, charPos, rect);
+ FX_Free(charPos);
+ FX_Free(charCodes);
}
FWL_Error CFX_Graphics::Transfer(CFX_Graphics* graphics,
diff --git a/xfa/fxgraphics/cfx_graphics.h b/xfa/fxgraphics/cfx_graphics.h
index 66e4da333d..e79219d877 100644
--- a/xfa/fxgraphics/cfx_graphics.h
+++ b/xfa/fxgraphics/cfx_graphics.h
@@ -165,10 +165,10 @@ class CFX_Graphics {
FWL_Error ShowText(const CFX_PointF& point,
const CFX_WideString& text,
CFX_Matrix* matrix = nullptr);
- FWL_Error CalcTextRect(CFX_RectF& rect,
- const CFX_WideString& text,
- FX_BOOL isMultiline = FALSE,
- CFX_Matrix* matrix = nullptr);
+ void CalcTextRect(CFX_RectF& rect,
+ const CFX_WideString& text,
+ FX_BOOL isMultiline = FALSE,
+ CFX_Matrix* matrix = nullptr);
FWL_Error Transfer(CFX_Graphics* graphics, const CFX_Matrix* matrix);
FWL_Error Transfer(CFX_Graphics* graphics,
FX_FLOAT srcLeft,