summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRegényi Balázs <regenyi.balazs@nisz.hu>2020-12-08 12:10:03 +0100
committerBalazs Varga <varga.balazs3@nisz.hu>2021-01-05 12:02:39 +0100
commit09cff148ed51e5d462b9d04634e9441caadde3ef (patch)
treea8f2d792a258d1c7d0811c18cef99a8354eb29cd
parentedb2f8af6998d91939ab53f95239ffdc9f092ed3 (diff)
cleanup: add warnings for unhandled cases for the SwTextBoxHelper
Change-Id: Idc62a8872cef89c5b3b45e9027718c1e61c5a910 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108076 Tested-by: Jenkins Tested-by: Balazs Varga <varga.balazs3@nisz.hu> Reviewed-by: Balazs Varga <varga.balazs3@nisz.hu>
-rw-r--r--sw/source/core/doc/textboxhelper.cxx58
1 files changed, 57 insertions, 1 deletions
diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx
index cbf1384bd27c..a9859266e21f 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -442,7 +442,8 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, std::u16string_view rP
uno::Reference<beans::XPropertySet> xFrameParaProps(xCursor, uno::UNO_QUERY);
// And simply map the property
- switch (rValue.get<drawing::TextHorizontalAdjust>())
+ const auto eValue = rValue.get<drawing::TextHorizontalAdjust>();
+ switch (eValue)
{
case drawing::TextHorizontalAdjust::TextHorizontalAdjust_CENTER:
xFrameParaProps->setPropertyValue(
@@ -460,6 +461,9 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, std::u16string_view rP
uno::makeAny(style::ParagraphAdjust::ParagraphAdjust_RIGHT)); //1
break;
default:
+ SAL_WARN("sw.core",
+ "SwTextBoxHelper::syncProperty: unhandled TextHorizontalAdjust: "
+ << static_cast<sal_Int32>(eValue));
break;
}
return;
@@ -510,6 +514,11 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, std::u16string_view rP
case -270:
nDirection = text::WritingMode2::BT_LR;
break;
+ default:
+ SAL_WARN("sw.core", "SwTextBoxHelper::syncProperty: unhandled property value: "
+ "CustomShapeGeometry:TextPreRotateAngle: "
+ << nAngle);
+ break;
}
if (nDirection)
@@ -539,6 +548,9 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, std::u16string_view rP
else if (rValue >>= eMode2)
syncProperty(pShape, RES_FRAMEDIR, 0, uno::makeAny(eMode2));
}
+ else
+ SAL_WARN("sw.core", "SwTextBoxHelper::syncProperty: unhandled property: "
+ << static_cast<OUString>(rPropertyName));
}
void SwTextBoxHelper::getProperty(SwFrameFormat const* pShape, sal_uInt16 nWID, sal_uInt8 nMemberID,
@@ -568,6 +580,10 @@ void SwTextBoxHelper::getProperty(SwFrameFormat const* pShape, sal_uInt16 nWID,
case MID_CHAIN_NAME:
rValue <<= pFormat->GetName();
break;
+ default:
+ SAL_WARN("sw.core", "SwTextBoxHelper::getProperty: unhandled member-id: "
+ << static_cast<sal_uInt16>(nMemberID));
+ break;
}
}
@@ -604,6 +620,11 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, sal_uInt16 nWID, sal_u
aPropertyName = UNO_NAME_HORI_ORIENT_POSITION;
bAdjustX = true;
break;
+ default:
+ SAL_WARN("sw.core", "SwTextBoxHelper::syncProperty: unhandled member-id: "
+ << static_cast<sal_uInt16>(nMemberID)
+ << " (which-id: " << nWID << ")");
+ break;
}
break;
case RES_LR_SPACE:
@@ -616,6 +637,11 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, sal_uInt16 nWID, sal_u
case MID_R_MARGIN:
aPropertyName = UNO_NAME_RIGHT_MARGIN;
break;
+ default:
+ SAL_WARN("sw.core", "SwTextBoxHelper::syncProperty: unhandled member-id: "
+ << static_cast<sal_uInt16>(nMemberID)
+ << " (which-id: " << nWID << ")");
+ break;
}
break;
}
@@ -632,6 +658,11 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, sal_uInt16 nWID, sal_u
aPropertyName = UNO_NAME_VERT_ORIENT_POSITION;
bAdjustY = true;
break;
+ default:
+ SAL_WARN("sw.core", "SwTextBoxHelper::syncProperty: unhandled member-id: "
+ << static_cast<sal_uInt16>(nMemberID)
+ << " (which-id: " << nWID << ")");
+ break;
}
break;
case RES_FRM_SIZE:
@@ -688,6 +719,11 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, sal_uInt16 nWID, sal_u
return;
}
break;
+ default:
+ SAL_WARN("sw.core", "SwTextBoxHelper::syncProperty: unhandled member-id: "
+ << static_cast<sal_uInt16>(nMemberID)
+ << " (which-id: " << nWID << ")");
+ break;
}
break;
case FN_TEXT_RANGE:
@@ -712,6 +748,11 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, sal_uInt16 nWID, sal_u
case MID_CHAIN_NEXTNAME:
aPropertyName = UNO_NAME_CHAIN_NEXT_NAME;
break;
+ default:
+ SAL_WARN("sw.core", "SwTextBoxHelper::syncProperty: unhandled member-id: "
+ << static_cast<sal_uInt16>(nMemberID)
+ << " (which-id: " << nWID << ")");
+ break;
}
break;
case RES_TEXT_VERT_ADJUST:
@@ -732,6 +773,11 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, sal_uInt16 nWID, sal_u
case BOTTOM_BORDER_DISTANCE:
aPropertyName = UNO_NAME_BOTTOM_BORDER_DISTANCE;
break;
+ default:
+ SAL_WARN("sw.core", "SwTextBoxHelper::syncProperty: unhandled member-id: "
+ << static_cast<sal_uInt16>(nMemberID)
+ << " (which-id: " << nWID << ")");
+ break;
}
break;
case RES_OPAQUE:
@@ -746,8 +792,18 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, sal_uInt16 nWID, sal_u
case MID_ALLOW_OVERLAP:
aPropertyName = UNO_NAME_ALLOW_OVERLAP;
break;
+ default:
+ SAL_WARN("sw.core", "SwTextBoxHelper::syncProperty: unhandled member-id: "
+ << static_cast<sal_uInt16>(nMemberID)
+ << " (which-id: " << nWID << ")");
+ break;
}
break;
+ default:
+ SAL_WARN("sw.core", "SwTextBoxHelper::syncProperty: unhandled which-id: "
+ << nWID << " (member-id: " << static_cast<sal_uInt16>(nMemberID)
+ << ")");
+ break;
}
if (aPropertyName.isEmpty())