[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sw/inc sw/source
sw/inc/strings.hrc |1 + sw/source/core/doc/doc.cxx |2 ++ sw/source/core/text/EnhancedPDFExportHelper.cxx |6 +- sw/source/uibase/docvw/AnnotationWin2.cxx | 12 4 files changed, 20 insertions(+), 1 deletion(-) New commits: commit cf7d723194d7a20e9c014dcf94dff7edfc6b7c04 Author: Scott Clarke AuthorDate: Fri Sep 6 14:26:52 2019 +0100 Commit: Michael Meeks CommitDate: Fri Nov 29 14:29:29 2019 +0100 Make resolved comments appear resolved when printed Added an indication to resolved comments when printing them or exporting them as a PDF. Change-Id: I9a84b76d6f12cca3c4541d19a0890cbd1cf430a7 Reviewed-on: https://gerrit.libreoffice.org/78712 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt Reviewed-on: https://gerrit.libreoffice.org/83740 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index f094e5736947..324c49c88051 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -659,6 +659,7 @@ #define STR_POSTIT_SHOW NC_("STR_POSTIT_SHOW", "Show All") #define STR_POSTIT_HIDE NC_("STR_POSTIT_HIDE", "Hide All") #define STR_POSTIT_DELETE NC_("STR_POSTIT_DELETE", "Delete All") +#define STR_RESOLVEDNC_("STR_RESOLVED", "RESOLVED") #define STR_MARGIN_TOOLTIP_LEFT NC_("STR_MARGIN_TOOLTIP_LEFT", "Left: ") #define STR_MARGIN_TOOLTIP_RIGHT NC_("STR_MARGIN_TOOLTIP_RIGHT", ". Right: ") diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 2c69bb7fa1fe..59ea8ea19672 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -616,6 +616,8 @@ static void lcl_FormatPostIt( aStr += " "; SvtSysLocale aSysLocale; aStr += /*(LocaleDataWrapper&)*/aSysLocale.GetLocaleData().getDate( pField->GetDate() ); +if(pField->GetResolved()) +aStr += " " + SwResId(STR_RESOLVED); pIDCO->InsertString( aPam, aStr ); pIDCO->SplitNode( *aPam.GetPoint(), false ); diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 4ad8d67964a2..8ddead098a80 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -75,6 +75,7 @@ #include #include #include +#include #include #include @@ -1598,7 +1599,10 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() pNumFormatter->GetOutputString( aDateDiff.GetDate(), nFormat, sDate, ); // The title should consist of the author and the date: -aNote.Title = pField->GetPar1() + ", " + sDate; +if(pField->GetResolved()) +aNote.Title = pField->GetPar1() + ", " + sDate + ", " + SwResId(STR_RESOLVED); +else +aNote.Title = pField->GetPar1() + ", " + sDate; // Guess what the contents contains... aNote.Contents = pField->GetText(); diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index 1016118aedec..48db11fdd37e 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -300,6 +300,18 @@ void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, const Size& rSz mpMetadataDate->SetControlFont( aOrigFont ); } +if (mpMetadataResolved->IsVisible()) +{ +vcl::Font aOrigFont(mpMetadataResolved->GetControlFont()); +Size aSize(PixelToLogic(mpMetadataResolved->GetSizePixel())); +Point aPos(PixelToLogic(mpMetadataResolved->GetPosPixel())); +aPos += rPt; +vcl::Font aFont( mpMetadataResolved->GetSettings().GetStyleSettings().GetFieldFont() ); +mpMetadataResolved->SetControlFont( aFont ); +mpMetadataResolved->Draw(pDev, aPos, aSize, nInFlags); +mpMetadataResolved->SetControlFont( aOrigFont ); +} + mpSidebarTextControl->Draw(pDev, rPt, rSz, nInFlags); const drawinglayer::geometry::ViewInformation2D aNewViewInfos; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.Menubar.js | 12 +++- loleaflet/src/control/Ruler.js |5 - loleaflet/src/layer/AnnotationManager.js | 10 ++ 3 files changed, 17 insertions(+), 10 deletions(-) New commits: commit e2c4dd28d4129723564652620dec149d08d1d53e Author: Scott Clarke AuthorDate: Tue Sep 3 11:49:35 2019 +0100 Commit: Samuel Mehrbrodt CommitDate: Mon Sep 30 07:11:02 2019 +0200 Make changes to "Resolved Comments" view menu option The check mark for resolved comments in the view menu is now dependent on the state of the javascript variable rather than the other way around. This brings it in line with how other similar menu options work. Also fixed ruler so that it looks correct when there are comments on the document which are all hidden. Change-Id: I636260da3d053799b53363e9412a0b367e3a9274 Reviewed-on: https://gerrit.libreoffice.org/78775 Reviewed-by: Samuel Mehrbrodt Tested-by: Samuel Mehrbrodt diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index e55d53f5a..714dd177e 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -744,6 +744,16 @@ L.Control.Menubar = L.Control.extend({ } else { $(aItem).removeClass('disabled'); } + } else if (id === 'showresolved') { + if (self._map._docLayer._annotations._items.length === 0) { + $(aItem).addClass('disabled'); + } else if (self._map._docLayer._annotations._showResolved) { + $(aItem).removeClass('disabled'); + $(aItem).addClass(constChecked); + } else { + $(aItem).removeClass('disabled'); + $(aItem).removeClass(constChecked); + } } else { $(aItem).removeClass('disabled'); } @@ -802,7 +812,7 @@ L.Control.Menubar = L.Control.extend({ } else if (id === 'zoomin' && this._map.getZoom() < this._map.getMaxZoom()) { this._map.zoomIn(1); } else if (id === 'showresolved') { - this._map.showResolvedComments(item); + this._map.showResolvedComments(!$(item).hasClass('lo-menu-item-checked')); } else if (id === 'zoomout' && this._map.getZoom() > this._map.getMinZoom()) { this._map.zoomOut(1); } else if (id === 'zoomreset') { diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js index 029b690a0..f00522797 100644 --- a/loleaflet/src/control/Ruler.js +++ b/loleaflet/src/control/Ruler.js @@ -85,7 +85,10 @@ L.Control.Ruler = L.Control.extend({ if (this.options.margin1 == null || this.options.margin2 == null) return; - if (this._map._docLayer._annotations._items.length === 0 || !this.options.marginSet) + if (this._map._docLayer._annotations._items.length === 0 + || this._map._docLayer._annotations._items.length + === this._map._docLayer._annotations._hiddenItems + || !this.options.marginSet) this.options.extraSize = 0; var classMajorSep = 'loleaflet-ruler-maj', diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js index da1161f06..54336b041 100644 --- a/loleaflet/src/layer/AnnotationManager.js +++ b/loleaflet/src/layer/AnnotationManager.js @@ -995,16 +995,10 @@ L.Map.include({ }); }, - showResolvedComments: function(item) { + showResolvedComments: function(on) { var unoCommand = '.uno:ShowResolvedAnnotations'; - var on = $(item).hasClass('lo-menu-item-checked'); this.sendUnoCommand(unoCommand); - this._docLayer._annotations.setViewResolved(!on); - if (on) { - $(item).removeClass('lo-menu-item-checked'); - } else { - $(item).addClass('lo-menu-item-checked'); - } + this._docLayer._annotations.setViewResolved(on); } }); ___ Libreoffice-commits mailing list
[Libreoffice-commits] core.git: sw/inc sw/source
sw/inc/strings.hrc |1 + sw/source/core/doc/doc.cxx |2 ++ sw/source/core/text/EnhancedPDFExportHelper.cxx |6 +- sw/source/uibase/docvw/AnnotationWin2.cxx | 12 4 files changed, 20 insertions(+), 1 deletion(-) New commits: commit c45d477b0a0038d9c25176cf7cff299e5ddf3a7a Author: Scott Clarke AuthorDate: Fri Sep 6 14:26:52 2019 +0100 Commit: Samuel Mehrbrodt CommitDate: Mon Sep 30 07:07:34 2019 +0200 Make resolved comments appear resolved when printed Added an indication to resolved comments when printing them or exporting them as a PDF. Change-Id: I9a84b76d6f12cca3c4541d19a0890cbd1cf430a7 Reviewed-on: https://gerrit.libreoffice.org/78712 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index 6cb4b8256fab..867c03b9bb0d 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -664,6 +664,7 @@ #define STR_POSTIT_SHOW NC_("STR_POSTIT_SHOW", "Show All") #define STR_POSTIT_HIDE NC_("STR_POSTIT_HIDE", "Hide All") #define STR_POSTIT_DELETE NC_("STR_POSTIT_DELETE", "Delete All") +#define STR_RESOLVEDNC_("STR_RESOLVED", "RESOLVED") #define STR_MARGIN_TOOLTIP_LEFT NC_("STR_MARGIN_TOOLTIP_LEFT", "Left: ") #define STR_MARGIN_TOOLTIP_RIGHT NC_("STR_MARGIN_TOOLTIP_RIGHT", ". Right: ") diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 6bd6ee148427..60875366134b 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -616,6 +616,8 @@ static void lcl_FormatPostIt( aStr += " "; SvtSysLocale aSysLocale; aStr += /*(LocaleDataWrapper&)*/aSysLocale.GetLocaleData().getDate( pField->GetDate() ); +if(pField->GetResolved()) +aStr += " " + SwResId(STR_RESOLVED); pIDCO->InsertString( aPam, aStr ); pIDCO->SplitNode( *aPam.GetPoint(), false ); diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index fa673eb0a278..b3e35ae2d699 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -78,6 +78,7 @@ #include #include #include +#include #include #include @@ -1590,7 +1591,10 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() pNumFormatter->GetOutputString( aDateDiff.GetDate(), nFormat, sDate, ); // The title should consist of the author and the date: -aNote.Title = pField->GetPar1() + ", " + sDate; +if(pField->GetResolved()) +aNote.Title = pField->GetPar1() + ", " + sDate + ", " + SwResId(STR_RESOLVED); +else +aNote.Title = pField->GetPar1() + ", " + sDate; // Guess what the contents contains... aNote.Contents = pField->GetText(); diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index 137791a8edc5..acfc90b506e0 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -305,6 +305,18 @@ void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, const Size& rSz mpMetadataDate->SetControlFont( aOrigFont ); } +if (mpMetadataResolved->IsVisible()) +{ +vcl::Font aOrigFont(mpMetadataResolved->GetControlFont()); +Size aSize(PixelToLogic(mpMetadataResolved->GetSizePixel())); +Point aPos(PixelToLogic(mpMetadataResolved->GetPosPixel())); +aPos += rPt; +vcl::Font aFont( mpMetadataResolved->GetSettings().GetStyleSettings().GetFieldFont() ); +mpMetadataResolved->SetControlFont( aFont ); +mpMetadataResolved->Draw(pDev, aPos, aSize, nInFlags); +mpMetadataResolved->SetControlFont( aOrigFont ); +} + mpSidebarTextControl->Draw(pDev, rPt, rSz, nInFlags); const drawinglayer::geometry::ViewInformation2D aNewViewInfos; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 3 commits - sw/inc sw/qa sw/source xmloff/source
sw/inc/fmtfld.hxx|3 +- sw/qa/extras/odfexport/data/resolved-comment.odt |binary sw/qa/extras/odfexport/odfexport.cxx | 14 + sw/source/uibase/config/viewopt.cxx |1 sw/source/uibase/docvw/AnnotationWin.cxx | 11 +++--- sw/source/uibase/docvw/PostItMgr.cxx | 11 +++--- xmloff/source/text/txtflde.cxx | 24 --- 7 files changed, 46 insertions(+), 18 deletions(-) New commits: commit ed0c7235b99d2324d138a220c9a1d0363851230f Author: Scott Clarke AuthorDate: Thu Aug 8 13:37:54 2019 +0100 Commit: Miklos Vajna CommitDate: Wed Aug 28 09:08:33 2019 +0200 Set "Resolved Comments" view option on by default The "Resolved Comments" view option now starts switched on by default to match the fact that resolved comments would be visible when a document was first opened anyway. (cherry picked from commit e7638f15fc945e6de73876949538682b854fdc41) Change-Id: Ib9c41c57c826f4282d0d6bf0ebcd485aa71ce1d6 Reviewed-on: https://gerrit.libreoffice.org/78188 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna diff --git a/sw/source/uibase/config/viewopt.cxx b/sw/source/uibase/config/viewopt.cxx index 970816c3e3ce..f1461378f705 100644 --- a/sw/source/uibase/config/viewopt.cxx +++ b/sw/source/uibase/config/viewopt.cxx @@ -193,6 +193,7 @@ SwViewOption::SwViewOption() : m_nUIOptions = ViewOptFlags2::Modified | ViewOptFlags2::GrfKeepZoom | +ViewOptFlags2::ResolvedPostits | ViewOptFlags2::AnyRuler; if (!utl::ConfigManager::IsFuzzing() && MeasurementSystem::Metric != SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()) commit 24613559e1dc44f6ee8ed170d83b9ed518cff9a1 Author: Scott Clarke AuthorDate: Tue Aug 13 09:54:12 2019 +0100 Commit: Miklos Vajna CommitDate: Wed Aug 28 09:08:12 2019 +0200 Change some handling for resolved comments Changed the way the lcl_CommentNotification method is called when a comment is resolved such that resolution is distinct from other changes. Resolved flag is now only stored in the top annotation of a thread when saved as ODT. (cherry picked from commit 9751b4b4fa00cf5175ccc0f9c52a22b07f73d4aa) Conflicts: sw/source/uibase/docvw/PostItMgr.cxx Change-Id: I5ef36718fd7e1dfcc16c077871653a70476e8804 Reviewed-on: https://gerrit.libreoffice.org/78187 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx index 6c1b805e952c..076eaa53d4da 100644 --- a/sw/inc/fmtfld.hxx +++ b/sw/inc/fmtfld.hxx @@ -114,7 +114,8 @@ enum class SwFormatFieldHintWhich REMOVED= 2, FOCUS = 3, CHANGED= 4, -LANGUAGE = 5 +LANGUAGE = 5, +RESOLVED = 6 }; class SW_DLLPUBLIC SwFormatFieldHint : public SfxHint diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx index 420c350fce26..51b30e542766 100644 --- a/sw/source/uibase/docvw/AnnotationWin.cxx +++ b/sw/source/uibase/docvw/AnnotationWin.cxx @@ -220,6 +220,7 @@ void SwAnnotationWin::SetPostItText() void SwAnnotationWin::SetResolved(bool resolved) { +bool oldState = IsResolved(); static_cast(mpFormatField->GetField())->SetResolved(resolved); const SwViewOption* pVOpt = mrView.GetWrtShellPtr()->GetViewOptions(); mrSidebarItem.bShow = !IsResolved() || (pVOpt->IsResolvedPostIts()); @@ -231,7 +232,8 @@ void SwAnnotationWin::SetResolved(bool resolved) else mpMetadataResolved->Hide(); -mbResolvedStateUpdated = true; +if(IsResolved() != oldState) +mbResolvedStateUpdated = true; UpdateData(); Invalidate(); } @@ -261,7 +263,7 @@ bool SwAnnotationWin::IsThreadResolved() void SwAnnotationWin::UpdateData() { -if ( mpOutliner->IsModified() || mbResolvedStateUpdated) +if ( mpOutliner->IsModified() || mbResolvedStateUpdated ) { IDocumentUndoRedo & rUndoRedo( mrView.GetDocShell()->GetDoc()->GetIDocumentUndoRedo()); @@ -283,7 +285,10 @@ void SwAnnotationWin::UpdateData() // so we get a new layout of notes (anchor position is still the same and we would otherwise not get one) mrMgr.SetLayout(); // #i98686# if we have several views, all notes should update their text -mpFormatField->Broadcast(SwFormatFieldHint( nullptr, SwFormatFieldHintWhich::CHANGED)); +if(mbResolvedStateUpdated) +mpFormatField->Broadcast(SwFormatFieldHint( nullptr, SwFormatFieldHintWhich::RESOLVED)); +else +mpFormatField->Broadcast(SwFormatFieldHint( nullptr, SwFormatFieldHintWhich::CHANGED)); mrView.GetDocShell()->SetModified(); } mpOutliner->ClearModifyFlag(); diff --git a/sw/source/uibase/docvw/PostItMgr.cxx
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - officecfg/registry svx/sdi sw/inc sw/sdi sw/source sw/uiconfig
officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu | 11 svx/sdi/svx.sdi | 16 ++ sw/inc/PostItMgr.hxx|1 sw/inc/viewopt.hxx | 11 +++- sw/sdi/_viewsh.sdi |8 +++ sw/source/uibase/docvw/AnnotationWin.cxx|6 ++ sw/source/uibase/docvw/PostItMgr.cxx| 15 ++ sw/source/uibase/uiview/view0.cxx | 25 +- sw/uiconfig/swriter/menubar/menubar.xml |1 sw/uiconfig/swriter/ui/viewoptionspage.ui | 22 sw/uiconfig/swxform/menubar/menubar.xml |1 11 files changed, 111 insertions(+), 6 deletions(-) New commits: commit 6498a896796a229a6b580782676cd06978b1cc0e Author: Scott Clarke AuthorDate: Tue Jun 11 13:07:20 2019 +0100 Commit: Miklos Vajna CommitDate: Wed Aug 28 09:07:38 2019 +0200 tdf#119228 Add 'Resolved Comments' option to the View menu. Co-authored-by: Jim MacArthur (cherry picked from commit fb3a0b084701ee1089a76568b3b110ac5b0df460) Conflicts: sw/uiconfig/swriter/menubar/menubar.xml sw/uiconfig/swxform/menubar/menubar.xml Change-Id: Ib4554b77857992959a386c71e99e424579196ded Reviewed-on: https://gerrit.libreoffice.org/78185 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu index 848d598e620a..6ef6fcd224e7 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu @@ -2492,6 +2492,17 @@ 1 + + + Show resolved comme~nts + + + Resolved Comments + + + 1 + + View Images and Charts diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index fe3e550b446b..2650f122ac54 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -4516,6 +4516,22 @@ SfxVoidItem ShowAnnotations SID_TOGGLE_NOTES GroupId = SfxGroupId::View; ] +SfxVoidItem ShowResolvedAnnotations SID_TOGGLE_RESOLVED_NOTES +() +[ +AutoUpdate = FALSE, +FastCall = FALSE, +ReadOnlyDoc = TRUE, +Toggle = FALSE, +Container = FALSE, +RecordAbsolute = FALSE, +RecordPerSet; + +AccelConfig = TRUE, +MenuConfig = TRUE, +ToolBoxConfig = TRUE, +GroupId = SfxGroupId::View; +] SfxVoidItem ReplyToAnnotation SID_REPLYTO_POSTIT diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx index 4a241dfcbb8a..c660abef9385 100644 --- a/sw/inc/PostItMgr.hxx +++ b/sw/inc/PostItMgr.hxx @@ -214,6 +214,7 @@ class SwPostItMgr: public SfxListener void Hide(); void Show(); void UpdateResolvedStatus(sw::annotation::SwAnnotationWin* topNote); +void ShowHideResolvedNotes(bool visible); void Rescale(); diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx index 2f9332789451..7ce49c27bf51 100644 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -91,10 +91,11 @@ enum class ViewOptFlags2 { ScrollbarTips = 0x0040, PrintFormat = 0x0080, ShadowCursor= 0x0100, -VRulerRight = 0x0200 +VRulerRight = 0x0200, +ResolvedPostits = 0x0400, }; namespace o3tl { -template<> struct typed_flags : is_typed_flags {}; +template<> struct typed_flags : is_typed_flags {}; }; // Table background. @@ -258,6 +259,12 @@ public: { return bool(m_nCoreOptions & ViewOptFlags1::Postits); } void SetPostIts( bool b ) { SetCoreOption(b, ViewOptFlags1::Postits); } + +bool IsResolvedPostIts() const +{ return bool(m_nUIOptions & ViewOptFlags2::ResolvedPostits); } +void SetResolvedPostIts( bool b ) +{ SetUIOption(b, ViewOptFlags2::ResolvedPostits); } + static void PaintPostIts( OutputDevice *pOut, const SwRect , bool bIsScript ); static sal_uInt16 GetPostItsWidth( const OutputDevice *pOut ); diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi index 19b15226dac7..824eb2f0e6e3 100644 --- a/sw/sdi/_viewsh.sdi +++ b/sw/sdi/_viewsh.sdi @@ -805,6 +805,14 @@ interface BaseTextEditView StateMethod = StateViewOptions ; Export = FALSE; ] + +SID_TOGGLE_RESOLVED_NOTES +[ +ExecMethod = ExecViewOptions ; +StateMethod = StateViewOptions ; +Export = FALSE; +] + // Everything from here can be removed (Export = FALSE;), if the previous works FN_RULER // status() [ diff --git
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - officecfg/registry sfx2/source sw/inc sw/sdi sw/source sw/uiconfig
officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |8 sfx2/source/control/unoctitm.cxx |1 sw/inc/cmdid.h |1 sw/sdi/_annotsh.sdi |6 +++ sw/sdi/_textsh.sdi |5 ++ sw/sdi/swriter.sdi | 17 ++ sw/source/uibase/docvw/AnnotationMenuButton.cxx |6 +++ sw/source/uibase/docvw/AnnotationWin2.cxx|8 sw/source/uibase/shells/annotsh.cxx | 16 - sw/source/uibase/shells/textfld.cxx |9 + sw/uiconfig/sglobal/menubar/menubar.xml |1 sw/uiconfig/sglobal/popupmenu/annotation.xml |1 sw/uiconfig/swriter/menubar/menubar.xml |1 sw/uiconfig/swriter/popupmenu/annotation.xml |1 sw/uiconfig/swriter/ui/annotationmenu.ui | 16 + sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui|7 16 files changed, 102 insertions(+), 2 deletions(-) New commits: commit 0351db5774bfde36cc7730912de863ad7f54daa7 Author: Scott Clarke AuthorDate: Wed Jun 19 16:29:54 2019 +0100 Commit: Miklos Vajna CommitDate: Tue Aug 27 17:50:28 2019 +0200 tdf#119228 Add UI elements to resolve and unresolve comments Co-authored-by: Jim MacArthur (cherry picked from commit 6986ebd4a0020e515a115acbe7f1f738a4fd83f4) Conflicts: sw/uiconfig/sglobal/menubar/menubar.xml sw/uiconfig/swriter/menubar/menubar.xml Change-Id: I22403299d034a638724077744070b3add64cacf2 Reviewed-on: https://gerrit.libreoffice.org/78184 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index 63835b385892..160290b46242 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -6270,6 +6270,14 @@ 1 + + + Resolved + + + 1 + + Top diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 35ae00b2631d..fdc52138f8a9 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1058,6 +1058,7 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c aEvent.FeatureURL.Path == "SelectAll" || aEvent.FeatureURL.Path == "InsertAnnotation" || aEvent.FeatureURL.Path == "DeleteAnnotation" || + aEvent.FeatureURL.Path == "ResolveAnnotation" || aEvent.FeatureURL.Path == "InsertRowsBefore" || aEvent.FeatureURL.Path == "InsertRowsAfter" || aEvent.FeatureURL.Path == "InsertColumnsBefore" || diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index 8a71956b3619..8e0ec469d648 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -727,6 +727,7 @@ #define FN_DELETE_COMMENT (FN_NOTES+6) #define FN_REPLY(FN_NOTES+7) #define FN_FORMAT_ALL_NOTES (FN_NOTES+8) +#define FN_RESOLVE_NOTE (FN_NOTES+9) // Region: Parameter #define FN_PARAM_MOVE_COUNT (FN_PARAM+2) diff --git a/sw/sdi/_annotsh.sdi b/sw/sdi/_annotsh.sdi index 323d5d06b8b1..84f3aed0b007 100644 --- a/sw/sdi/_annotsh.sdi +++ b/sw/sdi/_annotsh.sdi @@ -60,6 +60,12 @@ interface _Annotation StateMethod = GetNoteState ; ] +FN_RESOLVE_NOTE +[ +ExecMethod = NoteExec ; +StateMethod = GetNoteState ; +] + FN_POSTIT [ ExecMethod = NoteExec ; diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi index 466b02c5e0bb..5d975daa74f4 100644 --- a/sw/sdi/_textsh.sdi +++ b/sw/sdi/_textsh.sdi @@ -946,6 +946,11 @@ interface BaseText ExecMethod = ExecField ; StateMethod = StateField; ] +FN_RESOLVE_NOTE +[ +ExecMethod = ExecField ; +StateMethod = StateField; +] FN_DELETE_NOTE_AUTHOR [ ExecMethod = ExecField ; diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi index 69edddb1571d..5f03b7d9799c 100644 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -7067,6 +7067,23 @@ SfxVoidItem DeleteComment FN_DELETE_COMMENT GroupId = SfxGroupId::Edit; ] +SfxVoidItem ResolveComment FN_RESOLVE_NOTE +(SvxPostItIdItem Id SID_ATTR_POSTIT_ID) +[ +AutoUpdate = FALSE, +FastCall = FALSE, +ReadOnlyDoc = FALSE, +Toggle = FALSE,
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sw/inc sw/source
sw/inc/AnnotationWin.hxx |2 sw/inc/strings.hrc|1 sw/source/uibase/docvw/AnnotationWin.cxx | 11 + sw/source/uibase/docvw/AnnotationWin2.cxx | 64 +++--- 4 files changed, 72 insertions(+), 6 deletions(-) New commits: commit 4bfc562d8f9745bc4805ea06c73d4d53efee8a33 Author: Scott Clarke AuthorDate: Wed Jun 19 16:30:35 2019 +0100 Commit: Miklos Vajna CommitDate: Tue Aug 27 17:50:15 2019 +0200 tdf#119228 Add UI elements to display the resolved state Co-authored-by: Jim MacArthur (cherry picked from commit 7ade0c7d03594bfa5c067f32230a1e4ed93d7fbb) Change-Id: I3ba1572771bc893d2c74993a161d00c2acc70960 Reviewed-on: https://gerrit.libreoffice.org/78183 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx index 5682a846d486..5c0fb100b9c3 100644 --- a/sw/inc/AnnotationWin.hxx +++ b/sw/inc/AnnotationWin.hxx @@ -157,6 +157,7 @@ class SwAnnotationWin : public vcl::Window sal_Int32 GetMinimumSizeWithoutMeta(); sal_Int32 GetMetaButtonAreaWidth(); sal_Int32 GetScrollbarWidth(); +sal_Int32 GetNumFields(); voidSetSpellChecking(); @@ -230,6 +231,7 @@ class SwAnnotationWin : public vcl::Window VclPtr mpVScrollbar; VclPtr mpMetadataAuthor; VclPtr mpMetadataDate; +VclPtr mpMetadataResolved; VclPtr mpMenuButton; std::unique_ptr mpAnchor; diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index 1bb9b35a7c1a..3c968c3914fa 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -557,6 +557,7 @@ #define STR_ACCESS_PAGE_DESCNC_("STR_ACCESS_PAGE_DESC", "Page: $(ARG1)") #define STR_ACCESS_ANNOTATION_AUTHOR_NAME NC_("STR_ACCESS_ANNOTATION_AUTHOR_NAME", "Author") #define STR_ACCESS_ANNOTATION_DATE_NAME NC_("STR_ACCESS_ANNOTATION_DATE_NAME", "Date") +#define STR_ACCESS_ANNOTATION_RESOLVED_NAME NC_("STR_ACCESS_ANNOTATION_RESOLVED_NAME", "Resolved") #define STR_ACCESS_ANNOTATION_BUTTON_NAME NC_("STR_ACCESS_ANNOTATION_BUTTON_NAME", "Actions") #define STR_ACCESS_ANNOTATION_BUTTON_DESC NC_("STR_ACCESS_ANNOTATION_BUTTON_DESC", "Activate this button to open a list of actions which can be performed on this comment and other comments") #define STR_ACCESS_PREVIEW_DOC_NAME NC_("STR_ACCESS_PREVIEW_DOC_NAME", "Document preview") diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx index 9516d011ea99..1bef5a9d8740 100644 --- a/sw/source/uibase/docvw/AnnotationWin.cxx +++ b/sw/source/uibase/docvw/AnnotationWin.cxx @@ -147,6 +147,12 @@ void SwAnnotationWin::dispose() } mpMetadataAuthor.disposeAndClear(); +if (mpMetadataResolved) +{ +mpMetadataResolved->RemoveEventListener( LINK( this, SwAnnotationWin, WindowEventListener ) ); +} +mpMetadataResolved.disposeAndClear(); + if (mpMetadataDate) { mpMetadataDate->RemoveEventListener( LINK( this, SwAnnotationWin, WindowEventListener ) ); @@ -216,6 +222,11 @@ void SwAnnotationWin::SetResolved(bool resolved) static_cast(mpFormatField->GetField())->SetResolved(resolved); mrSidebarItem.bShow = !IsResolved(); +if(IsResolved()) +mpMetadataResolved->Show(); +else +mpMetadataResolved->Hide(); + mbResolvedStateUpdated = true; UpdateData(); Invalidate(); diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index 39bea61bfdf5..c504bef5c5e1 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -153,7 +153,7 @@ namespace sw { namespace annotation { #define METABUTTON_WIDTH16 #define METABUTTON_HEIGHT 18 #define METABUTTON_AREA_WIDTH 30 -#define POSTIT_META_HEIGHT sal_Int32(30) +#define POSTIT_META_FIELD_HEIGHT sal_Int32(15) #define POSTIT_MINIMUMSIZE_WITHOUT_META 50 @@ -173,11 +173,13 @@ void SwAnnotationWin::Paint(vcl::RenderContext& rRenderContext, const tools::Rec rRenderContext.SetFillColor(mColorDark); } +sal_uInt32 boxHeight = mpMetadataAuthor->GetSizePixel().Height() + mpMetadataDate->GetSizePixel().Height(); +boxHeight += IsThreadResolved() ? mpMetadataResolved->GetSizePixel().Height() : 0; + rRenderContext.SetLineColor(); tools::Rectangle aRectangle(Point(mpMetadataAuthor->GetPosPixel().X() + mpMetadataAuthor->GetSizePixel().Width(), mpMetadataAuthor->GetPosPixel().Y()), - Size(GetMetaButtonAreaWidth(), - mpMetadataAuthor->GetSizePixel().Height() + mpMetadataDate->GetSizePixel().Height())); +
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 2 commits - sw/inc sw/source
sw/inc/AnnotationWin.hxx | 15 ++ sw/inc/PostItMgr.hxx |3 ++ sw/source/uibase/docvw/AnnotationWin.cxx | 37 +- sw/source/uibase/docvw/AnnotationWin2.cxx |7 ++--- sw/source/uibase/docvw/PostItMgr.cxx | 42 ++ 5 files changed, 99 insertions(+), 5 deletions(-) New commits: commit 8a3b994f4dc6b1679bff300865fe637fb4df8a04 Author: Scott Clarke AuthorDate: Wed Jun 19 17:12:22 2019 +0100 Commit: Miklos Vajna CommitDate: Tue Aug 27 17:12:39 2019 +0200 tdf#119228 Add accessors for resolved state Co-authored-by: Jim MacArthur (cherry picked from commit f4f5e3f98aee5d9d1679edab8248a4cfd12f74ce) Change-Id: Ic4051f4e7fda11eade1e50ce70bed11f70f0742d Reviewed-on: https://gerrit.libreoffice.org/78182 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx index 7402eaf58d3c..5682a846d486 100644 --- a/sw/inc/AnnotationWin.hxx +++ b/sw/inc/AnnotationWin.hxx @@ -189,6 +189,17 @@ class SwAnnotationWin : public vcl::Window /// Allows adjusting the point or mark of the selection to a document coordinate. void SetCursorLogicPosition(const Point& rPosition, bool bPoint, bool bClearMark); +// Various access functions for 'resolved' status +void SetResolved(bool resolved); +void ToggleResolved(); +void ToggleResolvedForThread(); +bool IsResolved() const; +bool IsThreadResolved(); + +/// Find the first annotation for the thread which this annotation is in. +/// This may be the same annotation as this one. +SwAnnotationWin* GetTopReplyNote(); + private: VclPtr CreateMenuButton(); virtual voidLoseFocus() override; @@ -204,10 +215,6 @@ class SwAnnotationWin : public vcl::Window sal_uInt32 CountFollowing(); -/// Find the first annotation for the thread which this annotation is in. -/// This may be the same annotation as this one. -SwAnnotationWin* GetTopReplyNote(); - SvxLanguageItem GetLanguage(); VclBuilder maBuilder; @@ -241,6 +248,8 @@ class SwAnnotationWin : public vcl::Window longmPageBorder; boolmbAnchorRectChanged; +boolmbResolvedStateUpdated; + std::vector maAnnotationTextRanges; boolmbMouseOver; diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx index 9650996c50f3..4a241dfcbb8a 100644 --- a/sw/inc/PostItMgr.hxx +++ b/sw/inc/PostItMgr.hxx @@ -204,6 +204,8 @@ class SwPostItMgr: public SfxListener void Delete(const OUString& aAuthor); void Delete(sal_uInt32 nPostItId); void Delete(); +void ToggleResolved(sal_uInt32 nPostItId); +void ToggleResolvedForThread(sal_uInt32 nPostItId); void ExecuteFormatAllDialog(SwView& rView); void FormatAll(const SfxItemSet ); @@ -211,6 +213,7 @@ class SwPostItMgr: public SfxListener void Hide( const OUString& rAuthor ); void Hide(); void Show(); +void UpdateResolvedStatus(sw::annotation::SwAnnotationWin* topNote); void Rescale(); diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx index cc034f072e1c..9516d011ea99 100644 --- a/sw/source/uibase/docvw/AnnotationWin.cxx +++ b/sw/source/uibase/docvw/AnnotationWin.cxx @@ -84,6 +84,7 @@ SwAnnotationWin::SwAnnotationWin( SwEditWin& rEditWin, , mAnchorRect() , mPageBorder(0) , mbAnchorRectChanged(false) +, mbResolvedStateUpdated(false) , mbMouseOver(false) , mLayoutStatus(SwPostItHelper::INVISIBLE) , mbReadonly(false) @@ -210,9 +211,42 @@ void SwAnnotationWin::SetPostItText() Invalidate(); } +void SwAnnotationWin::SetResolved(bool resolved) +{ + static_cast(mpFormatField->GetField())->SetResolved(resolved); +mrSidebarItem.bShow = !IsResolved(); + +mbResolvedStateUpdated = true; +UpdateData(); +Invalidate(); +} + +void SwAnnotationWin::ToggleResolved() +{ +SetResolved(!IsResolved()); +} + +void SwAnnotationWin::ToggleResolvedForThread() +{ +GetTopReplyNote()->ToggleResolved(); +mrMgr.UpdateResolvedStatus(GetTopReplyNote()); +mrMgr.LayoutPostIts(); +} + +bool SwAnnotationWin::IsResolved() const +{ +return static_cast(mpFormatField->GetField())->GetResolved(); +} + +bool SwAnnotationWin::IsThreadResolved() +{ +// Not const because GetTopReplyNote isn't. +return GetTopReplyNote()->IsResolved(); +} + void SwAnnotationWin::UpdateData() { -if ( mpOutliner->IsModified() ) +if ( mpOutliner->IsModified() || mbResolvedStateUpdated) { IDocumentUndoRedo & rUndoRedo( mrView.GetDocShell()->GetDoc()->GetIDocumentUndoRedo()); @@ -239,6 +273,7 @@ void
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 2 commits - desktop/source include/svx include/xmloff schema/libreoffice sw/inc sw/source xmloff/inc xmloff/source
desktop/source/lib/init.cxx |1 include/svx/svxids.hrc |3 - include/xmloff/txtimp.hxx |1 include/xmloff/xmltoken.hxx |2 schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng | 18 +++ sw/inc/docufld.hxx |6 ++ sw/inc/unoprnms.hxx |2 sw/source/core/fields/docufld.cxx | 28 +++- sw/source/core/unocore/unofield.cxx |4 + sw/source/core/unocore/unomap.cxx |1 sw/source/uibase/docvw/AnnotationWin2.cxx |2 sw/source/uibase/docvw/PostItMgr.cxx|1 sw/source/uibase/uno/unotxdoc.cxx |1 xmloff/inc/txtfldi.hxx |1 xmloff/source/core/xmltoken.cxx |3 + xmloff/source/text/txtflde.cxx | 12 + xmloff/source/text/txtfldi.cxx |7 +++ xmloff/source/text/txtimp.cxx |1 xmloff/source/token/tokens.txt |1 19 files changed, 90 insertions(+), 5 deletions(-) New commits: commit 82bdf5996cff7061bb90eb373d7879498c3f3d2c Author: Scott Clarke AuthorDate: Fri Jun 7 15:28:42 2019 +0100 Commit: Miklos Vajna CommitDate: Tue Aug 27 17:11:56 2019 +0200 tdf#119228 Add storage and serialisation for the Resolved flag Co-authored-by: Jim MacArthur (cherry picked from commit d2025bdc33cc8d9e2f6c9f90da4574275ed6b0e4) Conflicts: include/svx/svxids.hrc sw/source/core/unocore/unofield.cxx Change-Id: I0278588dc533378104e544d05b60583c85271f6a Reviewed-on: https://gerrit.libreoffice.org/78180 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 7f4a323eecd5..5b269e8a2fe1 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2289,6 +2289,7 @@ static void doc_iniUnoCommands () OUString(".uno:InsertAnnotation"), OUString(".uno:DeleteAnnotation"), OUString(".uno:ReplyComment"), +OUString(".uno:ResolveComment"), OUString(".uno:InsertRowsBefore"), OUString(".uno:InsertRowsAfter"), OUString(".uno:InsertColumnsBefore"), diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index 73b760b9d772..c3bc6f19f7a0 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -978,9 +978,10 @@ class SfxStringItem; #define SID_TABLE_OPTIMAL_COLUMN_WIDTH ( SID_SVX_START + 1187 ) #define SID_TABLE_OPTIMAL_ROW_HEIGHT( SID_SVX_START + 1188 ) +#define SID_TOGGLE_RESOLVED_NOTES ( SID_SVX_START + 1189 ) // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id -#define SID_SVX_FIRSTFREE ( SID_TABLE_OPTIMAL_ROW_HEIGHT + 1 ) +#define SID_SVX_FIRSTFREE ( SID_TOGGLE_RESOLVED_NOTES + 1 ) // Overflow check for slot IDs #if SID_SVX_FIRSTFREE > SID_SVX_END diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx index 2caeff3ea689..299eb508bebe 100644 --- a/include/xmloff/txtimp.hxx +++ b/include/xmloff/txtimp.hxx @@ -212,6 +212,7 @@ enum XMLTextPElemTokens XML_TOK_TEXT_ANNOTATION, XML_TOK_TEXT_ANNOTATION_END, XML_TOK_TEXT_NAME, +XML_TOK_TEXT_RESOLVED, XML_TOK_TEXT_SCRIPT, XML_TOK_TEXT_TABLE_FORMULA, XML_TOK_TEXT_DROP_DOWN, diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index bebbcb7f08ac..aba87d7d5825 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -3350,6 +3350,8 @@ namespace xmloff { namespace token { // tdf#115007 XML_TRANSLITERATION_SPELLOUT, +XML_RESOLVED, + XML_TOKEN_END }; diff --git a/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng b/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng index 19786f82a7e1..8e8fecbf7895 100644 --- a/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng +++ b/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng @@ -965,6 +965,24 @@ xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1. + + + + + + + + + + + + + + + + + + diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx index 70f39e522628..96dbec96ba11 100644 --- a/sw/inc/docufld.hxx +++ b/sw/inc/docufld.hxx @@ -445,6 +445,7 @@ class SW_DLLPUBLIC SwPostItField :
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.Menubar.js |8 - loleaflet/src/layer/AnnotationManager.js | 213 +++ loleaflet/src/unocommands.js | 11 - 3 files changed, 171 insertions(+), 61 deletions(-) New commits: commit 4071f38635099a328ff03292d9da4ec0652bb0f6 Author: Scott Clarke AuthorDate: Thu May 23 17:03:15 2019 +0100 Commit: Henry Castro CommitDate: Mon Aug 19 16:45:22 2019 +0200 Add ability to show/hide resolved comments Add 'View:Resolved Comments' menu item Hide all comments in a thread when resolving them Connect Show/Hide resolved annotations to the annotation manager Change-Id: Ib646bdea3dfc30fde6a11aa13562db147afd7ae0 Co-authored-by: Jim MacArthur Reviewed-on: https://gerrit.libreoffice.org/76758 Reviewed-by: Henry Castro Tested-by: Henry Castro diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index d968685f5..3a845f926 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -63,7 +63,9 @@ L.Control.Menubar = L.Control.extend({ {name: _('Reset zoom'), id: 'zoomreset', type: 'action'}, {name: _('Show Ruler'), id: 'showruler', type: 'action'}, {type: 'separator'}, - {uno: '.uno:ControlCodes'} + {uno: '.uno:ControlCodes'}, + {type: 'separator'}, + {name: _UNO('.uno:ShowResolvedAnnotations', 'text'), id: 'showresolved', type: 'action'} ] }, {name: _UNO('.uno:InsertMenu', 'text'), type: 'menu', menu: [ @@ -445,7 +447,7 @@ L.Control.Menubar = L.Control.extend({ 'downloadas-pdf', 'downloadas-odt', 'downloadas-doc', 'downloadas-docx', 'downloadas-rtf', // file menu 'downloadas-odp', 'downloadas-ppt', 'downloadas-pptx', 'print', // file menu 'downloadas-ods', 'downloadas-xls', 'downloadas-xlsx', 'closedocument', // file menu - 'fullscreen', 'zoomin', 'zoomout', 'zoomreset', // view menu + 'fullscreen', 'zoomin', 'zoomout', 'zoomreset', 'showresolved', // view menu 'about', 'keyboard-shortcuts' // help menu ] }, @@ -765,6 +767,8 @@ L.Control.Menubar = L.Control.extend({ this._map.fire('postMessage', {msgId: 'UI_InsertGraphic'}); } else if (id === 'zoomin' && this._map.getZoom() < this._map.getMaxZoom()) { this._map.zoomIn(1); + } else if (id === 'showresolved') { + this._map.showResolvedComments(item); } else if (id === 'zoomout' && this._map.getZoom() > this._map.getMinZoom()) { this._map.zoomOut(1); } else if (id === 'zoomreset') { diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js index fcd0abbd1..da1161f06 100644 --- a/loleaflet/src/layer/AnnotationManager.js +++ b/loleaflet/src/layer/AnnotationManager.js @@ -16,6 +16,7 @@ L.AnnotationManager = L.Class.extend({ initialize: function (map, options) { this._map = map; this._items = []; + this._hiddenItems = 0; this._selected = null; L.setOptions(this, options); this._arrow = L.polyline([], {color: 'darkblue', weight: 1}); @@ -23,10 +24,10 @@ L.AnnotationManager = L.Class.extend({ this._map.on('AnnotationCancel', this._onAnnotationCancel, this); this._map.on('AnnotationClick', this._onAnnotationClick, this); this._map.on('AnnotationReply', this._onAnnotationReply, this); - this._map.on('AnnotationResolve', this._onAnnotationResolve, this); this._map.on('AnnotationSave', this._onAnnotationSave, this); this._map.on('RedlineAccept', this._onRedlineAccept, this); this._map.on('RedlineReject', this._onRedlineReject, this); + this._showResolved = false; }, // Remove only text comments from the document (excluding change tracking comments) @@ -126,6 +127,10 @@ L.AnnotationManager = L.Class.extend({ comment.avatar = this._map._viewInfoByUserName[comment.author].userextrainfo.avatar; } this._items.push(L.annotation(this._map.options.docBounds.getSouthEast(), comment).addTo(this._map)); + this.updateResolvedState(this._items[this._items.length - 1]); + if (this._items[this._items.length - 1]._data.resolved === 'true') { +
[Libreoffice-commits] online.git: loleaflet/css loleaflet/src
loleaflet/css/loleaflet.css |4 +++ loleaflet/src/layer/AnnotationManager.js| 30 loleaflet/src/layer/marker/Annotation.js| 18 loleaflet/src/layer/tile/TileLayer.js |6 + loleaflet/src/layer/tile/WriterTileLayer.js |4 +++ loleaflet/src/unocommands.js|1 6 files changed, 63 insertions(+) New commits: commit 1e82c46bd3ddf0d0fa123f623e6f95802da8327c Author: Scott Clarke AuthorDate: Tue May 14 15:25:43 2019 +0100 Commit: Henry Castro CommitDate: Mon Aug 19 16:42:06 2019 +0200 Add ability to resolve comments Add 'Resolve' button to annotation context menu Add 'Resolved' indicator to comments Change-Id: Ie43e247635a14d3407535e02ec2012f0809d425c Co-authored-by: Jim MacArthur Reviewed-on: https://gerrit.libreoffice.org/76757 Reviewed-by: Henry Castro Tested-by: Henry Castro diff --git a/loleaflet/css/loleaflet.css b/loleaflet/css/loleaflet.css index 08d172546..28675fd2f 100644 --- a/loleaflet/css/loleaflet.css +++ b/loleaflet/css/loleaflet.css @@ -319,6 +319,10 @@ body { height: 18px; } +.loleaflet-annotation-content-resolved { + color: green; +} + .loleaflet-annotation-edit { margin: 3px 3px; line-height: 1.4; diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js index 2217f1db1..fcd0abbd1 100644 --- a/loleaflet/src/layer/AnnotationManager.js +++ b/loleaflet/src/layer/AnnotationManager.js @@ -23,6 +23,7 @@ L.AnnotationManager = L.Class.extend({ this._map.on('AnnotationCancel', this._onAnnotationCancel, this); this._map.on('AnnotationClick', this._onAnnotationClick, this); this._map.on('AnnotationReply', this._onAnnotationReply, this); + this._map.on('AnnotationResolve', this._onAnnotationResolve, this); this._map.on('AnnotationSave', this._onAnnotationSave, this); this._map.on('RedlineAccept', this._onRedlineAccept, this); this._map.on('RedlineReject', this._onRedlineReject, this); @@ -573,6 +574,19 @@ L.AnnotationManager = L.Class.extend({ annotation.focus(); }, + resolve: function (annotation) { + // This is called by WriteTileLayer + var comment = { + Id: { + type: 'string', + value: annotation._data.id + } + }; + this._map.sendUnoCommand('.uno:ResolveComment', comment); + annotation.update(); + this.update(); + }, + remove: function (id) { var comment = { Id: { @@ -733,6 +747,22 @@ L.AnnotationManager = L.Class.extend({ this._map.focus(); }, + _onAnnotationResolve: function (e) { + var comment = { + Id: { + type: 'string', + value: e.annotation._data.id + }, + Text: { + type: 'string', + value: e.annotation._data.reply + } + }; + this._map.sendUnoCommand('.uno:ResolveComment', comment); + this.unselect(); + this._map.focus(); + }, + _onAnnotationSave: function (e) { var comment; if (e.annotation._data.id === 'new') { diff --git a/loleaflet/src/layer/marker/Annotation.js b/loleaflet/src/layer/marker/Annotation.js index 0eedb26a3..a934a5e81 100644 --- a/loleaflet/src/layer/marker/Annotation.js +++ b/loleaflet/src/layer/marker/Annotation.js @@ -190,6 +190,13 @@ L.Annotation = L.Layer.extend({ } this._author = L.DomUtil.create('table', 'loleaflet-annotation-table', wrapper); var tbody = L.DomUtil.create('tbody', empty, this._author); + var rowResolved = L.DomUtil.create('tr', empty, tbody); + var tdResolved = L.DomUtil.create(tagTd, 'loleaflet-annotation-resolved', rowResolved); + var pResolved = L.DomUtil.create(tagDiv, 'loleaflet-annotation-content-resolved', tdResolved); + this._resolved = pResolved; + + this._updateResolvedField(this._data.resolved); + var tr = L.DomUtil.create('tr', empty, tbody); var tdImg = L.DomUtil.create(tagTd, 'loleaflet-annotation-img', tr); var tdAuthor = L.DomUtil.create(tagTd, 'loleaflet-annotation-author', tr); @@ -336,6 +343,11 @@ L.Annotation = L.Layer.extend({ this._map.fire('AnnotationReply', {annotation: this}); }, + _onResolveClick: function (e) { + L.DomEvent.stopPropagation(e); +
[Libreoffice-commits] core.git: sw/source
sw/source/uibase/config/viewopt.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit e7638f15fc945e6de73876949538682b854fdc41 Author: Scott Clarke AuthorDate: Thu Aug 8 13:37:54 2019 +0100 Commit: Samuel Mehrbrodt CommitDate: Wed Aug 14 15:27:28 2019 +0200 Set "Resolved Comments" view option on by default The "Resolved Comments" view option now starts switched on by default to match the fact that resolved comments would be visible when a document was first opened anyway. Change-Id: Ib9c41c57c826f4282d0d6bf0ebcd485aa71ce1d6 Reviewed-on: https://gerrit.libreoffice.org/77189 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/sw/source/uibase/config/viewopt.cxx b/sw/source/uibase/config/viewopt.cxx index 4bfa5bc72333..6059ef5ec8c8 100644 --- a/sw/source/uibase/config/viewopt.cxx +++ b/sw/source/uibase/config/viewopt.cxx @@ -190,6 +190,7 @@ SwViewOption::SwViewOption() : m_nUIOptions = ViewOptFlags2::Modified | ViewOptFlags2::GrfKeepZoom | +ViewOptFlags2::ResolvedPostits | ViewOptFlags2::AnyRuler; if (!utl::ConfigManager::IsFuzzing() && MeasurementSystem::Metric != SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/inc sw/source xmloff/source
sw/inc/fmtfld.hxx|3 ++- sw/source/uibase/docvw/AnnotationWin.cxx | 11 --- sw/source/uibase/docvw/PostItMgr.cxx | 11 --- xmloff/source/text/txtflde.cxx | 24 +--- 4 files changed, 31 insertions(+), 18 deletions(-) New commits: commit 9751b4b4fa00cf5175ccc0f9c52a22b07f73d4aa Author: Scott Clarke AuthorDate: Tue Aug 13 09:54:12 2019 +0100 Commit: Samuel Mehrbrodt CommitDate: Wed Aug 14 15:26:58 2019 +0200 Change some handling for resolved comments Changed the way the lcl_CommentNotification method is called when a comment is resolved such that resolution is distinct from other changes. Resolved flag is now only stored in the top annotation of a thread when saved as ODT. Change-Id: I5ef36718fd7e1dfcc16c077871653a70476e8804 Reviewed-on: https://gerrit.libreoffice.org/77411 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx index d9eafeea82a3..f945bbcc0aa2 100644 --- a/sw/inc/fmtfld.hxx +++ b/sw/inc/fmtfld.hxx @@ -114,7 +114,8 @@ enum class SwFormatFieldHintWhich REMOVED= 2, FOCUS = 3, CHANGED= 4, -LANGUAGE = 5 +LANGUAGE = 5, +RESOLVED = 6 }; class SW_DLLPUBLIC SwFormatFieldHint : public SfxHint diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx index bbb08b24aacd..bedbbedc01a4 100644 --- a/sw/source/uibase/docvw/AnnotationWin.cxx +++ b/sw/source/uibase/docvw/AnnotationWin.cxx @@ -225,6 +225,7 @@ void SwAnnotationWin::SetPostItText() void SwAnnotationWin::SetResolved(bool resolved) { +bool oldState = IsResolved(); static_cast(mpFormatField->GetField())->SetResolved(resolved); const SwViewOption* pVOpt = mrView.GetWrtShellPtr()->GetViewOptions(); mrSidebarItem.bShow = !IsResolved() || (pVOpt->IsResolvedPostIts()); @@ -236,7 +237,8 @@ void SwAnnotationWin::SetResolved(bool resolved) else mpMetadataResolved->Hide(); -mbResolvedStateUpdated = true; +if(IsResolved() != oldState) +mbResolvedStateUpdated = true; UpdateData(); Invalidate(); } @@ -266,7 +268,7 @@ bool SwAnnotationWin::IsThreadResolved() void SwAnnotationWin::UpdateData() { -if ( mpOutliner->IsModified() || mbResolvedStateUpdated) +if ( mpOutliner->IsModified() || mbResolvedStateUpdated ) { IDocumentUndoRedo & rUndoRedo( mrView.GetDocShell()->GetDoc()->GetIDocumentUndoRedo()); @@ -288,7 +290,10 @@ void SwAnnotationWin::UpdateData() // so we get a new layout of notes (anchor position is still the same and we would otherwise not get one) mrMgr.SetLayout(); // #i98686# if we have several views, all notes should update their text -mpFormatField->Broadcast(SwFormatFieldHint( nullptr, SwFormatFieldHintWhich::CHANGED)); +if(mbResolvedStateUpdated) +mpFormatField->Broadcast(SwFormatFieldHint( nullptr, SwFormatFieldHintWhich::RESOLVED)); +else +mpFormatField->Broadcast(SwFormatFieldHint( nullptr, SwFormatFieldHintWhich::CHANGED)); mrView.GetDocShell()->SetModified(); } mpOutliner->ClearModifyFlag(); diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 5d47f59200ed..9e0fc941984a 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -104,7 +104,7 @@ using namespace sw::annotation; namespace { -enum class CommentNotificationType { Add, Remove, Modify }; +enum class CommentNotificationType { Add, Remove, Modify, Resolve }; bool comp_pos(const std::unique_ptr& a, const std::unique_ptr& b) { @@ -147,7 +147,8 @@ namespace { boost::property_tree::ptree aAnnotation; aAnnotation.put("action", (nType == CommentNotificationType::Add ? "Add" : (nType == CommentNotificationType::Remove ? "Remove" : -(nType == CommentNotificationType::Modify ? "Modify" : "???"; +(nType == CommentNotificationType::Modify ? "Modify" : + (nType == CommentNotificationType::Resolve ? "Resolve" : "???"); aAnnotation.put("id", nPostItId); if (nType != CommentNotificationType::Remove && pItem != nullptr) { @@ -399,6 +400,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) break; } case SwFormatFieldHintWhich::CHANGED: +case SwFormatFieldHintWhich::RESOLVED: { SwFormatField* pFormatField = dynamic_cast(); for (auto const& postItField : mvPostItFields) @@ -414,7 +416,10 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) // If LOK has
[Libreoffice-commits] core.git: sw/qa
sw/qa/extras/odfexport/data/resolved-comment.odt |binary sw/qa/extras/odfexport/odfexport.cxx | 14 ++ 2 files changed, 14 insertions(+) New commits: commit 0fbd3fcebf877ba25343443806e0d75f67c2d7b7 Author: Scott Clarke AuthorDate: Thu Aug 8 13:40:18 2019 +0100 Commit: Miklos Vajna CommitDate: Mon Aug 12 15:27:29 2019 +0200 Add test for resolved comments in odfexport Change-Id: I069d84b1e6b80731c5d13a1f8b06f4ed9df0844a Reviewed-on: https://gerrit.libreoffice.org/77153 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/qa/extras/odfexport/data/resolved-comment.odt b/sw/qa/extras/odfexport/data/resolved-comment.odt new file mode 100644 index ..e136cac3d825 Binary files /dev/null and b/sw/qa/extras/odfexport/data/resolved-comment.odt differ diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 99d6d8059c59..7d1f2debc760 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -491,6 +491,20 @@ DECLARE_ODFEXPORT_TEST(testSenderInitials, "sender-initials.fodt") } } +#ifndef WNT +DECLARE_ODFEXPORT_TEST(testResolvedComment, "resolved-comment.odt") +{ +// TODO find out why does this break testFdo58949 on Windows. +uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); +uno::Reference xFields(xFieldsAccess->createEnumeration()); +uno::Reference xPropertySet(xFields->nextElement(), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(true, getProperty(xPropertySet, "Resolved")); +xPropertySet.set(xFields->nextElement(), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(false, getProperty(xPropertySet, "Resolved")); +} +#endif + DECLARE_ODFEXPORT_TEST(testTdf92379, "tdf92379.fodt") { // frame style fo:background-color was not imported ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: officecfg/registry svx/sdi sw/inc sw/sdi sw/source sw/uiconfig
officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu | 11 svx/sdi/svx.sdi | 16 ++ sw/inc/PostItMgr.hxx|1 sw/inc/viewopt.hxx | 11 +++- sw/sdi/_viewsh.sdi |8 +++ sw/source/uibase/docvw/AnnotationWin.cxx|6 ++ sw/source/uibase/docvw/PostItMgr.cxx| 15 ++ sw/source/uibase/uiview/view0.cxx | 25 +- sw/uiconfig/swriter/menubar/menubar.xml |1 sw/uiconfig/swriter/ui/viewoptionspage.ui | 22 sw/uiconfig/swxform/menubar/menubar.xml |1 11 files changed, 111 insertions(+), 6 deletions(-) New commits: commit fb3a0b084701ee1089a76568b3b110ac5b0df460 Author: Scott Clarke AuthorDate: Tue Jun 11 13:07:20 2019 +0100 Commit: Samuel Mehrbrodt CommitDate: Thu Aug 8 08:05:17 2019 +0200 tdf#119228 Add 'Resolved Comments' option to the View menu. Change-Id: Ib4554b77857992959a386c71e99e424579196ded Co-authored-by: Jim MacArthur Reviewed-on: https://gerrit.libreoffice.org/75862 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu index f17b8f122128..8d070ffcb6af 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu @@ -2554,6 +2554,17 @@ 1 + + + Show resolved comme~nts + + + Resolved Comments + + + 1 + + View Images and Charts diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 22912965caa5..787a0e237839 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -4531,6 +4531,22 @@ SfxVoidItem ShowAnnotations SID_TOGGLE_NOTES GroupId = SfxGroupId::View; ] +SfxVoidItem ShowResolvedAnnotations SID_TOGGLE_RESOLVED_NOTES +() +[ +AutoUpdate = FALSE, +FastCall = FALSE, +ReadOnlyDoc = TRUE, +Toggle = FALSE, +Container = FALSE, +RecordAbsolute = FALSE, +RecordPerSet; + +AccelConfig = TRUE, +MenuConfig = TRUE, +ToolBoxConfig = TRUE, +GroupId = SfxGroupId::View; +] SfxVoidItem ReplyToAnnotation SID_REPLYTO_POSTIT diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx index f51aa04723fc..89edc53e62f4 100644 --- a/sw/inc/PostItMgr.hxx +++ b/sw/inc/PostItMgr.hxx @@ -214,6 +214,7 @@ class SAL_DLLPUBLIC_RTTI SwPostItMgr: public SfxListener void Hide(); void Show(); void UpdateResolvedStatus(sw::annotation::SwAnnotationWin* topNote); +void ShowHideResolvedNotes(bool visible); void Rescale(); diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx index 05f70f2d2aa6..19eb9d546595 100644 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -91,10 +91,11 @@ enum class ViewOptFlags2 { ScrollbarTips = 0x0040, PrintFormat = 0x0080, ShadowCursor= 0x0100, -VRulerRight = 0x0200 +VRulerRight = 0x0200, +ResolvedPostits = 0x0400, }; namespace o3tl { -template<> struct typed_flags : is_typed_flags {}; +template<> struct typed_flags : is_typed_flags {}; }; // Table background. @@ -256,6 +257,12 @@ public: { return bool(m_nCoreOptions & ViewOptFlags1::Postits); } void SetPostIts( bool b ) { SetCoreOption(b, ViewOptFlags1::Postits); } + +bool IsResolvedPostIts() const +{ return bool(m_nUIOptions & ViewOptFlags2::ResolvedPostits); } +void SetResolvedPostIts( bool b ) +{ SetUIOption(b, ViewOptFlags2::ResolvedPostits); } + static void PaintPostIts( OutputDevice *pOut, const SwRect , bool bIsScript ); static sal_uInt16 GetPostItsWidth( const OutputDevice *pOut ); diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi index 43425fc9e6ca..5c4a6234efe9 100644 --- a/sw/sdi/_viewsh.sdi +++ b/sw/sdi/_viewsh.sdi @@ -801,6 +801,14 @@ interface BaseTextEditView StateMethod = StateViewOptions ; Export = FALSE; ] + +SID_TOGGLE_RESOLVED_NOTES +[ +ExecMethod = ExecViewOptions ; +StateMethod = StateViewOptions ; +Export = FALSE; +] + // Everything from here can be removed (Export = FALSE;), if the previous works FN_RULER // status() [ diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx index 34854f4d421b..bbb08b24aacd 100644 --- a/sw/source/uibase/docvw/AnnotationWin.cxx +++
[Libreoffice-commits] core.git: officecfg/registry sfx2/source sw/inc sw/sdi sw/source sw/uiconfig
officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |8 sfx2/source/control/unoctitm.cxx |1 sw/inc/cmdid.h |1 sw/sdi/_annotsh.sdi |6 +++ sw/sdi/_textsh.sdi |5 ++ sw/sdi/swriter.sdi | 17 ++ sw/source/uibase/docvw/AnnotationMenuButton.cxx |6 +++ sw/source/uibase/docvw/AnnotationWin2.cxx|8 sw/source/uibase/shells/annotsh.cxx | 16 - sw/source/uibase/shells/textfld.cxx |9 + sw/uiconfig/sglobal/menubar/menubar.xml |1 sw/uiconfig/sglobal/popupmenu/annotation.xml |1 sw/uiconfig/swriter/menubar/menubar.xml |1 sw/uiconfig/swriter/popupmenu/annotation.xml |1 sw/uiconfig/swriter/ui/annotationmenu.ui | 16 + sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui|7 16 files changed, 102 insertions(+), 2 deletions(-) New commits: commit 6986ebd4a0020e515a115acbe7f1f738a4fd83f4 Author: Scott Clarke AuthorDate: Wed Jun 19 16:29:54 2019 +0100 Commit: Miklos Vajna CommitDate: Wed Aug 7 09:44:10 2019 +0200 tdf#119228 Add UI elements to resolve and unresolve comments Change-Id: I22403299d034a638724077744070b3add64cacf2 Co-authored-by: Jim MacArthur Reviewed-on: https://gerrit.libreoffice.org/75861 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index d3f803d91024..0dd6c5173768 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -6352,6 +6352,14 @@ 1 + + + Resolved + + + 1 + + Top diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index a321248cdc9b..9588ff61d551 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1058,6 +1058,7 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c aEvent.FeatureURL.Path == "SelectAll" || aEvent.FeatureURL.Path == "InsertAnnotation" || aEvent.FeatureURL.Path == "DeleteAnnotation" || + aEvent.FeatureURL.Path == "ResolveAnnotation" || aEvent.FeatureURL.Path == "InsertRowsBefore" || aEvent.FeatureURL.Path == "InsertRowsAfter" || aEvent.FeatureURL.Path == "InsertColumnsBefore" || diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index e442239e8fd2..e45451022819 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -729,6 +729,7 @@ #define FN_DELETE_COMMENT (FN_NOTES+6) #define FN_REPLY(FN_NOTES+7) #define FN_FORMAT_ALL_NOTES (FN_NOTES+8) +#define FN_RESOLVE_NOTE (FN_NOTES+9) // Region: Parameter #define FN_PARAM_MOVE_COUNT (FN_PARAM+2) diff --git a/sw/sdi/_annotsh.sdi b/sw/sdi/_annotsh.sdi index 323d5d06b8b1..84f3aed0b007 100644 --- a/sw/sdi/_annotsh.sdi +++ b/sw/sdi/_annotsh.sdi @@ -60,6 +60,12 @@ interface _Annotation StateMethod = GetNoteState ; ] +FN_RESOLVE_NOTE +[ +ExecMethod = NoteExec ; +StateMethod = GetNoteState ; +] + FN_POSTIT [ ExecMethod = NoteExec ; diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi index 9abad60e8197..3d7bbd56b32e 100644 --- a/sw/sdi/_textsh.sdi +++ b/sw/sdi/_textsh.sdi @@ -957,6 +957,11 @@ interface BaseText ExecMethod = ExecField ; StateMethod = StateField; ] +FN_RESOLVE_NOTE +[ +ExecMethod = ExecField ; +StateMethod = StateField; +] FN_DELETE_NOTE_AUTHOR [ ExecMethod = ExecField ; diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi index 02bdbd961d4c..bb5d67ce161b 100644 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -7066,6 +7066,23 @@ SfxVoidItem DeleteComment FN_DELETE_COMMENT GroupId = SfxGroupId::Edit; ] +SfxVoidItem ResolveComment FN_RESOLVE_NOTE +(SvxPostItIdItem Id SID_ATTR_POSTIT_ID) +[ +AutoUpdate = FALSE, +FastCall = FALSE, +ReadOnlyDoc = FALSE, +Toggle = FALSE, +Container = FALSE, +RecordAbsolute = FALSE, +RecordPerSet; + +AccelConfig = TRUE, +MenuConfig = TRUE, +ToolBoxConfig = TRUE, +GroupId = SfxGroupId::Edit; +] + SfxStringItem DeleteAuthor
[Libreoffice-commits] core.git: sw/inc sw/source
sw/inc/AnnotationWin.hxx |2 sw/inc/strings.hrc|1 sw/source/uibase/docvw/AnnotationWin.cxx | 11 + sw/source/uibase/docvw/AnnotationWin2.cxx | 64 +++--- 4 files changed, 72 insertions(+), 6 deletions(-) New commits: commit 7ade0c7d03594bfa5c067f32230a1e4ed93d7fbb Author: Scott Clarke AuthorDate: Wed Jun 19 16:30:35 2019 +0100 Commit: Miklos Vajna CommitDate: Wed Aug 7 09:42:40 2019 +0200 tdf#119228 Add UI elements to display the resolved state Change-Id: I3ba1572771bc893d2c74993a161d00c2acc70960 Co-authored-by: Jim MacArthur Reviewed-on: https://gerrit.libreoffice.org/75860 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx index 196aa1d6dc18..2af2d9e56b37 100644 --- a/sw/inc/AnnotationWin.hxx +++ b/sw/inc/AnnotationWin.hxx @@ -157,6 +157,7 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin : public vcl::Window sal_Int32 GetMinimumSizeWithoutMeta(); sal_Int32 GetMetaButtonAreaWidth(); sal_Int32 GetScrollbarWidth(); +sal_Int32 GetNumFields(); voidSetSpellChecking(); @@ -230,6 +231,7 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin : public vcl::Window VclPtr mpVScrollbar; VclPtr mpMetadataAuthor; VclPtr mpMetadataDate; +VclPtr mpMetadataResolved; VclPtr mpMenuButton; std::unique_ptr mpAnchor; diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index 33778069c4fa..59bab4121472 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -565,6 +565,7 @@ #define STR_ACCESS_PAGE_DESCNC_("STR_ACCESS_PAGE_DESC", "Page: $(ARG1)") #define STR_ACCESS_ANNOTATION_AUTHOR_NAME NC_("STR_ACCESS_ANNOTATION_AUTHOR_NAME", "Author") #define STR_ACCESS_ANNOTATION_DATE_NAME NC_("STR_ACCESS_ANNOTATION_DATE_NAME", "Date") +#define STR_ACCESS_ANNOTATION_RESOLVED_NAME NC_("STR_ACCESS_ANNOTATION_RESOLVED_NAME", "Resolved") #define STR_ACCESS_ANNOTATION_BUTTON_NAME NC_("STR_ACCESS_ANNOTATION_BUTTON_NAME", "Actions") #define STR_ACCESS_ANNOTATION_BUTTON_DESC NC_("STR_ACCESS_ANNOTATION_BUTTON_DESC", "Activate this button to open a list of actions which can be performed on this comment and other comments") #define STR_ACCESS_PREVIEW_DOC_NAME NC_("STR_ACCESS_PREVIEW_DOC_NAME", "Document preview") diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx index b270c06ec65a..34854f4d421b 100644 --- a/sw/source/uibase/docvw/AnnotationWin.cxx +++ b/sw/source/uibase/docvw/AnnotationWin.cxx @@ -152,6 +152,12 @@ void SwAnnotationWin::dispose() } mpMetadataAuthor.disposeAndClear(); +if (mpMetadataResolved) +{ +mpMetadataResolved->RemoveEventListener( LINK( this, SwAnnotationWin, WindowEventListener ) ); +} +mpMetadataResolved.disposeAndClear(); + if (mpMetadataDate) { mpMetadataDate->RemoveEventListener( LINK( this, SwAnnotationWin, WindowEventListener ) ); @@ -221,6 +227,11 @@ void SwAnnotationWin::SetResolved(bool resolved) static_cast(mpFormatField->GetField())->SetResolved(resolved); mrSidebarItem.bShow = !IsResolved(); +if(IsResolved()) +mpMetadataResolved->Show(); +else +mpMetadataResolved->Hide(); + mbResolvedStateUpdated = true; UpdateData(); Invalidate(); diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index 232bfd80c124..33edbdfacc81 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -158,7 +158,7 @@ namespace sw { namespace annotation { #define METABUTTON_WIDTH16 #define METABUTTON_HEIGHT 18 #define METABUTTON_AREA_WIDTH 30 -#define POSTIT_META_HEIGHT sal_Int32(30) +#define POSTIT_META_FIELD_HEIGHT sal_Int32(15) #define POSTIT_MINIMUMSIZE_WITHOUT_META 50 @@ -178,11 +178,13 @@ void SwAnnotationWin::Paint(vcl::RenderContext& rRenderContext, const tools::Rec rRenderContext.SetFillColor(mColorDark); } +sal_uInt32 boxHeight = mpMetadataAuthor->GetSizePixel().Height() + mpMetadataDate->GetSizePixel().Height(); +boxHeight += IsThreadResolved() ? mpMetadataResolved->GetSizePixel().Height() : 0; + rRenderContext.SetLineColor(); tools::Rectangle aRectangle(Point(mpMetadataAuthor->GetPosPixel().X() + mpMetadataAuthor->GetSizePixel().Width(), mpMetadataAuthor->GetPosPixel().Y()), - Size(GetMetaButtonAreaWidth(), - mpMetadataAuthor->GetSizePixel().Height() + mpMetadataDate->GetSizePixel().Height())); + Size(GetMetaButtonAreaWidth(), boxHeight)); if
[Libreoffice-commits] core.git: sw/inc sw/source
sw/inc/AnnotationWin.hxx | 17 +--- sw/inc/PostItMgr.hxx |3 ++ sw/source/uibase/docvw/AnnotationWin.cxx | 37 ++- sw/source/uibase/docvw/PostItMgr.cxx | 42 +++ 4 files changed, 94 insertions(+), 5 deletions(-) New commits: commit f4f5e3f98aee5d9d1679edab8248a4cfd12f74ce Author: Scott Clarke AuthorDate: Wed Jun 19 17:12:22 2019 +0100 Commit: Samuel Mehrbrodt CommitDate: Tue Aug 6 07:28:42 2019 +0200 tdf#119228 Add accessors for resolved state Change-Id: Ic4051f4e7fda11eade1e50ce70bed11f70f0742d Co-authored-by: Jim MacArthur Reviewed-on: https://gerrit.libreoffice.org/75859 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx index 6002ac615660..196aa1d6dc18 100644 --- a/sw/inc/AnnotationWin.hxx +++ b/sw/inc/AnnotationWin.hxx @@ -189,6 +189,17 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin : public vcl::Window /// Allows adjusting the point or mark of the selection to a document coordinate. void SetCursorLogicPosition(const Point& rPosition, bool bPoint, bool bClearMark); +// Various access functions for 'resolved' status +void SetResolved(bool resolved); +void ToggleResolved(); +void ToggleResolvedForThread(); +bool IsResolved() const; +bool IsThreadResolved(); + +/// Find the first annotation for the thread which this annotation is in. +/// This may be the same annotation as this one. +SwAnnotationWin* GetTopReplyNote(); + private: VclPtr CreateMenuButton(); virtual voidLoseFocus() override; @@ -204,10 +215,6 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin : public vcl::Window sal_uInt32 CountFollowing(); -/// Find the first annotation for the thread which this annotation is in. -/// This may be the same annotation as this one. -SwAnnotationWin* GetTopReplyNote(); - SvxLanguageItem GetLanguage(); VclBuilder maBuilder; @@ -241,6 +248,8 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin : public vcl::Window longmPageBorder; boolmbAnchorRectChanged; +boolmbResolvedStateUpdated; + std::vector maAnnotationTextRanges; boolmbMouseOver; diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx index 19ba52b7aa18..f51aa04723fc 100644 --- a/sw/inc/PostItMgr.hxx +++ b/sw/inc/PostItMgr.hxx @@ -204,6 +204,8 @@ class SAL_DLLPUBLIC_RTTI SwPostItMgr: public SfxListener void Delete(const OUString& aAuthor); void Delete(sal_uInt32 nPostItId); void Delete(); +void ToggleResolved(sal_uInt32 nPostItId); +void ToggleResolvedForThread(sal_uInt32 nPostItId); void ExecuteFormatAllDialog(SwView& rView); void FormatAll(const SfxItemSet ); @@ -211,6 +213,7 @@ class SAL_DLLPUBLIC_RTTI SwPostItMgr: public SfxListener void Hide( const OUString& rAuthor ); void Hide(); void Show(); +void UpdateResolvedStatus(sw::annotation::SwAnnotationWin* topNote); void Rescale(); diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx index fa4284ab393a..b270c06ec65a 100644 --- a/sw/source/uibase/docvw/AnnotationWin.cxx +++ b/sw/source/uibase/docvw/AnnotationWin.cxx @@ -89,6 +89,7 @@ SwAnnotationWin::SwAnnotationWin( SwEditWin& rEditWin, , mAnchorRect() , mPageBorder(0) , mbAnchorRectChanged(false) +, mbResolvedStateUpdated(false) , mbMouseOver(false) , mLayoutStatus(SwPostItHelper::INVISIBLE) , mbReadonly(false) @@ -215,9 +216,42 @@ void SwAnnotationWin::SetPostItText() Invalidate(); } +void SwAnnotationWin::SetResolved(bool resolved) +{ + static_cast(mpFormatField->GetField())->SetResolved(resolved); +mrSidebarItem.bShow = !IsResolved(); + +mbResolvedStateUpdated = true; +UpdateData(); +Invalidate(); +} + +void SwAnnotationWin::ToggleResolved() +{ +SetResolved(!IsResolved()); +} + +void SwAnnotationWin::ToggleResolvedForThread() +{ +GetTopReplyNote()->ToggleResolved(); +mrMgr.UpdateResolvedStatus(GetTopReplyNote()); +mrMgr.LayoutPostIts(); +} + +bool SwAnnotationWin::IsResolved() const +{ +return static_cast(mpFormatField->GetField())->GetResolved(); +} + +bool SwAnnotationWin::IsThreadResolved() +{ +// Not const because GetTopReplyNote isn't. +return GetTopReplyNote()->IsResolved(); +} + void SwAnnotationWin::UpdateData() { -if ( mpOutliner->IsModified() ) +if ( mpOutliner->IsModified() || mbResolvedStateUpdated) { IDocumentUndoRedo & rUndoRedo( mrView.GetDocShell()->GetDoc()->GetIDocumentUndoRedo()); @@ -244,6 +278,7 @@ void SwAnnotationWin::UpdateData() }
[Libreoffice-commits] core.git: desktop/source include/svx include/xmloff schema/libreoffice sw/inc sw/source xmloff/inc xmloff/source
desktop/source/lib/init.cxx |1 include/svx/svxids.hrc |3 - include/xmloff/txtimp.hxx |1 include/xmloff/xmltoken.hxx |2 schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng | 18 +++ sw/inc/docufld.hxx |6 ++ sw/inc/unoprnms.hxx |2 sw/source/core/fields/docufld.cxx | 28 +++- sw/source/core/unocore/unofield.cxx |4 + sw/source/core/unocore/unomap.cxx |1 sw/source/uibase/docvw/PostItMgr.cxx|1 sw/source/uibase/uno/unotxdoc.cxx |1 xmloff/inc/txtfldi.hxx |1 xmloff/source/core/xmltoken.cxx |3 + xmloff/source/text/txtflde.cxx | 12 + xmloff/source/text/txtfldi.cxx |7 +++ xmloff/source/text/txtimp.cxx |1 xmloff/source/token/tokens.txt |1 18 files changed, 89 insertions(+), 4 deletions(-) New commits: commit d2025bdc33cc8d9e2f6c9f90da4574275ed6b0e4 Author: Scott Clarke AuthorDate: Fri Jun 7 15:28:42 2019 +0100 Commit: Michael Stahl CommitDate: Thu Jul 25 10:38:36 2019 +0200 tdf#119228 Add storage and serialisation for the Resolved flag Change-Id: I0278588dc533378104e544d05b60583c85271f6a Co-authored-by: Jim MacArthur Reviewed-on: https://gerrit.libreoffice.org/75858 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 157ca969660e..a1487e3790da 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2137,6 +2137,7 @@ static void doc_iniUnoCommands () OUString(".uno:InsertAnnotation"), OUString(".uno:DeleteAnnotation"), OUString(".uno:ReplyComment"), +OUString(".uno:ResolveComment"), OUString(".uno:InsertRowsBefore"), OUString(".uno:InsertRowsAfter"), OUString(".uno:InsertColumnsBefore"), diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index 75616d40e128..bbca92682819 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -980,9 +980,10 @@ class SvxSetItem; #define SID_TABLE_CELL_BACKGROUND_COLOR TypedWhichId( SID_SVX_START + 1189 ) +#define SID_TOGGLE_RESOLVED_NOTES ( SID_SVX_START + 1190 ) // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id -#define SID_SVX_FIRSTFREE ( SID_SVX_START + 1189 + 1 ) +#define SID_SVX_FIRSTFREE ( SID_SVX_START + 1190 + 1 ) // Overflow check for slot IDs #if SID_SVX_FIRSTFREE > SID_SVX_END diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx index 596d09352b82..df20f5dfda0d 100644 --- a/include/xmloff/txtimp.hxx +++ b/include/xmloff/txtimp.hxx @@ -209,6 +209,7 @@ enum XMLTextPElemTokens XML_TOK_TEXT_ANNOTATION, XML_TOK_TEXT_ANNOTATION_END, XML_TOK_TEXT_NAME, +XML_TOK_TEXT_RESOLVED, XML_TOK_TEXT_SCRIPT, XML_TOK_TEXT_TABLE_FORMULA, XML_TOK_TEXT_DROP_DOWN, diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index 69ef7e889455..83ebc3395ebb 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -3350,6 +3350,8 @@ namespace xmloff { namespace token { // tdf#115007 XML_TRANSLITERATION_SPELLOUT, +XML_RESOLVED, + XML_TOKEN_END }; diff --git a/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng b/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng index e5a0116bd029..8e78fa6211f9 100644 --- a/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng +++ b/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng @@ -965,6 +965,24 @@ xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1. + + + + + + + + + + + + + + + + + + diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx index bdd7fd68756f..abdfe644a798 100644 --- a/sw/inc/docufld.hxx +++ b/sw/inc/docufld.hxx @@ -445,6 +445,7 @@ class SW_DLLPUBLIC SwPostItField : public SwField OUString m_sInitials; ///< Initials of the author. OUString m_sName; ///< Name of the comment. DateTimem_aDateTime; +bool m_bResolved; std::unique_ptr mpText; rtl::Reference m_xTextObject; sal_uInt32 m_nPostItId; @@ -458,6 +459,7 @@ public: const OUString& rInitials,