summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xfa/fxfa/cxfa_fffield.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/xfa/fxfa/cxfa_fffield.cpp b/xfa/fxfa/cxfa_fffield.cpp
index 7fba69973c..ff28e574e8 100644
--- a/xfa/fxfa/cxfa_fffield.cpp
+++ b/xfa/fxfa/cxfa_fffield.cpp
@@ -6,6 +6,8 @@
#include "xfa/fxfa/cxfa_fffield.h"
+#include <algorithm>
+
#include "xfa/fwl/cfwl_edit.h"
#include "xfa/fwl/cfwl_eventmouse.h"
#include "xfa/fwl/cfwl_messagekey.h"
@@ -195,6 +197,12 @@ void CXFA_FFField::CapPlacement() {
m_rtCaption.Reset();
} else {
fCapReserve = caption->GetReserve();
+ if (iCapPlacement == XFA_AttributeEnum::Top ||
+ iCapPlacement == XFA_AttributeEnum::Bottom) {
+ fCapReserve = std::min(fCapReserve, rtWidget.height);
+ } else {
+ fCapReserve = std::min(fCapReserve, rtWidget.width);
+ }
CXFA_ContentLayoutItem* pItem = this;
if (!pItem->GetPrev() && !pItem->GetNext()) {
m_rtCaption = rtWidget;