diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2024-07-04 12:38:42 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2024-07-05 09:29:28 +0200 |
commit | 48e76366ea5932a75792ba5d5e6a474e8003733f (patch) | |
tree | 2ffbebbbe3f4ffd159816ad5225a9d6b21027677 /svx | |
parent | 269654fe179384f994bf0fe47e2af8c731cac377 (diff) |
annot: don't show the annot. object if LOK and not PDF document
In online the client side comments/annotations are used, so to
keep this behavior for presentations we only enable the core side
rendering of annotations when the document is a PDF. No change in
the desktop applitation.
Change-Id: I50ffd1b6d81d2fcf6ef9f821e783ae228e39e4e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169969
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/annotation/AnnotationObject.cxx | 22 | ||||
-rw-r--r-- | svx/source/svdraw/svdmodel.cxx | 1 |
2 files changed, 15 insertions, 8 deletions
diff --git a/svx/source/annotation/AnnotationObject.cxx b/svx/source/annotation/AnnotationObject.cxx index c87943067ae0..d69f9be6e9fa 100644 --- a/svx/source/annotation/AnnotationObject.cxx +++ b/svx/source/annotation/AnnotationObject.cxx @@ -11,15 +11,13 @@ #include <rtl/ustring.hxx> #include <rtl/ustrbuf.hxx> +#include <comphelper/lok.hxx> + #include <sal/log.hxx> #include <svx/svdmodel.hxx> - #include <svx/annotation/AnnotationObject.hxx> #include <svx/annotation/ObjectAnnotationData.hxx> #include <sdr/properties/rectangleproperties.hxx> -#include <vcl/settings.hxx> -#include <vcl/svapp.hxx> - #include <svx/xfillit0.hxx> #include <svx/xflclit.hxx> #include <svx/xlineit0.hxx> @@ -29,6 +27,9 @@ #include <svx/sdooitm.hxx> #include <svx/sdtagitm.hxx> #include <svx/sdasitm.hxx> + +#include <vcl/settings.hxx> +#include <vcl/svapp.hxx> #include <editeng/fhgtitem.hxx> #include <editeng/colritem.hxx> #include <o3tl/unit_conversion.hxx> @@ -92,15 +93,13 @@ Color getColorLight(sal_uInt16 aAuthorIndex) AnnotationObject::AnnotationObject(SdrModel& rSdrModel) : SdrRectObj(rSdrModel) { - setAsAnnotationObject(true); - mbTextFrame = true; // need this so the frame can be adjusted to the text + setup(); } AnnotationObject::AnnotationObject(SdrModel& rSdrModel, AnnotationObject const& rSource) : SdrRectObj(rSdrModel, rSource) { - setAsAnnotationObject(true); - mbTextFrame = true; // need this so the frame can be adjusted to the text + setup(); } AnnotationObject::AnnotationObject(SdrModel& rSdrModel, tools::Rectangle const& rRectangle, @@ -116,8 +115,15 @@ AnnotationObject::AnnotationObject(SdrModel& rSdrModel, tools::Rectangle const& rSdrModel.EnableUndo(bUndo); osl_atomic_decrement(&m_refCount); + setup(); +} + +void AnnotationObject::setup() +{ setAsAnnotationObject(true); mbTextFrame = true; // need this so the frame can be adjusted to the text + bool bLOK = comphelper::LibreOfficeKit::isActive(); + SetVisible(getSdrModelFromSdrObject().IsPDFDocument() || !bLOK); } void AnnotationObject::ApplyAnnotationName() diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 3c43cf2c81bc..a26b26a2ff2c 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -142,6 +142,7 @@ SdrModel::SdrModel(SfxItemPool* pPool, comphelper::IEmbeddedHelper* pEmbeddedHel , m_bStarDrawPreviewMode(false) , mbDisableTextEditUsesCommonUndoManager(false) , mbVOCInvalidationIsReliable(false) + , m_bIsPDFDocument(false) , m_nDefaultTabulator(0) , m_nMaxUndoCount(16) , m_pTextChain(new TextChain) |