22 #include <string_view>
26 #include <com/sun/star/container/XEnumerationAccess.hpp>
27 #include <com/sun/star/container/XContentEnumerationAccess.hpp>
28 #include <com/sun/star/document/XActionLockable.hpp>
29 #include <com/sun/star/document/XDocumentProperties.hpp>
30 #include <com/sun/star/drawing/FillStyle.hpp>
31 #include <com/sun/star/drawing/HomogenMatrix3.hpp>
32 #include <com/sun/star/drawing/LineStyle.hpp>
33 #include <com/sun/star/drawing/XShape.hpp>
34 #include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
35 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
38 #include <com/sun/star/text/RelOrientation.hpp>
39 #include <com/sun/star/text/TextContentAnchorType.hpp>
40 #include <com/sun/star/text/VertOrientation.hpp>
41 #include <com/sun/star/text/WrapTextMode.hpp>
42 #include <com/sun/star/text/XTextContent.hpp>
43 #include <com/sun/star/text/XTextDocument.hpp>
44 #include <com/sun/star/text/XTextField.hpp>
45 #include <com/sun/star/text/XTextRange.hpp>
46 #include <com/sun/star/text/XParagraphAppend.hpp>
47 #include <com/sun/star/text/XParagraphCursor.hpp>
48 #include <com/sun/star/awt/FontWeight.hpp>
49 #include <com/sun/star/rdf/XMetadatable.hpp>
50 #include <com/sun/star/security/DocumentDigitalSignatures.hpp>
51 #include <com/sun/star/security/XCertificate.hpp>
90 #include <strings.hrc>
101 #define WATERMARK_NAME "PowerPlusWaterMarkObject"
102 #define WATERMARK_AUTO_SIZE sal_uInt32(1)
106 constexpr OUStringLiteral MetaFilename(
u"tscp/bails.rdf");
107 constexpr OUStringLiteral MetaNS(
u"urn:bails");
108 constexpr OUStringLiteral ParagraphSignatureRDFNamespace =
u"urn:bails:loext:paragraph:signature:";
109 constexpr OUStringLiteral ParagraphSignatureIdRDFName =
u"urn:bails:loext:paragraph:signature:id";
110 constexpr OUStringLiteral ParagraphSignatureDigestRDFName =
u":digest";
111 constexpr OUStringLiteral ParagraphSignatureDateRDFName =
u":date";
112 constexpr OUStringLiteral ParagraphSignatureUsageRDFName =
u":usage";
113 constexpr OUStringLiteral ParagraphSignatureLastIdRDFName =
u"urn:bails:loext:paragraph:signature:lastid";
114 constexpr OUStringLiteral ParagraphClassificationNameRDFName =
u"urn:bails:loext:paragraph:classification:name";
115 constexpr OUStringLiteral ParagraphClassificationValueRDFName =
u"urn:bails:loext:paragraph:classification:value";
116 constexpr OUStringLiteral ParagraphClassificationAbbrRDFName =
u"urn:bails:loext:paragraph:classification:abbreviation";
117 constexpr OUStringLiteral ParagraphClassificationFieldNamesRDFName =
u"urn:bails:loext:paragraph:classification:fields";
118 constexpr OUStringLiteral MetadataFieldServiceName =
u"com.sun.star.text.textfield.MetadataField";
119 constexpr OUStringLiteral DocInfoServiceName =
u"com.sun.star.text.TextField.DocInfo.Custom";
122 std::vector<OUString> lcl_getUsedPageStyles(
SwViewShell const * pShell)
124 std::vector<OUString> aReturn;
131 aReturn.push_back(
pDesc->GetName());
138 uno::Reference<text::XTextField> lcl_findField(
const uno::Reference<text::XText>& xText,
const OUString& rServiceName, std::u16string_view rFieldName)
140 uno::Reference<text::XTextField> xField;
141 uno::Reference<container::XEnumerationAccess> xParagraphEnumerationAccess(xText, uno::UNO_QUERY);
142 uno::Reference<container::XEnumeration> xParagraphs = xParagraphEnumerationAccess->createEnumeration();
143 while (xParagraphs->hasMoreElements())
145 uno::Reference<container::XEnumerationAccess> xTextPortionEnumerationAccess(xParagraphs->nextElement(), uno::UNO_QUERY);
146 uno::Reference<container::XEnumeration> xTextPortions = xTextPortionEnumerationAccess->createEnumeration();
147 while (xTextPortions->hasMoreElements())
149 uno::Reference<beans::XPropertySet> xTextPortion(xTextPortions->nextElement(), uno::UNO_QUERY);
150 OUString aTextPortionType;
155 uno::Reference<lang::XServiceInfo> xTextField;
157 if (!xTextField->supportsService(rServiceName))
161 uno::Reference<beans::XPropertySet> xPropertySet(xTextField, uno::UNO_QUERY);
163 if (aName == rFieldName)
165 xField = uno::Reference<text::XTextField>(xTextField, uno::UNO_QUERY);
175 bool lcl_hasField(
const uno::Reference<text::XText>& xText,
const OUString& rServiceName, std::u16string_view rFieldName)
177 return lcl_findField(xText, rServiceName, rFieldName).is();
181 uno::Reference<drawing::XShape> lcl_getWatermark(
const uno::Reference<text::XText>& xText,
182 const OUString& rServiceName, OUString& rShapeName,
bool& bSuccess)
185 uno::Reference<container::XEnumerationAccess> xParagraphEnumerationAccess(xText, uno::UNO_QUERY);
186 uno::Reference<container::XEnumeration> xParagraphs = xParagraphEnumerationAccess->createEnumeration();
187 while (xParagraphs->hasMoreElements())
189 uno::Reference<container::XEnumerationAccess> xTextPortionEnumerationAccess(xParagraphs->nextElement(), uno::UNO_QUERY);
190 if (!xTextPortionEnumerationAccess.is())
195 uno::Reference<container::XEnumeration> xTextPortions = xTextPortionEnumerationAccess->createEnumeration();
196 while (xTextPortions->hasMoreElements())
198 uno::Reference<beans::XPropertySet> xTextPortion(xTextPortions->nextElement(), uno::UNO_QUERY);
199 OUString aTextPortionType;
201 if (aTextPortionType !=
"Frame")
204 uno::Reference<container::XContentEnumerationAccess> xContentEnumerationAccess(xTextPortion, uno::UNO_QUERY);
205 if (!xContentEnumerationAccess.is())
208 uno::Reference<container::XEnumeration> xEnumeration = xContentEnumerationAccess->createContentEnumeration(
"com.sun.star.text.TextContent");
209 if (!xEnumeration->hasMoreElements())
212 uno::Reference<lang::XServiceInfo> xWatermark(xEnumeration->nextElement(), uno::UNO_QUERY);
213 if (!xWatermark->supportsService(rServiceName))
216 uno::Reference<container::XNamed> xNamed(xWatermark, uno::UNO_QUERY);
221 rShapeName = xNamed->getName();
223 uno::Reference<drawing::XShape> xShape(xWatermark, uno::UNO_QUERY);
228 return uno::Reference<drawing::XShape>();
233 OString lcl_getParagraphBodyText(
const uno::Reference<text::XTextContent>& xText)
235 OUStringBuffer strBuf;
236 uno::Reference<container::XEnumerationAccess> xTextPortionEnumerationAccess(xText, uno::UNO_QUERY);
237 if (!xTextPortionEnumerationAccess.is())
240 uno::Reference<container::XEnumeration> xTextPortions = xTextPortionEnumerationAccess->createEnumeration();
241 while (xTextPortions->hasMoreElements())
243 uno::Any elem = xTextPortions->nextElement();
246 OUString aTextPortionType;
247 uno::Reference<beans::XPropertySet> xPropertySet(elem, uno::UNO_QUERY);
249 if (aTextPortionType ==
"Text")
251 uno::Reference<text::XTextRange> xTextRange(elem, uno::UNO_QUERY);
253 strBuf.append(xTextRange->getString());
262 return strBuf.makeStringAndClear().trim().toUtf8();
265 template <
typename T>
266 std::map<OUString, OUString> lcl_getRDFStatements(
const uno::Reference<frame::XModel>&
xModel,
271 const css::uno::Reference<css::rdf::XResource> xSubject(xRef, uno::UNO_QUERY);
274 catch (const ::css::uno::Exception&)
278 return std::map<OUString, OUString>();
282 std::pair<OUString, OUString> lcl_getFieldRDFByPrefix(
const uno::Reference<frame::XModel>& xModel,
283 const uno::Reference<css::text::XTextField>& xField,
286 for (
const auto& pair : lcl_getRDFStatements(xModel, xField))
288 if (pair.first.startsWith(sPrefix))
292 return std::make_pair(OUString(), OUString());
296 template <
typename T>
297 std::pair<OUString, OUString> lcl_getRDF(
const uno::Reference<frame::XModel>& xModel,
299 const OUString& sRDFName)
301 const std::map<OUString, OUString> aStatements = lcl_getRDFStatements(xModel, xRef);
302 const auto it = aStatements.find(sRDFName);
303 return (it != aStatements.end()) ? std::make_pair(it->first, it->second) : std::make_pair(OUString(), OUString());
308 bool lcl_IsParagraphSignatureField(
const uno::Reference<frame::XModel>& xModel,
309 const uno::Reference<css::text::XTextField>& xField)
311 return (lcl_getRDF(xModel, xField, ParagraphSignatureIdRDFName).
first == ParagraphSignatureIdRDFName);
314 uno::Reference<text::XTextField> lcl_findFieldByRDF(
const uno::Reference<frame::XModel>& xModel,
315 const uno::Reference<text::XTextContent>& xParagraph,
316 const OUString& sRDFName,
317 std::u16string_view sRDFValue)
319 uno::Reference<container::XEnumerationAccess> xTextPortionEnumerationAccess(xParagraph, uno::UNO_QUERY);
320 if (!xTextPortionEnumerationAccess.is())
321 return uno::Reference<text::XTextField>();
323 uno::Reference<container::XEnumeration> xTextPortions = xTextPortionEnumerationAccess->createEnumeration();
324 if (!xTextPortions.is())
325 return uno::Reference<text::XTextField>();
327 while (xTextPortions->hasMoreElements())
329 uno::Reference<beans::XPropertySet> xTextPortion(xTextPortions->nextElement(), uno::UNO_QUERY);
330 OUString aTextPortionType;
335 uno::Reference<lang::XServiceInfo> xTextField;
337 if (!xTextField->supportsService(MetadataFieldServiceName))
340 uno::Reference<text::XTextField> xField(xTextField, uno::UNO_QUERY);
341 const std::pair<OUString, OUString> pair = lcl_getRDF(xModel, xField, sRDFName);
342 if (pair.first == sRDFName && (sRDFValue.empty() || sRDFValue == pair.second))
346 return uno::Reference<text::XTextField>();
349 struct SignatureDescr
351 OUString msSignature;
355 bool isValid()
const {
return !msSignature.isEmpty(); }
358 SignatureDescr lcl_getSignatureDescr(
const uno::Reference<frame::XModel>& xModel,
359 const uno::Reference<css::text::XTextContent>& xParagraph,
360 std::u16string_view sFieldId)
362 SignatureDescr aDescr;
364 const OUString
prefix = ParagraphSignatureRDFNamespace + sFieldId;
365 const std::map<OUString, OUString> aStatements = lcl_getRDFStatements(xModel, xParagraph);
367 const auto itSig = aStatements.find(prefix + ParagraphSignatureDigestRDFName);
368 aDescr.msSignature = (itSig != aStatements.end() ? itSig->second : OUString());
370 const auto itDate = aStatements.find(prefix + ParagraphSignatureDateRDFName);
371 aDescr.msDate = (itDate != aStatements.end() ? itDate->second : OUString());
373 const auto itUsage = aStatements.find(prefix + ParagraphSignatureUsageRDFName);
374 aDescr.msUsage = (itUsage != aStatements.end() ? itUsage->second : OUString());
379 SignatureDescr lcl_getSignatureDescr(
const uno::Reference<frame::XModel>& xModel,
380 const uno::Reference<css::text::XTextContent>& xParagraph,
381 const uno::Reference<css::text::XTextField>& xField)
383 const OUString sFieldId = lcl_getRDF(xModel, xField, ParagraphSignatureIdRDFName).second;
384 if (!sFieldId.isEmpty())
385 return lcl_getSignatureDescr(xModel, xParagraph, sFieldId);
387 return SignatureDescr();
391 std::pair<bool, OUString> lcl_MakeParagraphSignatureFieldText(
const SignatureDescr& aDescr,
392 const OString& utf8Text)
394 OUString msg =
SwResId(STR_INVALID_SIGNATURE);
397 if (aDescr.isValid())
399 const char*
pData = utf8Text.getStr();
400 const std::vector<unsigned char>
data(pData, pData + utf8Text.getLength());
402 OString encSignature;
403 if (aDescr.msSignature.convertToString(&encSignature, RTL_TEXTENCODING_UTF8, 0))
409 && aInfo.
nStatus == xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED;
414 msg += (!aDescr.msUsage.isEmpty() ? (
" (" + aDescr.msUsage +
"): ") : OUString(
": "));
419 return std::make_pair(valid, msg);
423 std::pair<bool, OUString>
424 lcl_MakeParagraphSignatureFieldText(
const uno::Reference<frame::XModel>& xModel,
425 const uno::Reference<css::text::XTextContent>& xParagraph,
426 const uno::Reference<css::text::XTextField>& xField,
427 const OString& utf8Text)
429 const SignatureDescr aDescr = lcl_getSignatureDescr(xModel, xParagraph, xField);
430 return lcl_MakeParagraphSignatureFieldText(aDescr, utf8Text);
434 OUString lcl_getNextSignatureId(
const uno::Reference<frame::XModel>& xModel,
435 const uno::Reference<text::XTextContent>& xParagraph)
437 const OUString sFieldId = lcl_getRDF(xModel, xParagraph, ParagraphSignatureLastIdRDFName).second;
438 return OUString::number(!sFieldId.isEmpty() ? sFieldId.toInt32() + 1 : 1);
442 uno::Reference<text::XTextField> lcl_InsertParagraphSignature(
const uno::Reference<frame::XModel>& xModel,
443 const uno::Reference<text::XTextContent>& xParagraph,
444 const OUString& signature,
445 const OUString& usage)
447 uno::Reference<lang::XMultiServiceFactory> xMultiServiceFactory(xModel, uno::UNO_QUERY);
448 auto xField = uno::Reference<text::XTextField>(xMultiServiceFactory->createInstance(MetadataFieldServiceName), uno::UNO_QUERY);
451 xField->attach(xParagraph->getAnchor()->getEnd());
453 const OUString
sId = lcl_getNextSignatureId(xModel, xParagraph);
455 const css::uno::Reference<css::rdf::XResource> xSubject(xField, uno::UNO_QUERY);
461 OUStringBuffer rBuffer;
462 rBuffer.append(static_cast<sal_Int32>(aDateTime.
GetYear()));
466 rBuffer.append(static_cast<sal_Int32>(aDateTime.
GetMonth()));
468 if (aDateTime.
GetDay() < 10)
470 rBuffer.append(static_cast<sal_Int32>(aDateTime.
GetDay()));
473 const css::uno::Reference<css::rdf::XResource> xParaSubject(xParagraph, uno::UNO_QUERY);
474 const OUString
prefix = ParagraphSignatureRDFNamespace + sId;
476 SwRDFHelper::addStatement(xModel, MetaNS, MetaFilename, xParaSubject, prefix + ParagraphSignatureDigestRDFName, signature);
478 SwRDFHelper::addStatement(xModel, MetaNS, MetaFilename, xParaSubject, prefix + ParagraphSignatureDateRDFName, rBuffer.makeStringAndClear());
484 bool lcl_DoUpdateParagraphSignatureField(
SwDoc& rDoc,
485 const uno::Reference<css::text::XTextField>& xField,
486 const OUString& sDisplayText)
497 uno::Reference<css::text::XTextRange> xText(xField, uno::UNO_QUERY);
498 const OUString curText = xText->getString();
499 if (curText != sDisplayText)
501 xText->setString(sDisplayText);
505 catch (
const uno::Exception&)
515 bool lcl_UpdateParagraphSignatureField(
SwDoc& rDoc,
516 const uno::Reference<frame::XModel>& xModel,
517 const uno::Reference<css::text::XTextContent>& xParagraph,
518 const uno::Reference<css::text::XTextField>& xField,
519 const OString& utf8Text)
521 const OUString sDisplayText
522 = lcl_MakeParagraphSignatureFieldText(xModel, xParagraph, xField, utf8Text).second;
523 return lcl_DoUpdateParagraphSignatureField(rDoc, xField, sDisplayText);
526 void lcl_RemoveParagraphMetadataField(
const uno::Reference<css::text::XTextField>& xField)
528 uno::Reference<css::text::XTextRange> xParagraph(xField->getAnchor());
529 xParagraph->getText()->removeTextContent(xField);
534 bool lcl_IsParagraphClassificationField(
const uno::Reference<frame::XModel>& xModel,
535 const uno::Reference<css::text::XTextField>& xField,
536 std::u16string_view sKey)
538 const std::pair<OUString, OUString> rdfPair = lcl_getRDF(xModel, xField, ParagraphClassificationNameRDFName);
539 return rdfPair.first == ParagraphClassificationNameRDFName && (sKey.empty() || rdfPair.second == sKey);
542 uno::Reference<text::XTextField> lcl_FindParagraphClassificationField(
const uno::Reference<frame::XModel>& xModel,
543 const uno::Reference<text::XTextContent>& xParagraph,
544 std::u16string_view sKey =
u"")
546 uno::Reference<text::XTextField> xTextField;
548 uno::Reference<container::XEnumerationAccess> xTextPortionEnumerationAccess(xParagraph, uno::UNO_QUERY);
549 if (!xTextPortionEnumerationAccess.is())
553 uno::Reference<container::XEnumeration> xTextPortions = xTextPortionEnumerationAccess->createEnumeration();
554 while (xTextPortions->hasMoreElements())
556 uno::Reference<beans::XPropertySet> xTextPortion(xTextPortions->nextElement(), uno::UNO_QUERY);
557 OUString aTextPortionType;
562 uno::Reference<lang::XServiceInfo> xServiceInfo;
564 if (!xServiceInfo->supportsService(MetadataFieldServiceName))
567 uno::Reference<text::XTextField> xField(xServiceInfo, uno::UNO_QUERY);
568 if (lcl_IsParagraphClassificationField(xModel, xField, sKey))
579 uno::Reference<text::XTextField> lcl_InsertParagraphClassification(
const uno::Reference<frame::XModel>& xModel,
580 const uno::Reference<text::XTextContent>& xParent)
582 uno::Reference<lang::XMultiServiceFactory> xMultiServiceFactory(xModel, uno::UNO_QUERY);
583 auto xField = uno::Reference<text::XTextField>(xMultiServiceFactory->createInstance(MetadataFieldServiceName), uno::UNO_QUERY);
586 xField->attach(xParent->getAnchor()->getStart());
591 bool lcl_UpdateParagraphClassificationField(
SwDoc* pDoc,
592 const uno::Reference<frame::XModel>& xModel,
593 const uno::Reference<css::text::XTextContent>& xTextNode,
594 const OUString& sKey,
595 const OUString& sValue,
596 const OUString& sDisplayText)
605 uno::Reference<text::XTextField> xField = lcl_InsertParagraphClassification(xModel, xTextNode);
607 css::uno::Reference<css::rdf::XResource> xFieldSubject(xField, uno::UNO_QUERY);
612 css::uno::Reference<css::rdf::XResource> xNodeSubject(xTextNode, uno::UNO_QUERY);
615 return lcl_DoUpdateParagraphSignatureField(*pDoc, xField, sDisplayText);
618 void lcl_ValidateParagraphSignatures(
SwDoc& rDoc,
const uno::Reference<text::XTextContent>& xParagraph,
const bool updateDontRemove)
624 uno::Reference<frame::XModel> xModel = pDocShell->
GetBaseModel();
629 const std::pair<OUString, OUString> pair = lcl_getRDF(xModel, xParagraph, ParagraphSignatureLastIdRDFName);
630 if (pair.second.isEmpty())
633 catch (const ::css::uno::Exception&)
638 uno::Reference<container::XEnumerationAccess> xTextPortionEnumerationAccess(xParagraph, uno::UNO_QUERY);
639 if (!xTextPortionEnumerationAccess.is())
642 uno::Reference<container::XEnumeration> xTextPortions = xTextPortionEnumerationAccess->createEnumeration();
643 if (!xTextPortions.is())
647 const OString utf8Text = lcl_getParagraphBodyText(xParagraph);
648 if (utf8Text.isEmpty())
651 while (xTextPortions->hasMoreElements())
653 uno::Reference<beans::XPropertySet> xTextPortion(xTextPortions->nextElement(), uno::UNO_QUERY);
654 OUString aTextPortionType;
659 uno::Reference<lang::XServiceInfo> xTextField;
661 if (!xTextField->supportsService(MetadataFieldServiceName))
664 uno::Reference<text::XTextField> xField(xTextField, uno::UNO_QUERY);
665 if (!lcl_IsParagraphSignatureField(xModel, xField))
670 if (updateDontRemove)
672 lcl_UpdateParagraphSignatureField(rDoc, xModel, xParagraph, xField, utf8Text);
674 else if (!lcl_MakeParagraphSignatureFieldText(xModel, xParagraph, xField, utf8Text).
first)
678 std::make_unique<SwUndoParagraphSigning>(rDoc, xField, xParagraph,
false));
679 lcl_RemoveParagraphMetadataField(xField);
703 uno::Reference<text::XText>
const & rxText, uno::Reference<text::XParagraphCursor>
const & rxParagraphCursor,
704 OUString
const & rsKey)
706 uno::Reference<beans::XPropertySet> xField(rxMultiServiceFactory->createInstance(DocInfoServiceName), uno::UNO_QUERY);
707 xField->setPropertyValue(
UNO_NAME_NAME, uno::makeAny(rsKey));
708 uno::Reference<text::XTextContent> xTextContent(xField, uno::UNO_QUERY);
710 rxText->insertTextContent(rxParagraphCursor, xTextContent,
false);
715 uno::Reference<container::XEnumerationAccess> xParagraphEnumerationAccess(rxText, uno::UNO_QUERY);
716 uno::Reference<container::XEnumeration> xParagraphs = xParagraphEnumerationAccess->createEnumeration();
717 while (xParagraphs->hasMoreElements())
719 uno::Reference<container::XEnumerationAccess> xTextPortionEnumerationAccess(xParagraphs->nextElement(), uno::UNO_QUERY);
720 uno::Reference<container::XEnumeration> xTextPortions = xTextPortionEnumerationAccess->createEnumeration();
721 while (xTextPortions->hasMoreElements())
723 uno::Reference<beans::XPropertySet> xTextPortion(xTextPortions->nextElement(), uno::UNO_QUERY);
724 OUString aTextPortionType;
729 uno::Reference<lang::XServiceInfo> xTextField;
731 if (!xTextField->supportsService(DocInfoServiceName))
735 uno::Reference<beans::XPropertySet> xPropertySet(xTextField, uno::UNO_QUERY);
737 if (aName.startsWith(rPolicy))
739 uno::Reference<text::XTextField> xField(xTextField, uno::UNO_QUERY);
740 rxText->removeTextContent(xField);
748 uno::Reference<container::XEnumerationAccess> xParagraphEnumAccess(xText, uno::UNO_QUERY);
749 uno::Reference<container::XEnumeration> xParagraphEnum = xParagraphEnumAccess->createEnumeration();
750 sal_Int32 nResult = 0;
751 while (xParagraphEnum->hasMoreElements())
753 xParagraphEnum->nextElement();
759 static void equaliseNumberOfParagraph(std::vector<svx::ClassificationResult>
const & rResults, uno::Reference<text::XText>
const & xText)
761 sal_Int32 nNumberOfParagraphs = 0;
765 nNumberOfParagraphs++;
770 uno::Reference<text::XParagraphAppend> xParagraphAppend(xText, uno::UNO_QUERY);
771 xParagraphAppend->finishParagraph(uno::Sequence<beans::PropertyValue>());
782 uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(xModel, uno::UNO_QUERY);
783 uno::Reference<container::XNameAccess> xStyleFamilies = xStyleFamiliesSupplier->getStyleFamilies();
784 uno::Reference<container::XNameAccess> xStyleFamily(xStyleFamilies->getByName(
"PageStyles"), uno::UNO_QUERY);
786 uno::Reference<lang::XMultiServiceFactory> xMultiServiceFactory(xModel, uno::UNO_QUERY);
791 const std::vector<OUString> aUsedPageStyles = lcl_getUsedPageStyles(
this);
792 for (
const OUString& rPageStyleName : aUsedPageStyles)
794 uno::Reference<beans::XPropertySet> xPageStyle(xStyleFamily->getByName(rPageStyleName), uno::UNO_QUERY);
797 bool bHeaderIsOn =
false;
799 uno::Reference<text::XText> xHeaderText;
802 if (xHeaderText.is())
806 bool bFooterIsOn =
false;
808 uno::Reference<text::XText> xFooterText;
811 if (xFooterText.is())
816 uno::Reference<beans::XPropertyContainer> xPropertyContainer = xDocumentProperties->getUserDefinedProperties();
838 for (
const OUString& rPageStyleName : aUsedPageStyles)
840 uno::Reference<beans::XPropertySet> xPageStyle(xStyleFamily->getByName(rPageStyleName), uno::UNO_QUERY);
843 bool bHeaderIsOn =
false;
847 uno::Reference<text::XText> xHeaderText;
852 bool bFooterIsOn =
false;
856 uno::Reference<text::XText> xFooterText;
865 uno::Reference<text::XParagraphCursor> xHeaderParagraphCursor(xHeaderText->createTextCursor(), uno::UNO_QUERY);
866 uno::Reference<text::XParagraphCursor> xFooterParagraphCursor(xFooterText->createTextCursor(), uno::UNO_QUERY);
868 sal_Int32 nParagraph = -1;
872 switch(rResult.meType)
916 xHeaderParagraphCursor->gotoNextParagraph(
false);
917 xFooterParagraphCursor->gotoNextParagraph(
false);
920 xHeaderParagraphCursor->gotoStartOfParagraph(
false);
921 xFooterParagraphCursor->gotoStartOfParagraph(
false);
923 uno::Reference<beans::XPropertySet> xHeaderPropertySet(xHeaderParagraphCursor, uno::UNO_QUERY_THROW);
924 uno::Reference<beans::XPropertySet> xFooterPropertySet(xFooterParagraphCursor, uno::UNO_QUERY_THROW);
925 if (rResult.msName ==
"BOLD")
927 xHeaderPropertySet->setPropertyValue(
"CharWeight", uno::makeAny(awt::FontWeight::BOLD));
928 xFooterPropertySet->setPropertyValue(
"CharWeight", uno::makeAny(awt::FontWeight::BOLD));
932 xHeaderPropertySet->setPropertyValue(
"CharWeight", uno::makeAny(awt::FontWeight::NORMAL));
933 xFooterPropertySet->setPropertyValue(
"CharWeight", uno::makeAny(awt::FontWeight::NORMAL));
947 std::vector<svx::ClassificationResult> aResult;
953 const OUString sBlank;
956 uno::Reference<beans::XPropertyContainer> xPropertyContainer = xDocumentProperties->getUserDefinedProperties();
960 uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(xModel, uno::UNO_QUERY);
961 uno::Reference<container::XNameAccess> xStyleFamilies = xStyleFamiliesSupplier->getStyleFamilies();
962 uno::Reference<container::XNameAccess> xStyleFamily(xStyleFamilies->getByName(
"PageStyles"), uno::UNO_QUERY);
964 std::vector<OUString> aPageStyles = lcl_getUsedPageStyles(
this);
965 OUString aPageStyleString = aPageStyles.back();
966 uno::Reference<beans::XPropertySet> xPageStyle(xStyleFamily->getByName(aPageStyleString), uno::UNO_QUERY);
968 bool bHeaderIsOn =
false;
973 if (!aValue.isEmpty())
974 aResult.push_back({ svx::ClassificationType::CATEGORY, aValue, sBlank, sBlank });
979 uno::Reference<text::XText> xHeaderText;
982 uno::Reference<container::XEnumerationAccess> xParagraphEnumerationAccess(xHeaderText, uno::UNO_QUERY);
983 uno::Reference<container::XEnumeration> xParagraphs = xParagraphEnumerationAccess->createEnumeration();
986 bool bFoundClassificationCategory =
false;
988 while (xParagraphs->hasMoreElements())
990 uno::Reference<container::XEnumerationAccess> xTextPortionEnumerationAccess(xParagraphs->nextElement(), uno::UNO_QUERY);
991 if (!xTextPortionEnumerationAccess.is())
993 uno::Reference<container::XEnumeration> xTextPortions = xTextPortionEnumerationAccess->createEnumeration();
996 uno::Reference<beans::XPropertySet> xParagraphPropertySet(xTextPortionEnumerationAccess, uno::UNO_QUERY_THROW);
997 uno::Any aAny = xParagraphPropertySet->getPropertyValue(
"CharWeight");
999 OUString sWeight = (aAny.get<
float>() >= awt::FontWeight::BOLD) ? OUString(
"BOLD") : OUString(
"NORMAL");
1004 while (xTextPortions->hasMoreElements())
1006 uno::Reference<beans::XPropertySet> xTextPortion(xTextPortions->nextElement(), uno::UNO_QUERY);
1007 OUString aTextPortionType;
1012 uno::Reference<lang::XServiceInfo> xTextField;
1014 if (!xTextField->supportsService(DocInfoServiceName))
1018 uno::Reference<beans::XPropertySet> xPropertySet(xTextField, uno::UNO_QUERY);
1024 if (!aValue.isEmpty())
1025 aResult.push_back({ svx::ClassificationType::TEXT, aValue, sBlank, sBlank });
1030 if (!aValue.isEmpty())
1031 aResult.push_back({ svx::ClassificationType::CATEGORY, aValue, sBlank, sBlank });
1032 bFoundClassificationCategory =
true;
1037 if (!aValue.isEmpty())
1038 aResult.push_back({ svx::ClassificationType::CATEGORY, sBlank, sBlank, aValue });
1039 bFoundClassificationCategory =
true;
1044 if (!aValue.isEmpty())
1045 aResult.push_back({ svx::ClassificationType::MARKING, aValue, sBlank, sBlank });
1050 if (!aValue.isEmpty())
1051 aResult.push_back({ svx::ClassificationType::INTELLECTUAL_PROPERTY_PART, aValue, sBlank, sBlank });
1056 if (!bFoundClassificationCategory)
1059 if (!aValue.isEmpty())
1060 aResult.push_back({ svx::ClassificationType::CATEGORY, aValue, sBlank, sBlank });
1074 const bool bHadWatermark = !
aHelper.GetDocumentWatermark().isEmpty();
1077 aHelper.SetBACName(rName, eType);
1080 uno::Reference<beans::XPropertyContainer> xPropertyContainer = pDocShell->
getDocProperties()->getUserDefinedProperties();
1084 bool bHeaderIsNeeded =
aHelper.HasDocumentHeader();
1085 bool bFooterIsNeeded =
aHelper.HasDocumentFooter();
1086 OUString aWatermark =
aHelper.GetDocumentWatermark();
1087 bool bWatermarkIsNeeded = !aWatermark.isEmpty();
1089 if (!bHeaderIsNeeded && !bFooterIsNeeded && !bWatermarkIsNeeded && !bHadWatermark)
1093 uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(xModel, uno::UNO_QUERY);
1094 uno::Reference<container::XNameAccess> xStyleFamilies = xStyleFamiliesSupplier->getStyleFamilies();
1095 uno::Reference<container::XNameAccess> xStyleFamily(xStyleFamilies->getByName(
"PageStyles"), uno::UNO_QUERY);
1096 const uno::Sequence<OUString> aStyles = xStyleFamily->getElementNames();
1098 for (
const OUString& rPageStyleName : aStyles)
1100 uno::Reference<beans::XPropertySet> xPageStyle(xStyleFamily->getByName(rPageStyleName), uno::UNO_QUERY);
1101 uno::Reference<lang::XMultiServiceFactory> xMultiServiceFactory(xModel, uno::UNO_QUERY);
1103 if (bHeaderIsNeeded || bWatermarkIsNeeded || bHadWatermark)
1106 bool bHeaderIsOn =
false;
1112 uno::Reference<text::XText> xHeaderText;
1115 if (bHeaderIsNeeded)
1120 uno::Reference<beans::XPropertySet> xField(xMultiServiceFactory->createInstance(DocInfoServiceName), uno::UNO_QUERY);
1122 uno::Reference<text::XTextContent> xTextContent(xField, uno::UNO_QUERY);
1123 xHeaderText->insertTextContent(xHeaderText->getEnd(), xTextContent,
false);
1128 aWatermarkItem.
SetText(aWatermark);
1132 if (bFooterIsNeeded)
1135 bool bFooterIsOn =
false;
1141 uno::Reference<text::XText> xFooterText;
1144 if (!lcl_hasField(xFooterText, DocInfoServiceName, sFooter))
1147 uno::Reference<beans::XPropertySet> xField(xMultiServiceFactory->createInstance(DocInfoServiceName), uno::UNO_QUERY);
1148 xField->setPropertyValue(
UNO_NAME_NAME, uno::makeAny(sFooter));
1149 uno::Reference<text::XTextContent> xTextContent(xField, uno::UNO_QUERY);
1150 xFooterText->insertTextContent(xFooterText->getEnd(), xTextContent,
false);
1159 const uno::Reference<frame::XModel>& xModel,
1160 const uno::Reference<text::XTextContent>& xParent,
1161 const css::uno::Reference<css::rdf::XResource>& xNodeSubject,
1162 std::vector<svx::ClassificationResult> aResults)
1164 if (!xNodeSubject.is())
1170 uno::Reference<text::XTextField> xTextField = lcl_FindParagraphClassificationField(xModel, xParent);
1171 if (!xTextField.is())
1173 lcl_RemoveParagraphMetadataField(xTextField);
1176 if (aResults.empty())
1181 std::reverse(aResults.begin(), aResults.end());
1183 aResults.erase(std::remove_if(aResults.begin(),
1195 const bool isLast =
nIndex == 0;
1196 const bool isFirst = (
nIndex == aResults.size() - 1);
1198 OUString sValue = rResult.
msName;
1240 sDisplayText +=
")";
1241 lcl_UpdateParagraphClassificationField(pDoc, xModel, xParent, sKey, sValue, sDisplayText);
1242 aFieldNames.emplace_back(sKey);
1246 std::reverse(aFieldNames.begin(), aFieldNames.end());
1247 OUStringBuffer sFieldNames;
1249 for (
const OUString& rFieldName : aFieldNames)
1252 sFieldNames.append(
"/");
1253 sFieldNames.append(rFieldName);
1257 const OUString sOldFieldNames = lcl_getRDF(xModel, xNodeSubject, ParagraphClassificationFieldNamesRDFName).second;
1259 SwRDFHelper::addStatement(xModel, MetaNS, MetaFilename, xNodeSubject, ParagraphClassificationFieldNamesRDFName, sFieldNames.makeStringAndClear());
1269 if (pNode ==
nullptr)
1285 std::vector<svx::ClassificationResult> aResult;
1287 uno::Reference<container::XEnumerationAccess> xTextPortionEnumerationAccess(xParagraph, uno::UNO_QUERY);
1288 if (!xTextPortionEnumerationAccess.is())
1291 uno::Reference<container::XEnumeration> xTextPortions = xTextPortionEnumerationAccess->createEnumeration();
1295 while (xTextPortions->hasMoreElements())
1297 uno::Reference<beans::XPropertySet> xTextPortion(xTextPortions->nextElement(), uno::UNO_QUERY);
1298 OUString aTextPortionType;
1303 uno::Reference<lang::XServiceInfo> xField;
1305 if (!xField->supportsService(MetadataFieldServiceName))
1308 uno::Reference<text::XTextField> xTextField(xField, uno::UNO_QUERY);
1310 const std::pair<OUString, OUString> rdfNamePair = lcl_getFieldRDFByPrefix(xModel, xTextField, sPolicy);
1312 uno::Reference<text::XTextRange> xTextRange(xField, uno::UNO_QUERY);
1313 const OUString
aName = rdfNamePair.first;
1314 const OUString aValue = rdfNamePair.second;
1315 static const OUStringLiteral sBlank(
u"");
1343 std::vector<svx::ClassificationResult> aResult;
1350 if (pNode ==
nullptr)
1366 aTransformation.
set(0, 0, rMatrix.Line1.Column1);
1367 aTransformation.
set(0, 1, rMatrix.Line1.Column2);
1368 aTransformation.
set(0, 2, rMatrix.Line1.Column3);
1369 aTransformation.
set(1, 0, rMatrix.Line2.Column1);
1370 aTransformation.
set(1, 1, rMatrix.Line2.Column2);
1371 aTransformation.
set(1, 2, rMatrix.Line2.Column3);
1372 aTransformation.
set(2, 0, rMatrix.Line3.Column1);
1373 aTransformation.
set(2, 1, rMatrix.Line3.Column2);
1374 aTransformation.
set(2, 2, rMatrix.Line3.Column3);
1376 aTransformation.
decompose(aScale, aTranslate, fRotate, fShear);
1378 return nDeg < 0 ? round(nDeg) * -1 : round(360.0 - nDeg);
1388 uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(xModel, uno::UNO_QUERY);
1389 uno::Reference<container::XNameAccess> xStyleFamilies = xStyleFamiliesSupplier->getStyleFamilies();
1390 uno::Reference<container::XNameAccess> xStyleFamily(xStyleFamilies->getByName(
"PageStyles"), uno::UNO_QUERY);
1391 std::vector<OUString> aUsedPageStyles = lcl_getUsedPageStyles(
this);
1392 for (
const OUString& rPageStyleName : aUsedPageStyles)
1394 uno::Reference<beans::XPropertySet> xPageStyle(xStyleFamily->getByName(rPageStyleName), uno::UNO_QUERY);
1396 bool bHeaderIsOn =
false;
1401 uno::Reference<text::XText> xHeaderText;
1404 OUString sWatermark =
"";
1405 bool bSuccess =
false;
1406 uno::Reference<drawing::XShape> xWatermark = lcl_getWatermark(xHeaderText,
"com.sun.star.drawing.CustomShape", sWatermark, bSuccess);
1408 if (xWatermark.is())
1411 uno::Reference<text::XTextRange> xTextRange(xWatermark, uno::UNO_QUERY);
1412 uno::Reference<beans::XPropertySet> xPropertySet(xWatermark, uno::UNO_QUERY);
1414 sal_Int16 nTransparency;
1416 drawing::HomogenMatrix3 aMatrix;
1418 aItem.
SetText(xTextRange->getString());
1424 if (xPropertySet->getPropertyValue(
"Transformation") >>= aMatrix)
1436 const uno::Reference<frame::XModel>& xModel,
1437 const uno::Reference<beans::XPropertySet>& xPageStyle,
1438 const uno::Reference<text::XText>& xHeaderText)
1440 if (!xHeaderText.is())
1443 uno::Reference<lang::XMultiServiceFactory> xMultiServiceFactory(xModel, uno::UNO_QUERY);
1444 OUString aShapeServiceName =
"com.sun.star.drawing.CustomShape";
1446 bool bSuccess =
false;
1447 uno::Reference<drawing::XShape> xWatermark = lcl_getWatermark(xHeaderText, aShapeServiceName, sWatermark, bSuccess);
1449 bool bDeleteWatermark = rWatermark.
GetText().isEmpty();
1450 if (xWatermark.is())
1452 drawing::HomogenMatrix3 aMatrix;
1453 Color nColor = 0xc0c0c0;
1454 sal_Int16 nTransparency = 50;
1455 sal_Int16 nAngle = 45;
1456 OUString aFont =
"";
1458 uno::Reference<beans::XPropertySet> xPropertySet(xWatermark, uno::UNO_QUERY);
1462 xPropertySet->getPropertyValue(
"Transformation") >>= aMatrix;
1466 uno::Reference<text::XTextRange> xTextRange(xWatermark, uno::UNO_QUERY);
1467 if (xTextRange->getString() != rWatermark.
GetText()
1468 || aFont != rWatermark.
GetFont()
1472 || bDeleteWatermark)
1475 uno::Reference<lang::XComponent> xComponent(xWatermark, uno::UNO_QUERY);
1476 xComponent->dispose();
1481 if (!bSuccess || xWatermark.is() || bDeleteWatermark)
1484 const OUString& sFont = rWatermark.
GetFont();
1485 sal_Int16 nAngle = rWatermark.
GetAngle();
1496 pDevice->SetFont(aFont);
1498 auto nTextWidth = pDevice->GetTextWidth(rWatermark.
GetText());
1501 fRatio = pDevice->GetTextHeight();
1502 fRatio /= nTextWidth;
1506 sal_Int32 nWidth = 0;
1509 if (aSize.Width < aSize.Height)
1516 nWidth = aSize.Width - nLeftMargin - nRightMargin;
1525 nWidth = aSize.Height - nTopMargin - nBottomMargin;
1527 sal_Int32 nHeight = fRatio * nWidth;
1530 uno::Reference<drawing::XShape> xShape(xMultiServiceFactory->createInstance(aShapeServiceName), uno::UNO_QUERY);
1532 uno::Reference<container::XNamed> xNamed(xShape, uno::UNO_QUERY);
1533 xNamed->setName(sWatermark);
1537 aTransformation.
scale(nWidth, nHeight);
1539 drawing::HomogenMatrix3 aMatrix;
1540 aMatrix.Line1.Column1 = aTransformation.
get(0, 0);
1541 aMatrix.Line1.Column2 = aTransformation.
get(0, 1);
1542 aMatrix.Line1.Column3 = aTransformation.
get(0, 2);
1543 aMatrix.Line2.Column1 = aTransformation.
get(1, 0);
1544 aMatrix.Line2.Column2 = aTransformation.
get(1, 1);
1545 aMatrix.Line2.Column3 = aTransformation.
get(1, 2);
1546 aMatrix.Line3.Column1 = aTransformation.
get(2, 0);
1547 aMatrix.Line3.Column2 = aTransformation.
get(2, 1);
1548 aMatrix.Line3.Column3 = aTransformation.
get(2, 2);
1549 uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
1550 xPropertySet->setPropertyValue(
UNO_NAME_ANCHOR_TYPE, uno::makeAny(text::TextContentAnchorType_AT_CHARACTER));
1551 uno::Reference<text::XTextContent> xTextContent(xShape, uno::UNO_QUERY);
1552 xHeaderText->insertTextContent(xHeaderText->getEnd(), xTextContent,
false);
1555 uno::Reference<document::XActionLockable> xLockable(xShape, uno::UNO_QUERY);
1556 xLockable->addActionLock();
1557 xPropertySet->setPropertyValue(
UNO_NAME_FILLCOLOR, uno::makeAny(static_cast<sal_Int32>(nColor)));
1558 xPropertySet->setPropertyValue(
UNO_NAME_FILLSTYLE, uno::makeAny(drawing::FillStyle_SOLID));
1560 xPropertySet->setPropertyValue(
UNO_NAME_LINESTYLE, uno::makeAny(drawing::LineStyle_NONE));
1566 xPropertySet->setPropertyValue(
UNO_NAME_TEXT_WRAP, uno::makeAny(text::WrapTextMode_THROUGH));
1571 xPropertySet->setPropertyValue(
"Transformation", uno::makeAny(aMatrix));
1573 uno::Reference<text::XTextRange> xTextRange(xShape, uno::UNO_QUERY);
1574 xTextRange->setString(rWatermark.
GetText());
1576 uno::Reference<drawing::XEnhancedCustomShapeDefaulter> xDefaulter(xShape, uno::UNO_QUERY);
1577 xDefaulter->createCustomShapeDefaults(
"fontwork-plain-text");
1579 auto aGeomPropSeq = xPropertySet->getPropertyValue(
"CustomShapeGeometry").get< uno::Sequence<beans::PropertyValue> >();
1580 auto aGeomPropVec = comphelper::sequenceToContainer< std::vector<beans::PropertyValue> >(aGeomPropSeq);
1583 {
"TextPath", uno::makeAny(
true)},
1585 auto it = std::find_if(aGeomPropVec.begin(), aGeomPropVec.end(), [](
const beans::PropertyValue&
rValue)
1587 return rValue.Name ==
"TextPath";
1589 if (it == aGeomPropVec.end())
1592 it->Value <<= aPropertyValues;
1597 xPropertySet->getPropertyValue(
"Transformation") >>= aMatrix;
1598 xPropertySet->setPropertyValue(
"Transformation", uno::makeAny(aMatrix));
1600 xPropertySet->setPropertyValue(
UNO_NAME_HORI_ORIENT, uno::makeAny(text::HoriOrientation::CENTER));
1601 xPropertySet->setPropertyValue(
UNO_NAME_VERT_ORIENT, uno::makeAny(text::VertOrientation::CENTER));
1603 xLockable->removeActionLock();
1611 const bool bNoWatermark = rWatermark.
GetText().isEmpty();
1614 uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(xModel, uno::UNO_QUERY);
1615 uno::Reference<container::XNameAccess> xStyleFamilies = xStyleFamiliesSupplier->getStyleFamilies();
1616 uno::Reference<container::XNameAccess> xStyleFamily(xStyleFamilies->getByName(
"PageStyles"), uno::UNO_QUERY);
1617 const uno::Sequence<OUString> aStyles = xStyleFamily->getElementNames();
1619 for (
const OUString& rPageStyleName : aStyles)
1621 uno::Reference<beans::XPropertySet> xPageStyle(xStyleFamily->getByName(rPageStyleName), uno::UNO_QUERY);
1624 bool bHeaderIsOn =
false;
1635 bool bDynamicHeight =
true;
1636 sal_Int32 nOldValue;
1642 uno::Reference<text::XText> xHeaderText;
1643 uno::Reference<text::XText> xHeaderTextFirst;
1644 uno::Reference<text::XText> xHeaderTextLeft;
1645 uno::Reference<text::XText> xHeaderTextRight;
1668 const uno::Reference<text::XTextField>& xField,
1669 const uno::Reference<text::XTextContent>& xParent,
1679 const std::map<OUString, OUString> aStatements = lcl_getRDFStatements(xModel,
m_xField);
1680 const auto it = aStatements.find(ParagraphSignatureIdRDFName);
1681 if (it != aStatements.end())
1684 const auto it2 = aStatements.find(ParagraphSignatureUsageRDFName);
1685 if (it2 != aStatements.end())
1688 uno::Reference<css::text::XTextRange> xText(
m_xField, uno::UNO_QUERY);
1746 lcl_RemoveParagraphMetadataField(
m_xField);
1768 const OString utf8Text = lcl_getParagraphBodyText(xParagraph);
1769 if (utf8Text.isEmpty())
1773 uno::Reference<security::XDocumentDigitalSignatures> xSigner(
1775 security::DocumentDigitalSignatures::createDefault(
1778 uno::Sequence<css::beans::PropertyValue>
aProperties;
1779 uno::Reference<security::XCertificate> xCertificate = xSigner->chooseCertificateWithProps(aProperties);
1780 if (!xCertificate.is())
1785 signing.
AddDataRange(utf8Text.getStr(), utf8Text.getLength());
1786 OStringBuffer sigBuf;
1787 if (!signing.
Sign(sigBuf))
1790 const OUString signature = OStringToOUString(sigBuf.makeStringAndClear(), RTL_TEXTENCODING_UTF8, 0);
1792 std::vector<css::beans::PropertyValue> vec = comphelper::sequenceToContainer<std::vector<css::beans::PropertyValue>>(aProperties);
1793 auto it = std::find_if(vec.begin(), vec.end(), [](
const beans::PropertyValue&
rValue)
1795 return rValue.Name ==
"Usage";
1799 if (it != vec.end())
1800 it->Value >>= aUsage;
1813 uno::Reference<css::text::XTextField> xField = lcl_InsertParagraphSignature(xModel, xParagraph, signature, aUsage);
1815 lcl_UpdateParagraphSignatureField(*
GetDoc(), xModel, xParagraph, xField, utf8Text);
1818 std::make_unique<SwUndoParagraphSigning>(rDoc, xField, xParagraph,
true));
1839 lcl_ValidateParagraphSignatures(*
GetDoc(), xParentText, updateDontRemove);
1867 const uno::Reference<text::XTextDocument> xDoc(xModel, uno::UNO_QUERY);
1868 uno::Reference<text::XText> xParent = xDoc->getText();
1869 uno::Reference<container::XEnumerationAccess> xParagraphEnumerationAccess(xParent, uno::UNO_QUERY);
1870 if (!xParagraphEnumerationAccess.is())
1872 uno::Reference<container::XEnumeration> xParagraphs = xParagraphEnumerationAccess->createEnumeration();
1873 if (!xParagraphs.is())
1875 while (xParagraphs->hasMoreElements())
1877 uno::Reference<text::XTextContent> xParagraph(xParagraphs->nextElement(), uno::UNO_QUERY);
1878 lcl_ValidateParagraphSignatures(*
GetDoc(), xParagraph, updateDontRemove);
1884 uno::Reference<text::XTextField> xTextField;
1885 if (pNode !=
nullptr && pDocSh !=
nullptr)
1889 if (pTextMeta !=
nullptr)
1894 const css::uno::Reference<css::rdf::XResource> xSubject = pMeta->MakeUnoObject();
1896 const std::map<OUString, OUString> aStatements = lcl_getRDFStatements(xModel, xSubject);
1897 if (aStatements.find(ParagraphSignatureIdRDFName) != aStatements.end() ||
1898 aStatements.find(ParagraphClassificationNameRDFName) != aStatements.end())
1900 xTextField = uno::Reference<text::XTextField>(xSubject, uno::UNO_QUERY);
1922 const uno::Reference<text::XTextDocument> xDoc(xModel, uno::UNO_QUERY);
1923 uno::Reference<text::XText> xParent = xDoc->getText();
1924 uno::Reference<container::XEnumerationAccess> xParagraphEnumerationAccess(xParent, uno::UNO_QUERY);
1925 if (!xParagraphEnumerationAccess.is())
1927 uno::Reference<container::XEnumeration> xParagraphs = xParagraphEnumerationAccess->createEnumeration();
1928 if (!xParagraphs.is())
1931 static constexpr OUStringLiteral sBlank(
u"");
1935 while (xParagraphs->hasMoreElements())
1937 uno::Reference<text::XTextContent> xParagraph(xParagraphs->nextElement(), uno::UNO_QUERY);
1941 const css::uno::Reference<css::rdf::XResource> xSubject(xParagraph, uno::UNO_QUERY);
1944 const auto it = aStatements.find(ParagraphClassificationFieldNamesRDFName);
1945 const OUString sFieldNames = (it != aStatements.end() ? it->second : sBlank);
1946 std::vector<svx::ClassificationResult> aResults;
1947 if (!sFieldNames.isEmpty())
1949 assert(it != aStatements.end() &&
"can only be non-empty if it was valid");
1954 const OUString sCurFieldName = sFieldNames.getToken(0,
'/', nIndex);
1955 if (sCurFieldName.isEmpty())
1958 const auto it2 = aStatements.find(sCurFieldName);
1959 bool bStatementFound = it2 != aStatements.end();
1960 const OUString
sName = bStatementFound ? it->first : sBlank;
1961 const OUString sValue = bStatementFound ? it->second : sBlank;
1969 const auto it3 = aStatements.find(ParagraphClassificationAbbrRDFName);
1970 const OUString sAbbreviatedName = (it3 != aStatements.end() && !it3->second.isEmpty() ? it3->second : sValue);
1975 const auto it3 = aStatements.find(ParagraphClassificationAbbrRDFName);
1976 const OUString sAbbreviatedName = (it3 != aStatements.end() && !it3->second.isEmpty() ? it3->second : sValue);
1988 while (nIndex >= 0);
1995 std::map<OUString, SignatureDescr> aSignatures;
1996 for (
const auto& pair : lcl_getRDFStatements(xModel, xParagraph))
1998 const OUString&
sName = pair.first;
1999 if (sName.startsWith(ParagraphSignatureRDFNamespace))
2001 const OUString
sSuffix = sName.copy(ParagraphSignatureRDFNamespace.getLength());
2002 const sal_Int32
index = sSuffix.indexOf(
":");
2005 const OUString
id = sSuffix.copy(0, index);
2006 const OUString
type = sSuffix.copy(index);
2007 const OUString& sValue = pair.second;
2008 if (type == ParagraphSignatureDateRDFName)
2009 aSignatures[id].msDate = sValue;
2010 else if (type == ParagraphSignatureUsageRDFName)
2011 aSignatures[id].msUsage = sValue;
2012 else if (type == ParagraphSignatureDigestRDFName)
2013 aSignatures[id].msSignature = sValue;
2018 for (
const auto& pair : aSignatures)
2020 uno::Reference<text::XTextField> xField = lcl_findFieldByRDF(xModel, xParagraph, ParagraphSignatureIdRDFName, pair.first);
2023 uno::Reference<lang::XMultiServiceFactory> xMultiServiceFactory(xModel, uno::UNO_QUERY);
2024 xField = uno::Reference<text::XTextField>(xMultiServiceFactory->createInstance(MetadataFieldServiceName), uno::UNO_QUERY);
2027 xField->attach(xParagraph->getAnchor()->getEnd());
2029 const css::uno::Reference<css::rdf::XResource> xFieldSubject(xField, uno::UNO_QUERY);
2032 const OString utf8Text = lcl_getParagraphBodyText(xParagraph);
2033 lcl_UpdateParagraphSignatureField(*
GetDoc(), xModel, xParagraph, xField, utf8Text);
2037 lcl_ValidateParagraphSignatures(*
GetDoc(), xParagraph,
true);
2039 catch (
const std::exception&)
2076 lcl_RemoveParagraphMetadataField(xField);
2085 const uno::Reference<frame::XModel>& xModel,
const uno::Reference<text::XTextContent>& xParagraph)
2087 uno::Reference<text::XTextField> xTextField;
2089 if (xTextField.is())
2091 const std::pair<OUString, OUString> rdfValuePair = lcl_getRDF(xModel, xTextField, ParagraphClassificationValueRDFName);
2095 xTextField = lcl_FindParagraphClassificationField(xModel, xParagraph, rKeyCreator.
makeCategoryNameKey());
2096 if (xTextField.is())
2098 return lcl_getRDF(xModel, xTextField, ParagraphClassificationNameRDFName).second;
2106 OUString sHighestClass;
2109 if (pNode ==
nullptr)
2110 return sHighestClass;
2114 return sHighestClass;
2120 const uno::Reference< text::XTextDocument > xDoc(xModel, uno::UNO_QUERY);
2121 uno::Reference<text::XText> xParent = xDoc->getText();
2123 uno::Reference<container::XEnumerationAccess> xParagraphEnumerationAccess(xParent, uno::UNO_QUERY);
2124 uno::Reference<container::XEnumeration> xParagraphs = xParagraphEnumerationAccess->createEnumeration();
2125 while (xParagraphs->hasMoreElements())
2127 uno::Reference<text::XTextContent> xParagraph(xParagraphs->nextElement(), uno::UNO_QUERY);
2129 sHighestClass =
aHelper.GetHigherClass(sHighestClass, sCurrentClass);
2132 return sHighestClass;
2145 uno::Reference<document::XDocumentProperties> xDocumentProperties = pDocShell->
getDocProperties();
2146 uno::Reference<beans::XPropertyContainer> xPropertyContainer = xDocumentProperties->getUserDefinedProperties();
2155 if (!aClassificationCategory.isEmpty())
2157 sHighestClass = aHelper.
GetHigherClass(sHighestClass, aClassificationCategory);
2160 if (aClassificationCategory != sHighestClass)
2163 VclMessageType::Question, VclButtonsType::Ok,
2164 SwResId(STR_CLASSIFICATION_LEVEL_CHANGED)));
2180 aHelper.
SetBACName(sHighestClass, eHighestClassType);
2191 const bool bResetListAttrs)
2206 if (!aName.isEmpty())
2233 SwPaM aPaM(*rPaM.Start(), *rPaM.End());
2237 aPaM.End()->nContent = pEndTextNode->GetText().getLength();
2253 if ( pParent ==
nullptr )
2256 if ( pColl ==
nullptr )
2258 OSL_FAIL(
"MakeTextFormatColl failed" );
2287 static_cast<const SwNumRuleItem*>(pItem)->
GetValue()))
2297 static_cast<const SwNumRuleItem*>(pItem)->
GetValue()))
tools::Long const nBottomMargin
OUString makeNumberedMarkingKey()
SwTextFormatColl * MakeTextFormatColl(const OUString &rFormatName, SwTextFormatColl *pDerivedFrom, bool bBroadcast=false)
Create the FormatCollections.
void SetText(const OUString &aText)
OUString makeNumberedIntellectualPropertyPartKey()
Base class of the Writer layout elements.
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
void SetFontSize(const Size &)
OUString msAbbreviatedName
static const OUString & policyTypeToString(SfxClassificationPolicyType eType)
Represents the style of a paragraph.
void insertCreationOrigin(uno::Reference< beans::XPropertyContainer > const &rxPropertyContainer, sfx::ClassificationKeyCreator const &rKeyCreator, sfx::ClassificationCreationOrigin eOrigin)
Marks a position in the document model.
#define UNO_NAME_TEXT_MINFRAMEHEIGHT
SwPageDesc * FindPageDesc()
void set(sal_uInt16 nRow, sal_uInt16 nColumn, double fValue)
static const OUString & PROP_DOCFOOTER()
SwPaM * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
std::vector< svx::ClassificationResult > CollectParagraphClassification()
SfxWatermarkItem GetWatermark() const
constexpr TypedWhichId< SwFormatMeta > RES_TXTATR_METAFIELD(49)
#define UNO_NAME_CHAR_FONT_NAME
SwDocShell * GetDocShell()
std::unique_ptr< ContentProperties > pData
css::uno::Reference< css::text::XTextField > m_xField
#define UNO_NAME_TEXT_FIELD
sal_uInt16 GetTextFormatCollCount() const
tools::Long const nLeftMargin
OUStringBuffer & remove(OUStringBuffer &rIn, sal_Unicode c)
static css::uno::Reference< css::text::XTextContent > CreateXParagraph(SwDoc &rDoc, SwTextNode *pTextNode, css::uno::Reference< css::text::XText > const &xParentText=nullptr, const sal_Int32 nSelStart=-1, const sal_Int32 nSelEnd=-1)
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
#define UNO_NAME_FILLSTYLE
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
static const OUString & PROP_PREFIX_INTELLECTUALPROPERTY()
void ValidateCurrentParagraphSignatures(bool updateDontRemove)
Validate the current paragraph signatures, if any, at the cursor start.
sal_Int16 GetTransparency() const
std::vector< unsigned char > DecodeHexString(const OString &rHex)
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(94)
void RestoreMetadataFieldsAndValidateParagraphSignatures()
Restore the metadata fields, if missing, from the RDF metadata and validate the signatures and update...
#define UNO_NAME_BOTTOM_MARGIN
static uno::Reference< text::XTextField > lcl_GetParagraphMetadataFieldAtIndex(const SwDocShell *pDocSh, SwTextNode const *pNode, const sal_uLong index)
static SfxObjectShell * Current()
#define UNO_NAME_VERT_ORIENT
IDocumentUndoRedo & GetIDocumentUndoRedo()
bool SetParagraphSignatureValidation(const bool bEnable)
Enable/Disable paragraph signature validation and return the previous value.
void SignParagraph()
Sign the paragraph at the cursor.
SwTextAttr * GetTextAttrAt(sal_Int32 const nIndex, sal_uInt16 const nWhich, enum GetTextAttrMode const eMode=DEFAULT) const
get the innermost text attribute covering position nIndex.
static OUString lcl_GetParagraphClassification(SfxClassificationHelper &rHelper, sfx::ClassificationKeyCreator const &rKeyCreator, const uno::Reference< frame::XModel > &xModel, const uno::Reference< text::XTextContent > &xParagraph)
The root element of a Writer document layout.
constexpr double rad2deg(double v)
#define UNO_NAME_TEXT_WRAP
css::uno::Reference< css::document::XDocumentProperties > getDocProperties() const
static bool IsShowChanges(const RedlineFlags eM)
#define UNO_NAME_TEXT_AUTOGROWWIDTH
double get(sal_uInt16 nRow, sal_uInt16 nColumn) const
bool isCategoryIdentifierKey(OUString const &aKey) const
bool RemoveParagraphMetadataFieldAtCursor()
Removes the paragraph metadata field at the current cursor, if any.
SwContentNode * GetContentNode(bool bPoint=true) const
#define UNO_NAME_FILLCOLOR
css::uno::Any const & rValue
#define CH_TXTATR_BREAKWORD
void SetWatermark(const SfxWatermarkItem &rText)
SwTextFormatColl & GetTextFormatColl(sal_uInt16 nTextFormatColl) const
void FillByEx(SwCharFormat *)
PropertiesInfo aProperties
static std::map< OUString, OUString > getStatements(const css::uno::Reference< css::frame::XModel > &xModel, const css::uno::Sequence< css::uno::Reference< css::rdf::XURI >> &rGraphNames, const css::uno::Reference< css::rdf::XResource > &xSubject)
Gets all (XResource, key, value) statements in RDF graphs given the graph-names.
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
static sal_Int16 lcl_GetAngle(const drawing::HomogenMatrix3 &rMatrix)
bool SetTextFormatColl(const SwPaM &rRg, SwTextFormatColl *pFormat, const bool bReset=true, const bool bResetListAttrs=false, SwRootFrame const *pLayout=nullptr)
Add 4th optional parameter .
sal_uInt16 GetMonth() const
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
static OUString lcl_GetHighestClassificationParagraphClass(SwPaM *pCursor)
const SwTextFormatColl * GetDfltTextFormatColl() const
#define CH_TXT_ATR_INPUTFIELDSTART
void removeAllProperties(uno::Reference< beans::XPropertyContainer > const &rxPropertyContainer)
void ApplyAdvancedClassification(std::vector< svx::ClassificationResult > const &rResult)
sfx::ClassificationCreationOrigin getCreationOriginProperty(uno::Reference< beans::XPropertyContainer > const &rxPropertyContainer, sfx::ClassificationKeyCreator const &rKeyCreator)
virtual void DoUndo(bool const bDoUndo)=0
Enable/Disable Undo.
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
void SetTransparency(const sal_Int16 nTransparency)
#define UNO_NAME_VERT_ORIENT_RELATION
css::uno::Reference< css::text::XTextContent > m_xParent
OUString getProperty(uno::Reference< beans::XPropertyContainer > const &rxPropertyContainer, OUString const &rName)
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
virtual bool DoesUndo() const =0
Is Undo enabled?
css::uno::Reference< css::frame::XModel > GetBaseModel() const
ClassificationType meType
static DateTime CreateFromUnixTime(const double fSecondsSinceEpoch)
#define UNO_NAME_TOP_MARGIN
static sal_Int32 getNumberOfParagraphs(uno::Reference< text::XText > const &xText)
sal_Int16 GetYear() const
static void removeAllClassificationFields(std::u16string_view rPolicy, uno::Reference< text::XText > const &rxText)
#define UNO_NAME_HORI_ORIENT
#define UNO_NAME_HEADER_TEXT_LEFT
#define WATERMARK_AUTO_SIZE
PaM is Point and Mark: a selection of the document model.
const SwAttrSet * GetpSwAttrSet() const
virtual SwRedlineTable::size_type GetRedlinePos(const SwNode &rNode, RedlineType nType) const =0
SwNumRule * FindNumRulePtr(const OUString &rName) const
#define DBG_UNHANDLED_EXCEPTION(...)
virtual void AppendUndo(std::unique_ptr< SwUndo > pUndo)=0
Add new Undo action.
void ValidateParagraphSignatures(SwTextNode *pNode, bool updateDontRemove)
Validate the paragraph signatures, if any, of the current text node.
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
void SetTextFormatColl(SwTextFormatColl *, const bool bResetListAttrs=false)
Add 2nd optional parameter - see also
OUString const & GetText() const
bool IsParagraphSignatureValidationEnabled() const
Returns true iff paragraph signature validation is enabled.
#define UNO_NAME_HEADER_IS_DYNAMIC_HEIGHT
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
void SetFamilyName(const OUString &rFamilyName)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SwPosition * GetPoint() const
SfxClassificationPolicyType
#define UNO_NAME_FILL_TRANSPARENCE
OUString makeCategoryIdentifierKey() const
virtual void RepeatImpl(::sw::RepeatContext &) override
bool decompose(B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
void rotate(double fRadiant)
SwEditShell const * GetEditShell() const
void SetColor(Color nColor)
static std::vector< svx::ClassificationResult > lcl_CollectParagraphClassification(const uno::Reference< frame::XModel > &xModel, const uno::Reference< text::XTextContent > &xParagraph)
void insertFullTextualRepresentationAsDocumentProperty(uno::Reference< beans::XPropertyContainer > const &rxPropertyContainer, sfx::ClassificationKeyCreator const &rKeyCreator, std::vector< svx::ClassificationResult > const &rResults)
#define UNO_NAME_HEADER_HEIGHT
OUString GetDocumentWatermark()
static SfxClassificationPolicyType stringToPolicyType(const OUString &rType)
static const OUString & PROP_DOCHEADER()
void ApplyParagraphClassification(std::vector< svx::ClassificationResult > aResult)
Apply the classification to the paragraph at cursor.
#define UNO_NAME_FOOTER_IS_ON
void AddRule(SwUndoArg eWhat, const OUString &rWith)
void scale(double fX, double fY)
bool isMarkingKey(OUString const &aKey) const
sal_uInt16 GetDay() const
void ConvertToLocalTime()
constexpr double deg2rad(double v)
static SfxClassificationPolicyType getPolicyType()
T static_txtattr_cast(S *s)
ring_container GetRingContainer()
OUString SwResId(const char *pId)
PropertyValueVector_t aPropertyValues
static void insertFieldToDocument(uno::Reference< lang::XMultiServiceFactory > const &rxMultiServiceFactory, uno::Reference< text::XText > const &rxText, uno::Reference< text::XParagraphCursor > const &rxParagraphCursor, OUString const &rsKey)
void SetClassification(const OUString &rName, SfxClassificationPolicyType eType)
A page of the document layout.
bool isMarkingTextKey(OUString const &aKey) const
#define UNO_NAME_HEADER_TEXT_RIGHT
const SwPosition * Start() const
void RstTextAttrs(const SwPaM &rRg, bool bInclRefToxMark=false, bool bExactRange=false, SwRootFrame const *pLayout=nullptr)
#define UNO_NAME_RIGHT_MARGIN
#define UNO_NAME_LINESTYLE
exports com.sun.star.chart2. data
SwTextNode * GetParaPropsNode(SwRootFrame const &rLayout, SwNodeIndex const &rNode)
#define UNO_NAME_TEXT_PORTION_TYPE
bool isIntellectualPropertyPartKey(OUString const &aKey) const
bool isCategoryNameKey(OUString const &aKey) const
OUString const & GetFont() const
SwTextNode is a paragraph in the document model.
#define CH_TXT_ATR_INPUTFIELDEND
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
tools::Long const nTopMargin
OUString GetBACNameForIdentifier(std::u16string_view sIdentifier)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
#define UNO_NAME_LEFT_MARGIN
const SwTextFormatColls * GetTextFormatColls() const
#define UNO_NAME_ANCHOR_TYPE
const SwViewOption * GetViewOptions() const
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
static void removeStatement(const css::uno::Reference< css::frame::XModel > &xModel, const OUString &rType, const css::uno::Reference< css::rdf::XResource > &xSubject, const OUString &rKey, const OUString &rValue)
Remove an (XResource, key, value) statement in the graph of type rType, if it exists.
virtual void SetRedlineFlags(RedlineFlags eMode)=0
Set a new redline mode.
OUString makeNumberedTextKey()
OUString GetHigherClass(const OUString &first, const OUString &second)
sal_Int32 GetIndex() const
void SetBACName(const OUString &rName, SfxClassificationPolicyType eType)
static void FillProgName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
void ValidateAllParagraphSignatures(bool updateDontRemove)
Validate all paragraph signatures.
#define UNO_NAME_HORI_ORIENT_RELATION
#define UNO_NAME_TEXT_AUTOGROWHEIGHT
Reference< XComponentContext > getProcessComponentContext()
void SetFont(const OUString &aFont)
virtual void UndoImpl(::sw::UndoRedoContext &) override
static void addStatement(const css::uno::Reference< css::frame::XModel > &xModel, const OUString &rType, const OUString &rPath, const css::uno::Reference< css::rdf::XResource > &xSubject, const OUString &rKey, const OUString &rValue)
Add an (XResource, key, value) statement in the graph of type rType – or if it does not exist...
#define UNO_NAME_HEADER_IS_ON
tools::Long const nRightMargin
bool Sign(OStringBuffer &rCMSHexBuffer)
#define UNO_NAME_FOOTER_TEXT
OUString makeCategoryNameKey() const
static void lcl_placeWatermarkInHeader(const SfxWatermarkItem &rWatermark, const uno::Reference< frame::XModel > &xModel, const uno::Reference< beans::XPropertySet > &xPageStyle, const uno::Reference< text::XText > &xHeaderText)
SwTableNode * FindTableNode()
Search table node, in which it is.
#define UNO_NAME_HEADER_TEXT
SwUndoParagraphSigning(SwDoc &rDoc, const css::uno::Reference< css::text::XTextField > &xField, const css::uno::Reference< css::text::XTextContent > &xParent, const bool bRemove)
void ChgFormat(SwFormat &rFormat, const SfxItemSet &rSet)
static void equaliseNumberOfParagraph(std::vector< svx::ClassificationResult > const &rResults, uno::Reference< text::XText > const &xText)
const SfxPoolItem & GetAttr() const
#define UNO_NAME_CHAR_HEIGHT
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
bool IsCursorInParagraphMetadataField() const
Returns true iff the cursor is within a paragraph metadata field.
SwTextFormatColl & GetDfltTextFormatColl() const
Reference< XModel > xModel
static void lcl_ApplyParagraphClassification(SwDoc *pDoc, const uno::Reference< frame::XModel > &xModel, const uno::Reference< text::XTextContent > &xParent, const css::uno::Reference< css::rdf::XResource > &xNodeSubject, std::vector< svx::ClassificationResult > aResults)
bool addOrInsertDocumentProperty(uno::Reference< beans::XPropertyContainer > const &rxPropertyContainer, OUString const &rsKey, OUString const &rsValue)
std::vector< svx::ClassificationResult > CollectAdvancedClassification()
static css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > getGraphNames(const css::uno::Reference< css::rdf::XDocumentMetadataAccess > &xDocumentMetadataAccess, const css::uno::Reference< css::rdf::XURI > &xType)
Gets all graph-names in RDF of a given type.
const char *const aFieldNames[]
SwTextFormatColl * MakeTextFormatColl(const OUString &rFormatCollName, SwTextFormatColl *pDerivedFrom=nullptr)
virtual const SwRedlineTable & GetRedlineTable() const =0
void AddDataRange(const void *pData, sal_Int32 size)
void SetAngle(const sal_Int16 nAngle)
constexpr OUStringLiteral first
void StartAllAction()
For all views of this document.
SwRootFrame * GetLayout() const
void ClassifyDocPerHighestParagraphClass()
Ensure that the classification of the doc is never lower than the paragraph with the highest classifi...
virtual void RedoImpl(::sw::UndoRedoContext &) override
static bool Verify(const std::vector< unsigned char > &aData, const bool bNonDetached, const std::vector< unsigned char > &aSignature, SignatureInformation &rInformation)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
sal_Int16 GetAngle() const
#define UNO_NAME_TEXT_MINFRAMEWIDTH
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
static bool hasMetadataGraph(const css::uno::Reference< css::frame::XModel > &xModel, const OUString &rType)
Check if a graph of type rType exists.
#define UNO_NAME_HEADER_TEXT_FIRST