include/sfx2/viewsh.hxx              |    4 +++-
 sfx2/source/view/viewsh.cxx          |   23 ++++++++++++++++-------
 sw/inc/pch/precompiled_msword.hxx    |   18 +++++++++++++++---
 sw/inc/pch/precompiled_sw.hxx        |   32 +++++++++++++++++++++++---------
 sw/inc/pch/precompiled_swui.hxx      |   28 +++++++++++++++-------------
 sw/inc/pch/precompiled_vbaswobj.hxx  |   17 ++++++++++++-----
 sw/source/uibase/docvw/edtwin.cxx    |   21 +++++++++++++--------
 sw/source/uibase/inc/uitool.hxx      |    5 ++---
 sw/source/uibase/uiview/viewling.cxx |   14 ++++++++------
 sw/source/uibase/utlui/uitool.cxx    |   14 ++++++++------
 10 files changed, 115 insertions(+), 61 deletions(-)

New commits:
commit 277a5ac359801712d4b8448ae096d45a6522228b
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sat Dec 11 13:00:44 2021 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sat Dec 11 15:25:18 2021 +0100

    update sw pches
    
    Change-Id: I61fe51e95c629adcf90a9ea3d1783380039fdd5e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126661
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/inc/pch/precompiled_msword.hxx 
b/sw/inc/pch/precompiled_msword.hxx
index 7f54a5ed9d5d..285828858c8b 100644
--- a/sw/inc/pch/precompiled_msword.hxx
+++ b/sw/inc/pch/precompiled_msword.hxx
@@ -13,7 +13,7 @@
  manual changes will be rewritten by the next run of update_pch.sh (which 
presumably
  also fixes all possible problems, so it's usually better to use it).
 
- Generated on 2021-09-28 05:48:51 using:
+ Generated on 2021-12-11 12:58:53 using:
  ./bin/update_pch sw msword --cutoff=4 --exclude:system --include:module 
--include:local
 
  If after updating build fails, use the following command to locate 
conflicting headers:
@@ -47,6 +47,7 @@
 #include <memory>
 #include <mutex>
 #include <new>
+#include <numeric>
 #include <optional>
 #include <ostream>
 #include <set>
@@ -139,6 +140,7 @@
 #include <vcl/mapmod.hxx>
 #include <vcl/metaactiontypes.hxx>
 #include <vcl/outdev.hxx>
+#include <vcl/ptrstyle.hxx>
 #include <vcl/region.hxx>
 #include <vcl/rendercontext/AddFontSubstituteFlags.hxx>
 #include <vcl/rendercontext/AntialiasingFlags.hxx>
@@ -216,6 +218,7 @@
 #include <com/sun/star/container/XEnumeration.hpp>
 #include <com/sun/star/container/XEnumerationAccess.hpp>
 #include <com/sun/star/container/XIndexReplace.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
 #include <com/sun/star/container/XNameContainer.hpp>
 #include <com/sun/star/datatransfer/XTransferable.hpp>
 #include <com/sun/star/document/EventObject.hpp>
@@ -256,12 +259,14 @@
 #include <com/sun/star/i18n/reservedWords.hpp>
 #include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/lang/EventObject.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
 #include <com/sun/star/lang/Locale.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/lang/XTypeProvider.hpp>
 #include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
+#include <com/sun/star/style/LineSpacing.hpp>
 #include <com/sun/star/style/NumberingType.hpp>
 #include <com/sun/star/style/ParagraphAdjust.hpp>
 #include <com/sun/star/style/TabAlign.hpp>
@@ -271,7 +276,6 @@
 #include <com/sun/star/text/textfield/Type.hpp>
 #include <com/sun/star/uno/Any.h>
 #include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Exception.hpp>
 #include <com/sun/star/uno/Reference.h>
 #include <com/sun/star/uno/Reference.hxx>
 #include <com/sun/star/uno/RuntimeException.hpp>
@@ -281,6 +285,7 @@
 #include <com/sun/star/uno/Type.hxx>
 #include <com/sun/star/uno/TypeClass.hdl>
 #include <com/sun/star/uno/XAggregation.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
 #include <com/sun/star/uno/XInterface.hpp>
 #include <com/sun/star/uno/XWeak.hpp>
 #include <com/sun/star/uno/genfunc.h>
@@ -368,14 +373,17 @@
 #include <i18nlangtag/languagetag.hxx>
 #include <i18nutil/transliteration.hxx>
 #include <o3tl/cow_wrapper.hxx>
+#include <o3tl/deleter.hxx>
 #include <o3tl/enumarray.hxx>
 #include <o3tl/safeint.hxx>
 #include <o3tl/sorted_vector.hxx>
+#include <o3tl/span.hxx>
 #include <o3tl/strong_int.hxx>
 #include <o3tl/typed_flags_set.hxx>
 #include <o3tl/underlyingenumvalue.hxx>
 #include <o3tl/unit_conversion.hxx>
-#include <ooo/vba/word/WdSaveFormat.hpp>
+#include <ooo/vba/XHelperInterface.hpp>
+#include <ooo/vba/word/XParagraphFormat.hpp>
 #include <oox/dllapi.h>
 #include <oox/drawingml/drawingmltypes.hxx>
 #include <oox/export/utils.hxx>
@@ -526,6 +534,9 @@
 #include <unotools/transliterationwrapper.hxx>
 #include <unotools/ucbstreamhelper.hxx>
 #include <unotools/unotoolsdllapi.h>
+#include <vbahelper/vbadllapi.h>
+#include <vbahelper/vbahelper.hxx>
+#include <vbahelper/vbahelperinterface.hxx>
 #endif // PCH_LEVEL >= 3
 #if PCH_LEVEL >= 4
 #include <BorderCacheOwner.hxx>
@@ -584,6 +595,7 @@
 #include <ndtxt.hxx>
 #include <ndtyp.hxx>
 #include <node.hxx>
+#include <nodeoffset.hxx>
 #include <numrule.hxx>
 #include <pagedesc.hxx>
 #include <pam.hxx>
diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx
index a85fb672873a..7955c0a50a0c 100644
--- a/sw/inc/pch/precompiled_sw.hxx
+++ b/sw/inc/pch/precompiled_sw.hxx
@@ -13,7 +13,7 @@
  manual changes will be rewritten by the next run of update_pch.sh (which 
presumably
  also fixes all possible problems, so it's usually better to use it).
 
- Generated on 2021-04-08 13:52:12 using:
+ Generated on 2021-12-11 12:59:04 using:
  ./bin/update_pch sw sw --cutoff=7 --exclude:system --exclude:module 
--include:local
 
  If after updating build fails, use the following command to locate 
conflicting headers:
@@ -35,7 +35,9 @@
 #include <limits>
 #include <map>
 #include <memory>
+#include <mutex>
 #include <new>
+#include <numeric>
 #include <optional>
 #include <ostream>
 #include <set>
@@ -50,6 +52,12 @@
 #include <utility>
 #include <vector>
 #include <boost/circular_buffer.hpp>
+#include <boost/multi_index/composite_key.hpp>
+#include <boost/multi_index/identity.hpp>
+#include <boost/multi_index/mem_fun.hpp>
+#include <boost/multi_index/ordered_index.hpp>
+#include <boost/multi_index/random_access_index.hpp>
+#include <boost/multi_index_container.hpp>
 #include <boost/property_tree/json_parser.hpp>
 #include <boost/property_tree/ptree_fwd.hpp>
 #endif // PCH_LEVEL >= 1
@@ -57,10 +65,8 @@
 #include <osl/conditn.hxx>
 #include <osl/diagnose.h>
 #include <osl/diagnose.hxx>
-#include <osl/doublecheckedlocking.h>
 #include <osl/endian.h>
 #include <osl/file.hxx>
-#include <osl/getglobalmutex.hxx>
 #include <osl/interlck.h>
 #include <osl/module.hxx>
 #include <osl/mutex.hxx>
@@ -77,9 +83,11 @@
 #include <rtl/stringconcat.hxx>
 #include <rtl/stringutils.hxx>
 #include <rtl/tencinfo.h>
+#include <rtl/textcvt.h>
 #include <rtl/textenc.h>
 #include <rtl/uri.hxx>
 #include <rtl/ustrbuf.hxx>
+#include <rtl/ustring.h>
 #include <rtl/ustring.hxx>
 #include <sal/backtrace.hxx>
 #include <sal/detail/log.h>
@@ -148,6 +156,7 @@
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/container/XChild.hpp>
 #include <com/sun/star/container/XEnumeration.hpp>
 #include <com/sun/star/container/XNameContainer.hpp>
 #include <com/sun/star/container/XNamed.hpp>
@@ -192,7 +201,6 @@
 #include <com/sun/star/text/XTextRange.hpp>
 #include <com/sun/star/uno/Any.h>
 #include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Exception.hpp>
 #include <com/sun/star/uno/Reference.h>
 #include <com/sun/star/uno/Reference.hxx>
 #include <com/sun/star/uno/RuntimeException.hpp>
@@ -204,15 +212,15 @@
 #include <com/sun/star/uno/XWeak.hpp>
 #include <com/sun/star/util/Date.hpp>
 #include <com/sun/star/util/Time.hpp>
-#include <com/sun/star/util/XAccounting.hpp>
 #include <com/sun/star/xml/sax/XFastContextHandler.hpp>
 #include <comphelper/classids.hxx>
 #include <comphelper/comphelperdllapi.h>
 #include <comphelper/fileformat.h>
-#include <comphelper/interfacecontainer2.hxx>
+#include <comphelper/interfacecontainer3.hxx>
 #include <comphelper/lok.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/propertysequence.hxx>
+#include <comphelper/propertyvalue.hxx>
 #include <comphelper/scopeguard.hxx>
 #include <comphelper/sequence.hxx>
 #include <comphelper/servicehelper.hxx>
@@ -221,7 +229,6 @@
 #include <comphelper/weak.hxx>
 #include <cppu/cppudllapi.h>
 #include <cppu/unotype.hxx>
-#include <cppuhelper/basemutex.hxx>
 #include <cppuhelper/compbase.hxx>
 #include <cppuhelper/compbase_ex.hxx>
 #include <cppuhelper/cppuhelperdllapi.h>
@@ -231,7 +238,7 @@
 #include <cppuhelper/typeprovider.hxx>
 #include <cppuhelper/weak.hxx>
 #include <drawinglayer/drawinglayerdllapi.h>
-#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
+#include <drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx>
 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
 #include <drawinglayer/processor2d/baseprocessor2d.hxx>
 #include <editeng/acorrcfg.hxx>
@@ -266,6 +273,7 @@
 #include <editeng/paperinf.hxx>
 #include <editeng/pbinitem.hxx>
 #include <editeng/postitem.hxx>
+#include <editeng/prntitem.hxx>
 #include <editeng/protitem.hxx>
 #include <editeng/shaditem.hxx>
 #include <editeng/sizeitem.hxx>
@@ -291,6 +299,7 @@
 #include <o3tl/strong_int.hxx>
 #include <o3tl/typed_flags_set.hxx>
 #include <o3tl/underlyingenumvalue.hxx>
+#include <o3tl/unit_conversion.hxx>
 #include <officecfg/Office/Common.hxx>
 #include <salhelper/salhelperdllapi.h>
 #include <salhelper/simplereferenceobject.hxx>
@@ -339,8 +348,10 @@
 #include <svl/lstner.hxx>
 #include <svl/macitem.hxx>
 #include <svl/metitem.hxx>
+#include <svl/numformat.hxx>
 #include <svl/poolitem.hxx>
 #include <svl/ptitem.hxx>
+#include <svl/setitem.hxx>
 #include <svl/slstitm.hxx>
 #include <svl/srchitem.hxx>
 #include <svl/stritem.hxx>
@@ -376,7 +387,6 @@
 #include <svx/svdoutl.hxx>
 #include <svx/svdpage.hxx>
 #include <svx/svdpagv.hxx>
-#include <svx/svdtypes.hxx>
 #include <svx/svdview.hxx>
 #include <svx/svxdlg.hxx>
 #include <svx/svxdllapi.h>
@@ -421,10 +431,12 @@
 #include <unotools/moduleoptions.hxx>
 #include <unotools/options.hxx>
 #include <unotools/pathoptions.hxx>
+#include <unotools/resmgr.hxx>
 #include <unotools/saveopt.hxx>
 #include <unotools/syslocale.hxx>
 #include <unotools/tempfile.hxx>
 #include <unotools/transliterationwrapper.hxx>
+#include <unotools/ucbstreamhelper.hxx>
 #include <unotools/unotoolsdllapi.h>
 #include <unotools/useroptions.hxx>
 #include <xmloff/dllapi.h>
@@ -470,6 +482,7 @@
 #include <UndoAttribute.hxx>
 #include <UndoCore.hxx>
 #include <UndoDelete.hxx>
+#include <UndoInsert.hxx>
 #include <UndoManager.hxx>
 #include <UndoRedline.hxx>
 #include <UndoTable.hxx>
@@ -584,6 +597,7 @@
 #include <ndtxt.hxx>
 #include <node.hxx>
 #include <node2lay.hxx>
+#include <nodeoffset.hxx>
 #include <notxtfrm.hxx>
 #include <numrule.hxx>
 #include <objectformatter.hxx>
diff --git a/sw/inc/pch/precompiled_swui.hxx b/sw/inc/pch/precompiled_swui.hxx
index 264c90aff4c5..bab9ed5b8fd6 100644
--- a/sw/inc/pch/precompiled_swui.hxx
+++ b/sw/inc/pch/precompiled_swui.hxx
@@ -13,7 +13,7 @@
  manual changes will be rewritten by the next run of update_pch.sh (which 
presumably
  also fixes all possible problems, so it's usually better to use it).
 
- Generated on 2021-09-28 05:49:06 using:
+ Generated on 2021-12-11 12:59:13 using:
  ./bin/update_pch sw swui --cutoff=3 --exclude:system --include:module 
--include:local
 
  If after updating build fails, use the following command to locate 
conflicting headers:
@@ -55,6 +55,7 @@
 #include <string_view>
 #include <type_traits>
 #include <unordered_map>
+#include <unordered_set>
 #include <utility>
 #include <vector>
 #include <boost/property_tree/ptree_fwd.hpp>
@@ -199,14 +200,15 @@
 #include <com/sun/star/awt/KeyGroup.hpp>
 #include <com/sun/star/awt/SystemPointer.hpp>
 #include <com/sun/star/awt/XWindow.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/XMultiPropertySet.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertyState.hpp>
 #include <com/sun/star/container/XChild.hpp>
 #include <com/sun/star/container/XEnumeration.hpp>
-#include <com/sun/star/container/XEnumerationAccess.hpp>
 #include <com/sun/star/container/XIndexReplace.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
 #include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/container/XNamed.hpp>
 #include <com/sun/star/datatransfer/DataFlavor.hpp>
 #include <com/sun/star/datatransfer/XTransferable.hpp>
 #include <com/sun/star/datatransfer/XTransferable2.hpp>
@@ -278,7 +280,9 @@
 #include <com/sun/star/script/XStarBasicAccess.hpp>
 #include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
 #include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/style/LineSpacing.hpp>
 #include <com/sun/star/style/NumberingType.hpp>
+#include <com/sun/star/style/ParagraphAdjust.hpp>
 #include <com/sun/star/table/BorderLineStyle.hpp>
 #include <com/sun/star/text/HoriOrientation.hpp>
 #include <com/sun/star/text/PositionLayoutDir.hpp>
@@ -286,17 +290,12 @@
 #include <com/sun/star/text/RubyAdjust.hpp>
 #include <com/sun/star/text/TextContentAnchorType.hpp>
 #include <com/sun/star/text/VertOrientation.hpp>
-#include <com/sun/star/text/XRelativeTextContentInsert.hpp>
-#include <com/sun/star/text/XRelativeTextContentRemove.hpp>
-#include <com/sun/star/text/XTextAppendAndConvert.hpp>
-#include <com/sun/star/text/XTextCopy.hpp>
-#include <com/sun/star/text/XTextRangeCompare.hpp>
+#include <com/sun/star/text/XTextSection.hpp>
 #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
 #include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
 #include <com/sun/star/uno/Any.h>
 #include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Exception.hpp>
 #include <com/sun/star/uno/Reference.h>
 #include <com/sun/star/uno/Reference.hxx>
 #include <com/sun/star/uno/RuntimeException.hpp>
@@ -393,16 +392,17 @@
 #include <o3tl/deleter.hxx>
 #include <o3tl/safeint.hxx>
 #include <o3tl/sorted_vector.hxx>
+#include <o3tl/span.hxx>
 #include <o3tl/strong_int.hxx>
 #include <o3tl/typed_flags_set.hxx>
 #include <o3tl/underlyingenumvalue.hxx>
 #include <o3tl/unit_conversion.hxx>
 #include <officecfg/Office/Writer.hxx>
 #include <ooo/vba/XHelperInterface.hpp>
-#include <ooo/vba/word/WdSaveFormat.hpp>
-#include <ooo/vba/word/XSection.hpp>
+#include <ooo/vba/word/XParagraphFormat.hpp>
 #include <salhelper/salhelperdllapi.h>
 #include <salhelper/simplereferenceobject.hxx>
+#include <sfx2/Metadatable.hxx>
 #include <sfx2/basedlgs.hxx>
 #include <sfx2/bindings.hxx>
 #include <sfx2/chalign.hxx>
@@ -412,6 +412,7 @@
 #include <sfx2/docfile.hxx>
 #include <sfx2/docfilt.hxx>
 #include <sfx2/filedlghelper.hxx>
+#include <sfx2/frame.hxx>
 #include <sfx2/htmlmode.hxx>
 #include <sfx2/linksrc.hxx>
 #include <sfx2/lnkbase.hxx>
@@ -436,7 +437,6 @@
 #include <svl/itempool.hxx>
 #include <svl/itemset.hxx>
 #include <svl/languageoptions.hxx>
-#include <svl/listener.hxx>
 #include <svl/lstner.hxx>
 #include <svl/macitem.hxx>
 #include <svl/nfkeytab.hxx>
@@ -465,6 +465,7 @@
 #include <svx/autoformathelper.hxx>
 #include <svx/colorbox.hxx>
 #include <svx/colorwindow.hxx>
+#include <svx/ctredlin.hxx>
 #include <svx/dialmgr.hxx>
 #include <svx/flagsdef.hxx>
 #include <svx/framelinkarray.hxx>
@@ -583,6 +584,7 @@
 #include <ndindex.hxx>
 #include <ndtyp.hxx>
 #include <node.hxx>
+#include <nodeoffset.hxx>
 #include <num.hxx>
 #include <numberingtypelistbox.hxx>
 #include <numfmtlb.hxx>
@@ -591,6 +593,7 @@
 #include <optload.hxx>
 #include <outline.hxx>
 #include <pagedesc.hxx>
+#include <pam.hxx>
 #include <pardlg.hxx>
 #include <poolfmt.hxx>
 #include <reffld.hxx>
@@ -622,7 +625,6 @@
 #include <uitool.hxx>
 #include <undobj.hxx>
 #include <unobaseclass.hxx>
-#include <unotext.hxx>
 #include <unotools.hxx>
 #include <usrpref.hxx>
 #include <view.hxx>
diff --git a/sw/inc/pch/precompiled_vbaswobj.hxx 
b/sw/inc/pch/precompiled_vbaswobj.hxx
index 1270444ef8f4..9377406e97d1 100644
--- a/sw/inc/pch/precompiled_vbaswobj.hxx
+++ b/sw/inc/pch/precompiled_vbaswobj.hxx
@@ -13,7 +13,7 @@
  manual changes will be rewritten by the next run of update_pch.sh (which 
presumably
  also fixes all possible problems, so it's usually better to use it).
 
- Generated on 2021-09-12 11:53:02 using:
+ Generated on 2021-12-11 12:59:19 using:
  ./bin/update_pch sw vbaswobj --cutoff=4 --exclude:system --include:module 
--include:local
 
  If after updating build fails, use the following command to locate 
conflicting headers:
@@ -173,8 +173,9 @@
 #include <com/sun/star/awt/Key.hpp>
 #include <com/sun/star/awt/KeyGroup.hpp>
 #include <com/sun/star/awt/SystemPointer.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/XMultiPropertySet.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertyState.hpp>
 #include <com/sun/star/container/NoSuchElementException.hpp>
 #include <com/sun/star/container/XEnumeration.hpp>
 #include <com/sun/star/container/XIndexAccess.hpp>
@@ -197,8 +198,11 @@
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/lang/XTypeProvider.hpp>
 #include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/rdf/XMetadatable.hpp>
 #include <com/sun/star/security/DocumentSignatureInformation.hpp>
+#include <com/sun/star/style/LineSpacing.hpp>
 #include <com/sun/star/style/NumberingType.hpp>
+#include <com/sun/star/style/ParagraphAdjust.hpp>
 #include <com/sun/star/style/XStyle.hpp>
 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
 #include <com/sun/star/table/XCellRange.hpp>
@@ -208,10 +212,10 @@
 #include <com/sun/star/text/XPageCursor.hpp>
 #include <com/sun/star/text/XTextDocument.hpp>
 #include <com/sun/star/text/XTextRangeCompare.hpp>
+#include <com/sun/star/text/XTextSection.hpp>
 #include <com/sun/star/text/XTextTable.hpp>
 #include <com/sun/star/uno/Any.h>
 #include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Exception.hpp>
 #include <com/sun/star/uno/Reference.h>
 #include <com/sun/star/uno/Reference.hxx>
 #include <com/sun/star/uno/RuntimeException.hpp>
@@ -264,19 +268,21 @@
 #include <editeng/widwitem.hxx>
 #include <i18nlangtag/lang.h>
 #include <o3tl/cow_wrapper.hxx>
+#include <o3tl/deleter.hxx>
 #include <o3tl/enumarray.hxx>
 #include <o3tl/safeint.hxx>
 #include <o3tl/sorted_vector.hxx>
+#include <o3tl/span.hxx>
 #include <o3tl/strong_int.hxx>
 #include <o3tl/typed_flags_set.hxx>
 #include <o3tl/underlyingenumvalue.hxx>
 #include <o3tl/unit_conversion.hxx>
 #include <ooo/vba/XCollection.hpp>
 #include <ooo/vba/XHelperInterface.hpp>
-#include <ooo/vba/word/WdSaveFormat.hpp>
-#include <ooo/vba/word/XSection.hpp>
+#include <ooo/vba/word/XParagraphFormat.hpp>
 #include <salhelper/salhelperdllapi.h>
 #include <salhelper/simplereferenceobject.hxx>
+#include <sfx2/Metadatable.hxx>
 #include <sfx2/dllapi.h>
 #include <sfx2/shell.hxx>
 #include <sot/formats.hxx>
@@ -363,6 +369,7 @@
 #include <ndindex.hxx>
 #include <ndtyp.hxx>
 #include <node.hxx>
+#include <nodeoffset.hxx>
 #include <numrule.hxx>
 #include <pam.hxx>
 #include <paratr.hxx>
commit 49528082f2070268c0b1507ce6e63aa7e5794467
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sat Dec 11 12:55:41 2021 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sat Dec 11 15:25:05 2021 +0100

    keep as css::awt::XPopupMenu through another layer of api
    
    Change-Id: I36e98e45d7d8ea092b1c58aea83652fe5df7bb17
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126660
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index cfde481f5e21..2971c210ea59 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -299,7 +299,9 @@ public:
     void                        SetController( SfxBaseController* pController 
);
     css::uno::Reference<css::frame::XController> GetController() const;
 
-    bool                        TryContextMenuInterception( const Menu& rIn, 
const OUString& rMenuIdentifier, VclPtr<Menu>& rpOut, 
css::ui::ContextMenuExecuteEvent aEvent );
+    bool                        TryContextMenuInterception(const Menu& rIn, 
const OUString& rMenuIdentifier,
+                                                           
css::uno::Reference<css::awt::XPopupMenu>& rOut,
+                                                           
css::ui::ContextMenuExecuteEvent aEvent);
     bool                        TryContextMenuInterception(const 
css::uno::Reference<css::awt::XPopupMenu>&,
                                                            const OUString& 
rMenuIdentifier,
                                                            
css::ui::ContextMenuExecuteEvent aEvent);
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index e6b62ca774f9..cf5509af155d 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1889,9 +1889,11 @@ static void Change( Menu* pMenu, SfxViewShell* pView )
 }
 
 
-bool SfxViewShell::TryContextMenuInterception( const Menu& rIn, const 
OUString& rMenuIdentifier, VclPtr<Menu>& rpOut, ui::ContextMenuExecuteEvent 
aEvent )
+bool SfxViewShell::TryContextMenuInterception(const Menu& rIn, const OUString& 
rMenuIdentifier,
+                                              
css::uno::Reference<css::awt::XPopupMenu>& rOut,
+                                              ui::ContextMenuExecuteEvent 
aEvent)
 {
-    rpOut = nullptr;
+    rOut.clear();
     bool bModified = false;
 
     // create container from menu
@@ -1943,13 +1945,20 @@ bool SfxViewShell::TryContextMenuInterception( const 
Menu& rIn, const OUString&
         break;
     }
 
-    if ( bModified )
+    if (bModified)
     {
-        // container was modified, create a new window out of it
-        rpOut = VclPtr<PopupMenu>::Create();
-        
::framework::ActionTriggerHelper::CreateMenuFromActionTriggerContainer( rpOut, 
aEvent.ActionTriggerContainer );
+        // container was modified, create a new menu out of it
+        css::uno::Reference<uno::XComponentContext> 
xContext(::comphelper::getProcessComponentContext(), css::uno::UNO_SET_THROW);
+        
rOut.set(xContext->getServiceManager()->createInstanceWithContext("com.sun.star.awt.PopupMenu",
 xContext), css::uno::UNO_QUERY_THROW);
+
+        VCLXMenu* pAwtMenu = comphelper::getFromUnoTunnel<VCLXMenu>(rOut);
+        assert(pAwtMenu);
+        PopupMenu* pVCLMenu = static_cast<PopupMenu*>(pAwtMenu->GetMenu());
+        assert(pVCLMenu);
+
+        
::framework::ActionTriggerHelper::CreateMenuFromActionTriggerContainer(pVCLMenu,
 aEvent.ActionTriggerContainer);
 
-        Change( rpOut, this );
+        Change(pVCLMenu, this);
     }
 
     return true;
diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index b82614551640..b7c3890a5f71 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -19,16 +19,19 @@
 
 #include <swtypes.hxx>
 #include <hintids.hxx>
+
 #include <com/sun/star/accessibility/XAccessible.hpp>
-#include <comphelper/string.hxx>
+#include <com/sun/star/awt/PopupMenuDirection.hpp>
+#include <com/sun/star/awt/XPopupMenu.hpp>
 #include <com/sun/star/i18n/XBreakIterator.hpp>
 #include <com/sun/star/i18n/ScriptType.hpp>
 #include <com/sun/star/i18n/InputSequenceCheckMode.hpp>
-#include <com/sun/star/i18n/XExtendedInputSequenceChecker.hpp>
-
 #include <com/sun/star/i18n/UnicodeScript.hpp>
+#include <com/sun/star/i18n/XExtendedInputSequenceChecker.hpp>
 #include <com/sun/star/ui/ContextMenuExecuteEvent.hpp>
 
+#include <comphelper/string.hxx>
+
 #include <vcl/dialoghelper.hxx>
 #include <vcl/inputctx.hxx>
 #include <vcl/help.hxx>
@@ -5373,13 +5376,15 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
                         aEvent.SourceWindow = VCLUnoHelper::GetInterface( this 
);
                         aEvent.ExecutePosition.X = aPixPos.X();
                         aEvent.ExecutePosition.Y = aPixPos.Y();
-                        ScopedVclPtr<Menu> pMenu;
-                        if 
(GetView().TryContextMenuInterception(aROPopup.GetMenu(), 
"private:resource/ReadonlyContextMenu", pMenu, aEvent))
+                        css::uno::Reference<css::awt::XPopupMenu> xMenu;
+                        if 
(GetView().TryContextMenuInterception(aROPopup.GetMenu(), 
"private:resource/ReadonlyContextMenu", xMenu, aEvent))
                         {
-                            if ( pMenu )
+                            if (xMenu.is())
                             {
-                                sal_uInt16 nExecId = 
static_cast<PopupMenu*>(pMenu.get())->Execute(this, aPixPos);
-                                if( !::ExecuteMenuCommand( 
*static_cast<PopupMenu*>(pMenu.get()), *m_rView.GetViewFrame(), nExecId ))
+                                css::uno::Reference<css::awt::XWindowPeer> 
xParent(aEvent.SourceWindow, css::uno::UNO_QUERY);
+                                sal_uInt16 nExecId = xMenu->execute(xParent, 
css::awt::Rectangle(aPixPos.X(), aPixPos.Y(), 1, 1),
+                                                                    
css::awt::PopupMenuDirection::EXECUTE_DOWN);
+                                if (!::ExecuteMenuCommand(xMenu, 
*m_rView.GetViewFrame(), nExecId))
                                     aROPopup.Execute(this, nExecId);
                             }
                             else
diff --git a/sw/source/uibase/inc/uitool.hxx b/sw/source/uibase/inc/uitool.hxx
index ba8bf7093d54..85747a9f82e3 100644
--- a/sw/source/uibase/inc/uitool.hxx
+++ b/sw/source/uibase/inc/uitool.hxx
@@ -20,7 +20,6 @@
 #define INCLUDED_SW_SOURCE_UIBASE_INC_UITOOL_HXX
 
 #include <vcl/weld.hxx>
-#include <vcl/menu.hxx>
 #include <swtypes.hxx>
 #include <swdllapi.h>
 
@@ -28,7 +27,7 @@ class SfxItemSet;
 class SwPageDesc;
 class SvxTabStopItem;
 class SwWrtShell;
-class ListBox;
+namespace com::sun::star::awt { class XPopupMenu; }
 namespace weld { class ComboBox; }
 class SwDocShell;
 class SwFrameFormat;
@@ -108,7 +107,7 @@ OUString GetAppLangDateTimeString( const DateTime& );
 
 // search for a command string within the menu structure and execute it
 // at the dispatcher if there is one, if executed return true
-bool ExecuteMenuCommand( PopupMenu const & rMenu, SfxViewFrame const & 
rViewFrame, sal_uInt16 nId );
+bool ExecuteMenuCommand(const css::uno::Reference<css::awt::XPopupMenu>& 
rMenu, const SfxViewFrame& rViewFrame, sal_uInt16 nId);
 
 #endif // INCLUDED_SW_SOURCE_UIBASE_INC_UITOOL_HXX
 
diff --git a/sw/source/uibase/uiview/viewling.cxx 
b/sw/source/uibase/uiview/viewling.cxx
index ba3f2df868bf..6a2685c5b38f 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -709,21 +709,23 @@ bool SwView::ExecSpellPopup(const Point& rPt)
                 aEvent.SourceWindow = VCLUnoHelper::GetInterface( m_pEditWin );
                 aEvent.ExecutePosition.X = aPixPos.X();
                 aEvent.ExecutePosition.Y = aPixPos.Y();
-                ScopedVclPtr<Menu> pMenu;
+                css::uno::Reference<css::awt::XPopupMenu> xMenu;
 
                 OUString sMenuName = bUseGrammarContext ?
                     OUString("private:resource/GrammarContextMenu") : 
OUString("private:resource/SpellContextMenu");
-                if (TryContextMenuInterception(xPopup->GetMenu(), sMenuName, 
pMenu, aEvent))
+                if (TryContextMenuInterception(xPopup->GetMenu(), sMenuName, 
xMenu, aEvent))
                 {
                     //! happy hacking for context menu modifying extensions of 
this
                     //! 'custom made' menu... *sigh* (code copied from sfx2 
and framework)
-                    if ( pMenu )
+                    if (xMenu.is())
                     {
-                        const sal_uInt16 nId = 
static_cast<PopupMenu*>(pMenu.get())->Execute(m_pEditWin, aPixPos);
-                        OUString aCommand = 
static_cast<PopupMenu*>(pMenu.get())->GetItemCommand(nId);
+                        css::uno::Reference<css::awt::XWindowPeer> 
xParent(aEvent.SourceWindow, css::uno::UNO_QUERY);
+                        const sal_uInt16 nId = xMenu->execute(xParent, 
css::awt::Rectangle(aPixPos.X(), aPixPos.Y(), 1, 1),
+                                                              
css::awt::PopupMenuDirection::EXECUTE_DOWN);
+                        OUString aCommand = xMenu->getCommand(nId);
                         if (aCommand.isEmpty() )
                         {
-                            if 
(!ExecuteMenuCommand(dynamic_cast<PopupMenu&>(*pMenu), *GetViewFrame(), nId))
+                            if (!ExecuteMenuCommand(xMenu, *GetViewFrame(), 
nId))
                                 xPopup->Execute(nId);
                         }
                         else
diff --git a/sw/source/uibase/utlui/uitool.cxx 
b/sw/source/uibase/utlui/uitool.cxx
index 5c34b89ca0a7..ff11dc23eae7 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -36,6 +36,7 @@
 #include <editeng/lrspitem.hxx>
 #include <svl/style.hxx>
 #include <unotools/localedatawrapper.hxx>
+#include <com/sun/star/awt/XPopupMenu.hpp>
 #include <com/sun/star/frame/XDispatch.hpp>
 #include <com/sun/star/frame/XDispatchProvider.hpp>
 #include <com/sun/star/frame/XFrame.hpp>
@@ -887,17 +888,18 @@ void SetApplyCharUnit(bool bApplyChar, bool bWeb)
     SW_MOD()->ApplyUserCharUnit(bApplyChar, bWeb);
 }
 
-bool ExecuteMenuCommand( PopupMenu const & rMenu, SfxViewFrame const & 
rViewFrame, sal_uInt16 nId )
+bool ExecuteMenuCommand(const css::uno::Reference<css::awt::XPopupMenu>& 
rMenu, const SfxViewFrame& rViewFrame, sal_uInt16 nId)
 {
     bool bRet = false;
-    const sal_uInt16 nItemCount = rMenu.GetItemCount();
+    const sal_uInt16 nItemCount = rMenu->getItemCount();
     OUString sCommand;
-    for( sal_uInt16 nItem = 0; nItem < nItemCount; ++nItem)
+    for (sal_uInt16 nItem = 0; nItem < nItemCount; ++nItem)
     {
-        PopupMenu* pPopup = rMenu.GetPopupMenu( rMenu.GetItemId( nItem ) );
-        if(pPopup)
+        sal_Int16 nItemId = rMenu->getItemId(nItem);
+        css::uno::Reference<css::awt::XPopupMenu> xPopup = 
rMenu->getPopupMenu(nItemId);
+        if (xPopup.is())
         {
-            sCommand = pPopup->GetItemCommand(nId);
+            sCommand = xPopup->getCommand(nId);
             if(!sCommand.isEmpty())
                 break;
         }

Reply via email to