Bugzilla – Attachment 142963 Details for
Bug 107690
FILEOPEN DOCX: Mark as Final property not read
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
0001-tdf-107690-Initial-support-of-Mark-as-Final-property.patch (text/plain), 2.84 KB, created by
László Németh
on 2018-06-20 14:57:19 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
László Németh
Created:
2018-06-20 14:57:19 UTC
Size:
2.84 KB
patch
obsolete
>From 078cb36ccfdc448259113fa961ac83ed1e17ceb4 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?= <nemeth@numbertext.org> >Date: Wed, 20 Jun 2018 16:28:13 +0200 >Subject: [PATCH] tdf#107690 Initial support of Mark as Final property of MSO > >Don't save modified documents with property _MarkAsFinal=True >silently to avoid to get unintended warning messages in MSO. > >Show read-only info bar for documents with custom document >property _MarkAsFinal=True, similar to MSO. > >This improves interoperability a lot, because this is a >basic document protection of MSO, recommended on its UI. > >Change-Id: Ie279c0670090d075103384cfa44ff1c2a2898216 >--- > sfx2/source/doc/objstor.cxx | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > >diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx >index 9bc418f..fd71e18 100644 >--- a/sfx2/source/doc/objstor.cxx >+++ b/sfx2/source/doc/objstor.cxx >@@ -828,6 +828,35 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed ) > xDocProps->setSubject(aValue); > } > } >+ >+ // tdf#107690 LibreOffice could save silently documents with the >+ // user-defined property _MarkAsFinal=true, resulting an interoperability >+ // problem: unintented read-only warning info bar in MSO. To avoid that >+ // and showing the warning of the original document also in LO, when >+ // _MarkAsFinal=true is defined, we call SetReadOnlyUI(), showing also an >+ // infobar for removing easily this read-only protection (this is the use >+ // case of the heavily used MSO custom property "_MarkAsFinal"), and >+ // change _MarkAsFinal to false immediately. >+ // >+ // TODO: Implement MarkAsFinal LO setting or use LoadReadonly for it >+ // (but that doesn't show infobar in LibreOffice 6.1, only Edit->Edit mode >+ // is available to remove the read-only protection), and move this fix >+ // in a better place. >+ uno::Reference<beans::XPropertyContainer> xPropertyContainer = xDocProps->getUserDefinedProperties(); >+ if (xPropertyContainer.is()) >+ { >+ uno::Reference<beans::XPropertySet> xPropertySet(xPropertyContainer, uno::UNO_QUERY); >+ if (xPropertySet.is()) >+ { >+ aAny = xPropertySet->getPropertyValue("_MarkAsFinal"); >+ if (aAny.has<bool>() && aAny.get<bool>()) >+ { >+ SetReadOnlyUI(); >+ xPropertySet->setPropertyValue("_MarkAsFinal", Any( false )); >+ } >+ } >+ >+ } > } > } > catch( Exception& ) >-- >2.7.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 107690
:
133141
|
133142
|
133143
| 142963