[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2023-11-16 Thread Caolán McNamara (via logerrit)
 sw/inc/swurl.hxx |5 +
 sw/source/uibase/shells/drwtxtex.cxx |8 ++--
 sw/source/uibase/wrtsh/wrtsh2.cxx|   28 ++--
 3 files changed, 25 insertions(+), 16 deletions(-)

New commits:
commit 502f7958d99e3aa27f4c1c1f33f4827055459da8
Author: Caolán McNamara 
AuthorDate: Wed Nov 15 21:15:54 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Nov 16 12:19:53 2023 +0100

pass a frame to use as parent for any dialog that may need to appear

which avoids: sfx2/source/appl/appserv.cxx:314: no parent for dialogs

Change-Id: I71734b42f3206fc724e5a3d5538072dc775f0b68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159490
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx 
b/sw/source/uibase/wrtsh/wrtsh2.cxx
index 6f7d1a2ee232..d2451442c600 100644
--- a/sw/source/uibase/wrtsh/wrtsh2.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh2.cxx
@@ -615,17 +615,18 @@ void LoadURL(SwView& rView, const OUString& rURL, 
LoadUrlFlags nFilter,
 if ((nFilter & LoadUrlFlags::NewView) && 
!comphelper::LibreOfficeKit::isActive())
 aTargetFrameName.SetValue( "_blank" );
 
-const SfxPoolItem* aArr[] = {
+SfxUnoFrameItem aDocFrame(SID_FILLFRAME, 
rViewFrame.GetFrame().GetFrameInterface());
+
+rViewFrame.GetDispatcher()->ExecuteList(SID_OPENDOC,
+SfxCallMode::ASYNCHRON|SfxCallMode::RECORD,
+{
 ,
 , /*,*/
 ,
 , ,
-,
-nullptr
-};
-
-rViewFrame.GetDispatcher()->GetBindings()->Execute( SID_OPENDOC, aArr,
-SfxCallMode::ASYNCHRON|SfxCallMode::RECORD );
+
+},
+{  } );
 }
 
 void SwWrtShell::NavigatorPaste( const NaviContentBookmark& rBkmk,
commit 0df175ccc6ea542bc5801f631ff72bed187042eb
Author: Caolán McNamara 
AuthorDate: Wed Nov 15 21:01:48 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Nov 16 12:19:46 2023 +0100

combine these hyperlink dispatchers into one call

Change-Id: Icb7822e811013de648ccf2fbb23a5f0be9e29bb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159489
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sw/inc/swurl.hxx b/sw/inc/swurl.hxx
index 87375f30c8b7..ec88a639a4e9 100644
--- a/sw/inc/swurl.hxx
+++ b/sw/inc/swurl.hxx
@@ -23,6 +23,7 @@
 #include 
 
 class SwViewShell;
+class SwView;
 
 enum class LoadUrlFlags {
 NONE= 0x00,
@@ -35,6 +36,10 @@ namespace o3tl {
 void LoadURL( SwViewShell& rSh, const OUString& rName,
   LoadUrlFlags nFilter, const OUString& rTargetFrameName );
 
+void LoadURL( SwView& rView, const OUString& rName,
+  LoadUrlFlags nFilter, const OUString& rTargetFrameName );
+
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/shells/drwtxtex.cxx 
b/sw/source/uibase/shells/drwtxtex.cxx
index 9c4218567e22..aac07e855f05 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -499,12 +499,8 @@ void SwDrawTextShell::Execute( SfxRequest  )
 const SvxFieldData* pField = pFieldItem ? pFieldItem->GetField() : 
nullptr;
 if (const SvxURLField* pURLField = dynamic_cast(pField))
 {
-SfxStringItem aUrl(SID_FILE_NAME, pURLField->GetURL());
-SfxStringItem aTarget(SID_TARGETNAME, 
pURLField->GetTargetFrame());
-SfxBoolItem aNewView(SID_OPEN_NEW_VIEW, false);
-SfxBoolItem aBrowsing(SID_BROWSE, true);
-GetView().GetViewFrame().GetDispatcher()->ExecuteList(
-SID_OPENDOC, SfxCallMode::SYNCHRON, { , , 
,  });
+::LoadURL(GetView(), pURLField->GetURL(), LoadUrlFlags::NONE,
+  pURLField->GetTargetFrame());
 }
 }
 break;
diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx 
b/sw/source/uibase/wrtsh/wrtsh2.cxx
index 91d97c119064..6f7d1a2ee232 100644
--- a/sw/source/uibase/wrtsh/wrtsh2.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh2.cxx
@@ -567,9 +567,16 @@ void LoadURL( SwViewShell& rVSh, const OUString& rURL, 
LoadUrlFlags nFilter,
 //A CursorShell is always a WrtShell
 SwWrtShell  = static_cast(rVSh);
 
-SwDocShell* pDShell = rSh.GetView().GetDocShell();
+::LoadURL(rSh.GetView(), rURL, nFilter, rTargetFrameName);
+
+}
+
+void LoadURL(SwView& rView, const OUString& rURL, LoadUrlFlags nFilter,
+  const OUString& rTargetFrameName)
+{
+SwDocShell* pDShell = rView.GetDocShell();
 OSL_ENSURE( pDShell, "No DocShell?!");
-SfxViewFrame& rViewFrame = rSh.GetView().GetViewFrame();
+SfxViewFrame& rViewFrame = rView.GetViewFrame();
 
 if (!SfxObjectShell::AllowedLinkProtocolFromDocument(rURL, pDShell, 
rViewFrame.GetFrameWeld()))
 return;
@@ -578,7 +585,7 @@ void LoadURL( SwViewShell& 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source vcl/source

2023-11-16 Thread Noel Grandin (via logerrit)
 sw/inc/AnnotationWin.hxx  |3 -
 sw/source/uibase/docvw/AnnotationWin2.cxx |   23 +++---
 vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx |2 -
 3 files changed, 7 insertions(+), 21 deletions(-)

New commits:
commit 60f001962122a77863231e9cf5dc445c136aac43
Author: Noel Grandin 
AuthorDate: Thu Nov 16 10:28:50 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 16 11:52:03 2023 +0100

tdf#157789 Comment size wrong behavior when zooming document

Revert
commit 8d18b5af883bb6b56e758801ee730a08bb88a8f5
Author: Noel Grandin 
Date:   Tue Jun 13 10:11:08 2023 +0200
speed up rendering annotatins, cache meta height

Change-Id: Ib0bae3fd9020200d09c5b37baf5ae882c8532e58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159496
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx
index 07f3ed8e83f9..cbeaf7ceca44 100644
--- a/sw/inc/AnnotationWin.hxx
+++ b/sw/inc/AnnotationWin.hxx
@@ -29,7 +29,6 @@
 #include "postithelper.hxx"
 #include "swrect.hxx"
 #include "SidebarWindowsTypes.hxx"
-#include 
 #include 
 
 class EditView;
@@ -211,7 +210,6 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin final : public 
InterimItemWindow
 
 virtual voidLoseFocus() override;
 virtual voidGetFocus() override;
-virtual voidDataChanged( const DataChangedEvent& rDCEvt ) override;
 
 voidSetSizePixel( const Size& rNewSize ) override;
 
@@ -277,7 +275,6 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin final : public 
InterimItemWindow
 SwPostItField*   mpField;
 
 rtl::Reference 
mxSidebarWinAccessible;
-mutable std::optional moMetaHeight;
 };
 
 } // end of namespace sw::annotation
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 4864cba499c4..a1780f9132c8 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -1215,25 +1215,14 @@ int SwAnnotationWin::GetPrefScrollbarWidth() const
 
 sal_Int32 SwAnnotationWin::GetMetaHeight() const
 {
-if (!moMetaHeight)
-{
-const int fields = GetNumFields();
+const int fields = GetNumFields();
 
-sal_Int32 nRequiredHeight = 0;
-weld::Label* aLabels[3] = { mxMetadataAuthor.get(), 
mxMetadataDate.get(), mxMetadataResolved.get() };
-for (int i = 0; i < fields; ++i)
-nRequiredHeight += aLabels[i]->get_preferred_size().Height();
-moMetaHeight = nRequiredHeight;
-}
-return *moMetaHeight;
-}
+sal_Int32 nRequiredHeight = 0;
+weld::Label* aLabels[3] = { mxMetadataAuthor.get(), mxMetadataDate.get(), 
mxMetadataResolved.get() };
+for (int i = 0; i < fields; ++i)
+nRequiredHeight += aLabels[i]->get_preferred_size().Height();
 
-void SwAnnotationWin::DataChanged(const DataChangedEvent& rDCEvt)
-{
-if ((rDCEvt.GetType() == DataChangedEventType::SETTINGS) && 
(rDCEvt.GetFlags() & AllSettingsFlags::STYLE))
-{
-moMetaHeight.reset();
-}
+return nRequiredHeight;
 }
 
 sal_Int32 SwAnnotationWin::GetNumFields() const
commit b0c68499ab36d2a1bdf6f1bc7d4cd259b99700e7
Author: Noel Grandin 
AuthorDate: Thu Nov 16 10:24:42 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 16 11:51:48 2023 +0100

tdf#158224 Cannot convert bitmap to polygons

regression from
commit a76a135c9e9bdecd38970e293e72ca000d27
Author: Noel Grandin 
Date:   Tue Jan 3 20:14:21 2023 +0200
flatten some vcl code

Change-Id: Ibb2a059b283dc2e3bf3fecbf24ff71332a204d5d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159495
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx 
b/vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx
index 38e2c76794b0..ec4004879651 100644
--- a/vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx
+++ b/vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx
@@ -19,7 +19,7 @@ BitmapEx 
BitmapSimpleColorQuantizationFilter::execute(BitmapEx const& aBitmapEx)
 {
 Bitmap aBitmap = aBitmapEx.GetBitmap();
 
-if (vcl::numberOfColors(aBitmap.getPixelFormat()) > 
sal_Int64(mnNewColorCount))
+if (vcl::numberOfColors(aBitmap.getPixelFormat()) <= 
sal_Int64(mnNewColorCount))
 return BitmapEx(aBitmap);
 
 Bitmap aNewBmp;


[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2023-11-08 Thread Noel Grandin (via logerrit)
 sw/inc/EnhancedPDFExportHelper.hxx  |5 +++--
 sw/inc/ndgrf.hxx|5 +++--
 sw/source/core/graphic/ndgrf.cxx|   15 +++
 sw/source/core/text/EnhancedPDFExportHelper.cxx |4 ++--
 4 files changed, 15 insertions(+), 14 deletions(-)

New commits:
commit 43c9c359471ed6a91bf4eff3f75dddba3ca2214c
Author: Noel Grandin 
AuthorDate: Wed Nov 8 09:21:44 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 9 06:25:15 2023 +0100

loplugin:fieldcast in Num_Info

Change-Id: I9d839c22579e5bc5fe6250a8aab0285ca9e0a4c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159170
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/EnhancedPDFExportHelper.hxx 
b/sw/inc/EnhancedPDFExportHelper.hxx
index 6b2e2655ea43..dd20f54cbef8 100644
--- a/sw/inc/EnhancedPDFExportHelper.hxx
+++ b/sw/inc/EnhancedPDFExportHelper.hxx
@@ -44,6 +44,7 @@ class SwTextNode;
 class SwTable;
 class SwNumberTreeNode;
 class SwTextPaintInfo;
+class SwTextFrame;
 
 /*
  * Mapping of OOo elements to tagged pdf elements:
@@ -96,8 +97,8 @@ class SwTextPaintInfo;
 
 struct Num_Info
 {
-const SwFrame& mrFrame;
-Num_Info( const SwFrame& rFrame ) : mrFrame( rFrame ) {};
+const SwTextFrame& mrFrame;
+Num_Info( const SwTextFrame& rFrame ) : mrFrame( rFrame ) {};
 };
 
 struct Frame_Info
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx 
b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index c9829e0f5ef1..2bf5ca3f883d 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -585,7 +585,7 @@ void SwTaggedPDFHelper::BeginTag( 
vcl::PDFWriter::StructElement eType, const OUS
 
 if ( mpNumInfo )
 {
-const SwTextFrame& rTextFrame = static_cast(mpNumInfo->mrFrame);
+const SwTextFrame& rTextFrame = mpNumInfo->mrFrame;
 SwTextNode const*const pTextNd = rTextFrame.GetTextNodeForParaProps();
 const SwNodeNum* pNodeNum = pTextNd->GetNum(rTextFrame.getRootFrame());
 
@@ -1071,7 +1071,7 @@ void SwTaggedPDFHelper::SetAttributes( 
vcl::PDFWriter::StructElement eType )
 }
 else if (mpNumInfo && eType == vcl::PDFWriter::List)
 {
-SwTextFrame const& rFrame(static_cast(mpNumInfo->mrFrame));
+SwTextFrame const& rFrame(mpNumInfo->mrFrame);
 SwTextNode const& rNode(*rFrame.GetTextNodeForParaProps());
 SwNumRule const*const pNumRule = rNode.GetNumRule();
 assert(pNumRule); // was required for List
commit 1564e33b861f22c0f6eac546deca5300d5d7b56f
Author: Noel Grandin 
AuthorDate: Wed Nov 8 08:24:54 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 9 06:25:05 2023 +0100

loplugin:fieldcast in SwGrfNode

Change-Id: I95411fa20c38238d1ee74e8d73dd0a9553b9ad45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159169
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index 955ada009aae..93673990fff8 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include "ndnotxt.hxx"
+#include "swbaslnk.hxx"
 #include 
 
 class SwAsyncRetrieveInputStreamThreadConsumer;
@@ -37,7 +38,7 @@ class SW_DLLPUBLIC SwGrfNode final: public SwNoTextNode
 
 GraphicObject maGrfObj;
 std::unique_ptr mpReplacementGraphic;
-tools::SvRef mxLink;   ///< If graphics only as link 
then pointer is set.
+tools::SvRef mxLink; ///< If graphics only as link then 
pointer is set.
 Size mnGrfSize;
 bool mbInSwapIn  :1; // to avoid recursion in SwGrfNode::SwapIn
 bool mbInBaseLinkSwapIn  :1; // to avoid recursion in 
SwBaseLink::SwapIn
@@ -125,7 +126,7 @@ public:
 bool IsGrfLink() const  { return mxLink.is(); }
 bool IsLinkedFile() const;
 bool IsLinkedDDE() const;
-const tools::SvRef& GetLink() const{ return mxLink; }
+const tools::SvRef& GetLink() const { return mxLink; }
 bool GetFileFilterNms( OUString* pFileNm, OUString* pFilterNm ) const;
 void ReleaseLink();
 
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 7a26709a8de3..8db55a3887e7 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -107,7 +107,7 @@ SwGrfNode::SwGrfNode( SwNode& rWhere,
 FStatHelper::IsDocument( aUrl.GetMainURL( 
INetURLObject::DecodeMechanism::NONE ) ))
 {
 // file exists, so create connection without an update
-static_cast( mxLink.get() )->Connect();
+mxLink->Connect();
 }
 }
 }
@@ -164,7 +164,7 @@ bool SwGrfNode::ReRead(
 if( nNewType != mxLink->GetObjType() )
 {
 mxLink->Disconnect();
-static_cast( mxLink.get() )->SetObjType( 
nNewType );
+mxLink->SetObjType( nNewType );
 }
 }
 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2023-11-07 Thread Noel Grandin (via logerrit)
 sw/inc/txatritr.hxx   |7 +++
 sw/source/core/txtnode/thints.cxx |8 
 sw/source/core/txtnode/txatritr.cxx   |6 +++---
 sw/source/filter/ww8/wrtw8nds.cxx |4 ++--
 sw/source/ui/dbui/mmresultdialogs.cxx |6 +++---
 sw/source/ui/dialog/ascfldlg.cxx  |6 +++---
 6 files changed, 18 insertions(+), 19 deletions(-)

New commits:
commit 53b289eabb3d265b47bc7fb6cc430291c97f0c0b
Author: Noel Grandin 
AuthorDate: Tue Nov 7 10:24:48 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Nov 7 11:28:55 2023 +0100

use more TypedWhichId

Change-Id: If76b02a20b01624c2cc0aa5e3c310aa1dd930c01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159058
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index 2c0a1250f0b7..71c1ed75d059 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -3492,7 +3492,7 @@ LanguageType SwTextNode::GetLang( const sal_Int32 nBegin, 
const sal_Int32 nLen,
 }
 
 // #i91465# Consider nScript if pSwpHints == 0
-const sal_uInt16 nWhichId = GetWhichOfScript( RES_CHRATR_LANGUAGE, nScript 
);
+const TypedWhichId nWhichId = GetWhichOfScript( 
RES_CHRATR_LANGUAGE, nScript );
 
 if ( HasHints() )
 {
@@ -3526,8 +3526,8 @@ LanguageType SwTextNode::GetLang( const sal_Int32 nBegin, 
const sal_Int32 nLen,
 if( pHt->DontExpand() ? nBegin >= *pEndIdx : nBegin > 
*pEndIdx)
 continue;
 }
-const SfxPoolItem* pItem = CharFormat::GetItem( *pHt, nWhichId 
);
-const LanguageType nLng = static_cast(pItem)->GetLanguage();
+const SvxLanguageItem* pItem = CharFormat::GetItem( *pHt, 
nWhichId );
+const LanguageType nLng = pItem->GetLanguage();
 
 // does the attribute completely cover the range?
 if( nAttrStart <= nBegin && nEnd <= *pEndIdx )
@@ -3539,7 +3539,7 @@ LanguageType SwTextNode::GetLang( const sal_Int32 nBegin, 
const sal_Int32 nLen,
 }
 if( LANGUAGE_DONTKNOW == nRet )
 {
-nRet = static_cast(GetSwAttrSet().Get( 
nWhichId )).GetLanguage();
+nRet = GetSwAttrSet().Get( nWhichId ).GetLanguage();
 if( LANGUAGE_DONTKNOW == nRet )
 nRet = GetAppLanguage();
 }
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index d2e57406f8b3..5b1d62b4b12b 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -3688,8 +3688,8 @@ WW8Ruby::WW8Ruby(const SwTextNode& rNode, const 
SwFormatRuby& rRuby, const MSWor
 if (!rText.isEmpty())
 nScript = g_pBreakIt->GetBreakIter()->getScriptType(rText, 0);
 
-sal_uInt16 nWhich = GetWhichOfScript(RES_CHRATR_FONTSIZE, nScript);
-auto& rHeightItem = static_cast(rExport.GetItem(nWhich));
+TypedWhichId nWhich = 
GetWhichOfScript(RES_CHRATR_FONTSIZE, nScript);
+const SvxFontHeightItem& rHeightItem = rExport.GetItem(nWhich);
 m_nBaseHeight = rHeightItem.GetHeight();
 }
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx 
b/sw/source/ui/dbui/mmresultdialogs.cxx
index 55e6d3ed899c..d53085c91276 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -1087,9 +1087,9 @@ IMPL_LINK_NOARG(SwMMResultEmailDialog, 
SendDocumentsHdl_Impl, weld::Button&, voi
 {
 SwAsciiOptions aOpt;
 sal_uInt16 nAppScriptType = 
SvtLanguageOptions::GetI18NScriptTypeOfLanguage( GetAppLanguage() );
-sal_uInt16 nWhich = GetWhichOfScript( RES_CHRATR_LANGUAGE, 
nAppScriptType);
-aOpt.SetLanguage( static_cast(pTargetView->GetWrtShell().
-GetDefault( nWhich )).GetLanguage());
+TypedWhichId nWhich = GetWhichOfScript( 
RES_CHRATR_LANGUAGE, nAppScriptType);
+const SvxLanguageItem& rDefLangItem = 
pTargetView->GetWrtShell().GetDefault( nWhich );
+aOpt.SetLanguage( rDefLangItem.GetLanguage() );
 aOpt.SetParaFlags( LINEEND_CR );
 aOpt.WriteUserData( sFilterOptions );
 }
diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx
index d800233e2856..43a3249823ae 100644
--- a/sw/source/ui/dialog/ascfldlg.cxx
+++ b/sw/source/ui/dialog/ascfldlg.cxx
@@ -162,9 +162,9 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( weld::Window* pParent, 
SwDocShell& rDocSh,
 {
 if(pDoc)
 {
-const sal_uInt16 nWhich = GetWhichOfScript( 
RES_CHRATR_LANGUAGE, nAppScriptType);
-aOpt.SetLanguage( static_cast(pDoc->
-GetDefault( nWhich )).GetLanguage());
+const TypedWhichId nWhich = 
GetWhichOfScript( RES_CHRATR_LANGUAGE, nAppScriptType);
+const SvxLanguageItem& rLangItem = 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source vcl/jsdialog vcl/source

2023-10-16 Thread Attila Szűcs (via logerrit)
 sw/inc/view.hxx|1 +
 sw/source/uibase/inc/conttree.hxx  |3 +++
 sw/source/uibase/utlui/content.cxx |   29 +
 sw/source/uibase/utlui/navipi.cxx  |   10 ++
 vcl/jsdialog/executor.cxx  |   10 ++
 vcl/source/treelist/svtabbx.cxx|4 
 6 files changed, 53 insertions(+), 4 deletions(-)

New commits:
commit 3649dc202bedf72e37c77993a1f7027bfdfc6d9e
Author: Attila Szűcs 
AuthorDate: Thu Jun 29 18:32:27 2023 +0200
Commit: Caolán McNamara 
CommitDate: Mon Oct 16 11:39:39 2023 +0200

LOK: Navigator: fix expand problems

Save/load content types' expanded status to view, and make sure it
is synchronized with client.
Treeviews now receive/send collapse event/status from/to client.
I've rewritten the way how headings are opened by default
(because synch of collapsed status broke that, as sub-headings
were not expanded at core side).

Change-Id: I80f5b4d99fe5224391a92c4609f94ddbcf37b8ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153771
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
(cherry picked from commit b95750af717e0693a13c3ef3529e1394e0ae)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158016
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index c5967bb4e213..523f86cc8468 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -355,6 +355,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
 
 public: // #i123922# Needs to be called from a 2nd place now as a helper method
 SAL_DLLPRIVATE bool  InsertGraphicDlg( SfxRequest& );
+sal_Int32 m_nNaviExpandedStatus = -1;
 
 protected:
 
diff --git a/sw/source/uibase/inc/conttree.hxx 
b/sw/source/uibase/inc/conttree.hxx
index 495cdfa91353..9c6db5b5a5eb 100644
--- a/sw/source/uibase/inc/conttree.hxx
+++ b/sw/source/uibase/inc/conttree.hxx
@@ -274,6 +274,8 @@ public:
 // return true if it has any children
 bool RequestingChildren(const weld::TreeIter& rParent);
 
+void ExpandAllHeadings();
+
 virtual void Notify(SfxBroadcaster& rBC, SfxHint const& rHint) override;
 
 sal_Int8 AcceptDrop(const AcceptDropEvent& rEvt);
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index d047251ea958..02d3a661e4d1 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1135,6 +1135,12 @@ 
SwContentTree::SwContentTree(std::unique_ptr xTreeView, SwNaviga
 OUString sDocTitle = pView->GetDocShell()->GetTitle();
 if (lcl_DocOutLineExpandStateMap.find(sDocTitle) != 
lcl_DocOutLineExpandStateMap.end())
 mOutLineNodeMap = lcl_DocOutLineExpandStateMap[sDocTitle];
+if (comphelper::LibreOfficeKit::isActive()) {
+if (pView->m_nNaviExpandedStatus < 0)
+m_nActiveBlock = 1;
+else
+m_nActiveBlock = pView->m_nNaviExpandedStatus;
+}
 }
 
 m_aUpdTimer.SetInvokeHandler(LINK(this, SwContentTree, TimerUpdate));
@@ -1149,6 +1155,8 @@ SwContentTree::~SwContentTree()
 {
 OUString sDocTitle = pView->GetDocShell()->GetTitle();
 lcl_DocOutLineExpandStateMap[sDocTitle] = mOutLineNodeMap;
+if (comphelper::LibreOfficeKit::isActive())
+pView->m_nNaviExpandedStatus = m_nActiveBlock;
 }
 clear(); // If applicable erase content types previously.
 m_aUpdTimer.Stop();
@@ -2225,6 +2233,19 @@ bool SwContentTree::RequestingChildren(const 
weld::TreeIter& rParent)
 return false;
 }
 
+void SwContentTree::ExpandAllHeadings()
+{
+if (HasHeadings())
+{
+std::unique_ptr xEntry = GetEntryAtAbsPos(0);
+if (xEntry)
+{
+if (!IsAllExpanded(*m_xTreeView, *xEntry))
+ExpandOrCollapseAll(*m_xTreeView, *xEntry);
+}
+}
+}
+
 SdrObject* SwContentTree::GetDrawingObjectsByContent(const SwContent *pCnt)
 {
 SdrObject *pRetObj = nullptr;
diff --git a/sw/source/uibase/utlui/navipi.cxx 
b/sw/source/uibase/utlui/navipi.cxx
index c868592e904d..3fd5b7f9b682 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -736,12 +736,11 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent,
 m_xGlobalTree->HideTree();
 
 //Open Headings by default
-if (m_xContentTree->HasHeadings())
+SwView *pView = GetCreateView();
+if (pView->m_nNaviExpandedStatus < 0)
 {
-auto& pTreeView = m_xContentTree->get_widget();
-std::unique_ptr itEntry(pTreeView.make_iterator());
-pTreeView.get_iter_first(*itEntry);
-pTreeView.expand_row(*itEntry);
+pView->m_nNaviExpandedStatus = 1;
+m_xContentTree->ExpandAllHeadings();
 }
 }
 }
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 17c56d78e61e..46d5fb675366 100644
--- 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2023-08-08 Thread Caolán McNamara (via logerrit)
 sw/inc/AnnotationWin.hxx  |2 
 sw/source/uibase/docvw/AnnotationWin2.cxx |  172 +++---
 sw/source/uibase/docvw/PostItMgr.cxx  |   98 +
 3 files changed, 143 insertions(+), 129 deletions(-)

New commits:
commit f238f5bf1ba51b03dcbbdc6195c9c9bd590777dd
Author: Caolán McNamara 
AuthorDate: Tue Aug 8 11:32:53 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 8 17:02:12 2023 +0200

when notes are not shown don't do expensive comment size calculation...

and positioning, etc.

Change-Id: Ice2f1a506bc6ae6d463e51e3d98e075a88c93cc0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155450
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx
index f7ac7b301d46..2a3bf339f581 100644
--- a/sw/inc/AnnotationWin.hxx
+++ b/sw/inc/AnnotationWin.hxx
@@ -90,8 +90,8 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin final : public 
InterimItemWindow
   tools::Long nY,
   tools::Long nWidth,
   tools::Long nHeight,
-  const SwRect& aAnchorRect,
   const tools::Long PageBorder);
+void SetAnchorRect(const SwRect& aAnchorRect);
 void SetPosAndSize();
 void TranslateTopPosition(const tools::Long aAmount);
 void CheckMetaText();
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 8c7a26bc1b10..5e8f7a86886e 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -254,13 +254,17 @@ void SwAnnotationWin::DrawForPage(OutputDevice* pDev, 
const Point& rPt)
 }
 
 void SwAnnotationWin::SetPosSizePixelRect(tools::Long nX, tools::Long nY, 
tools::Long nWidth, tools::Long nHeight,
-   const SwRect& aAnchorRect, const 
tools::Long aPageBorder)
+  const tools::Long aPageBorder)
 {
 mPosSize = tools::Rectangle(Point(nX,nY),Size(nWidth,nHeight));
+mPageBorder = aPageBorder;
+}
+
+void SwAnnotationWin::SetAnchorRect(const SwRect& aAnchorRect)
+{
 if (!mAnchorRect.IsEmpty() && mAnchorRect != aAnchorRect)
 mbAnchorRectChanged = true;
 mAnchorRect = aAnchorRect;
-mPageBorder = aPageBorder;
 }
 
 void SwAnnotationWin::SetSize( const Size& rNewSize )
@@ -542,105 +546,106 @@ void SwAnnotationWin::Rescale()
 
 void SwAnnotationWin::SetPosAndSize()
 {
-bool bChange = false;
-
-if (GetSizePixel() != mPosSize.GetSize())
+const bool bShowNotes = mrMgr.ShowNotes();
+if (bShowNotes)
 {
-bChange = true;
-SetSizePixel(mPosSize.GetSize());
+bool bChange = false;
 
-DoResize();
-}
+if (GetSizePixel() != mPosSize.GetSize())
+{
+bChange = true;
+SetSizePixel(mPosSize.GetSize());
 
-if (GetPosPixel().X() != mPosSize.Left() || (std::abs(GetPosPixel().Y() - 
mPosSize.Top()) > 5) )
-{
-bChange = true;
-SetPosPixel(mPosSize.TopLeft());
+DoResize();
+}
 
-Point aLineStart;
-Point aLineEnd ;
-switch ( meSidebarPosition )
+if (GetPosPixel().X() != mPosSize.Left() || 
(std::abs(GetPosPixel().Y() - mPosSize.Top()) > 5) )
 {
-case sw::sidebarwindows::SidebarPosition::LEFT:
+bChange = true;
+SetPosPixel(mPosSize.TopLeft());
+
+Point aLineStart;
+Point aLineEnd ;
+switch ( meSidebarPosition )
 {
-aLineStart = EditWin().PixelToLogic( 
Point(GetPosPixel().X()+GetSizePixel().Width(),GetPosPixel().Y()-1) );
-aLineEnd = EditWin().PixelToLogic( 
Point(GetPosPixel().X(),GetPosPixel().Y()-1) );
+case sw::sidebarwindows::SidebarPosition::LEFT:
+{
+aLineStart = EditWin().PixelToLogic( 
Point(GetPosPixel().X()+GetSizePixel().Width(),GetPosPixel().Y()-1) );
+aLineEnd = EditWin().PixelToLogic( 
Point(GetPosPixel().X(),GetPosPixel().Y()-1) );
+}
+break;
+case sw::sidebarwindows::SidebarPosition::RIGHT:
+{
+aLineStart = EditWin().PixelToLogic( 
Point(GetPosPixel().X(),GetPosPixel().Y()-1) );
+aLineEnd = EditWin().PixelToLogic( 
Point(GetPosPixel().X()+GetSizePixel().Width(),GetPosPixel().Y()-1) );
+}
+break;
+default:
+OSL_FAIL( " - unexpected 
position of sidebar" );
+break;
 }
-break;
-case sw::sidebarwindows::SidebarPosition::RIGHT:
+
+// LOK has map mode disabled, and we still want to perform pixel ->
+// twips conversion for 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2023-05-23 Thread Caolán McNamara (via logerrit)
 sw/inc/viewsh.hxx|   41 ++---
 sw/source/core/frmedt/feshview.cxx   |2 -
 sw/source/core/layout/layact.cxx |2 -
 sw/source/core/view/viewsh.cxx   |   68 ---
 sw/source/uibase/docvw/edtdd.cxx |2 -
 sw/source/uibase/docvw/edtwin3.cxx   |4 +-
 sw/source/uibase/inc/wrtsh.hxx   |2 -
 sw/source/uibase/shells/basesh.cxx   |4 +-
 sw/source/uibase/shells/textsh.cxx   |6 +--
 sw/source/uibase/uiview/view2.cxx|4 +-
 sw/source/uibase/uiview/viewmdi.cxx  |4 +-
 sw/source/uibase/uiview/viewport.cxx |2 -
 sw/source/uibase/utlui/unotools.cxx  |2 -
 sw/source/uibase/wrtsh/wrtsh1.cxx|2 -
 14 files changed, 117 insertions(+), 28 deletions(-)

New commits:
commit 010c05ca0eb66756b7f5db8b847e5a227d9e1ed4
Author: Caolán McNamara 
AuthorDate: Tue May 23 14:19:34 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue May 23 21:52:47 2023 +0200

don't InvalidateAll in online for a OuterResize case

which is triggered on a new joiner to a shared document
but doesn't seem useful in the online case at least

https: //github.com/CollaboraOnline/online/issues/6379
Change-Id: Ic5034658d9e8a7ca1dfab44ce3905b95a5705eb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152164
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 554442d45e5b..e54e294d2f0a 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -187,7 +187,7 @@ class SW_DLLPUBLIC SwViewShell : public 
sw::Ring
 
 SAL_DLLPRIVATE void ImplApplyViewOptions( const SwViewOption  );
 
-SAL_DLLPRIVATE void InvalidateAll(const std::vector& 
rReasons);
+SAL_DLLPRIVATE void InvalidateAll(std::vector& rReasons);
 
 protected:
 static ShellResource*  spShellRes;  ///< Resources for the Shell.
@@ -492,7 +492,7 @@ public:
 inline void LockPaint(LockPaintReason eReason);
void ImplLockPaint();
 inline void UnlockPaint(bool bVirDev = false );
-   void ImplUnlockPaint( const std::vector& rReasons, 
bool bVirDev );
+   void ImplUnlockPaint( std::vector& rReasons, bool 
bVirDev );
bool IsPaintLocked() const { return mnLockPaint != 0; }
 
 // Get/set DrawView and PageView.
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 56b6b67a4caf..e501545e7396 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -417,7 +417,7 @@ void SwViewShell::ImplLockPaint()
 Imp()->LockPaint();
 }
 
-void SwViewShell::ImplUnlockPaint(const std::vector& 
rReasons, bool bVirDev)
+void SwViewShell::ImplUnlockPaint(std::vector& rReasons, bool 
bVirDev)
 {
 CurrShell aCurr( this );
 if ( GetWin() && GetWin()->IsVisible() )
@@ -515,11 +515,23 @@ namespace
 };
 }
 
-void SwViewShell::InvalidateAll(const std::vector& rReasons)
+void SwViewShell::InvalidateAll(std::vector& rReasons)
 {
+assert(!rReasons.empty() && "there must be a reason to InvalidateAll");
+
 for (const auto& reason : rReasons)
 SAL_INFO("sw.core", "InvalidateAll because of: " << to_string(reason));
-GetWin()->Invalidate(InvalidateFlags::Children);
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+// https://github.com/CollaboraOnline/online/issues/6379
+// ditch OuterResize as a reason to invalidate all in the online case
+rReasons.erase(std::remove(rReasons.begin(), rReasons.end(), 
LockPaintReason::OuterResize), rReasons.end());
+}
+
+if (!rReasons.empty())
+GetWin()->Invalidate(InvalidateFlags::Children);
+rReasons.clear();
 }
 
 bool SwViewShell::AddPaintRect( const SwRect & rRect )
commit e606d9336149a78eabd9440ccea2f6c2a29cd0d0
Author: Caolán McNamara 
AuthorDate: Tue May 23 13:10:22 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue May 23 21:52:38 2023 +0200

categorize the reasons writer calls "LockPaint"

and bubble to a new InvalidateAll the collected
reasons for that whole document Invalidate

https: //github.com/CollaboraOnline/online/issues/6379
Change-Id: Id71c59f9cafebe42085337ee1e9591eb9f1162d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152162
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 656e47347c02..554442d45e5b 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -66,6 +66,25 @@ class SdrPaintWindow;
 class SwAccessibleMap;
 enum class Orientation;
 
+enum class LockPaintReason
+{
+ViewLayout = 1,
+OuterResize,
+Undo,
+Redo,
+OutlineFolding,
+EndSdrCreate,
+SwLayIdle,
+InvalidateLayout,
+StartDrag,
+DataChanged,
+InsertFrame,
+GotoPage,
+InsertGraphic,
+SetZoom,
+ExampleFrame
+};
+
 namespace vcl
 {
 typedef OutputDevice RenderContext;
@@ -168,6 +187,8 @@ class SW_DLLPUBLIC 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2023-05-12 Thread Noel Grandin (via logerrit)
 sw/inc/unoframe.hxx  |8 -
 sw/inc/unoredline.hxx|   13 +-
 sw/inc/unotbl.hxx|8 -
 sw/inc/unotext.hxx   |   11 +-
 sw/inc/unotextbodyhf.hxx |   20 +---
 sw/source/core/inc/unofootnote.hxx   |   11 --
 sw/source/core/unocore/unocontentcontrol.cxx |   23 ++---
 sw/source/core/unocore/unoframe.cxx  |   23 +
 sw/source/core/unocore/unoftn.cxx|   25 +
 sw/source/core/unocore/unoobj2.cxx   |   73 
 sw/source/core/unocore/unoredline.cxx|   20 +---
 sw/source/core/unocore/unorefmk.cxx  |   29 ++
 sw/source/core/unocore/unotbl.cxx|   19 +---
 sw/source/core/unocore/unotext.cxx   |  119 ---
 14 files changed, 167 insertions(+), 235 deletions(-)

New commits:
commit 59b0153d93d0cbc3dffd1e5d7df125c5f0360497
Author: Noel Grandin 
AuthorDate: Fri May 12 11:00:22 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri May 12 15:33:35 2023 +0200

avoid some dynamic_cast in XTextRangeToSwPaM

by re-arranging so we only do the dynamic_cast when we need it

Change-Id: I7e37e3ab014032ba231dec03d470b45a4531ffcd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151697
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/core/unocore/unoobj2.cxx 
b/sw/source/core/unocore/unoobj2.cxx
index cff5963ede62..210e62655a15 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -1091,18 +1091,14 @@ bool XTextRangeToSwPaM( SwUnoInternalPaM & rToFill,
 {
 bool bRet = false;
 
-SwXTextRange* pRange = dynamic_cast(xTextRange.get());
-OTextCursorHelper* pCursor = 
dynamic_cast(xTextRange.get());
-SwXTextPortion* pPortion = dynamic_cast(xTextRange.get());
-SwXText* pText = dynamic_cast(xTextRange.get());
-SwXParagraph* pPara = dynamic_cast(xTextRange.get());
 SwXHeadFootText* pHeadText
-= eMode == TextRangeMode::AllowTableNode ? 
dynamic_cast(pText) : nullptr;
+= eMode == TextRangeMode::AllowTableNode ? 
dynamic_cast(xTextRange.get()) : nullptr;
 
 // if it's a text then create a temporary cursor there and re-use
 // the pCursor variable
 // #i108489#: Reference in outside scope to keep cursor alive
 rtl::Reference< SwXTextCursor > xTextCursor;
+OTextCursorHelper* pCursor;
 if (pHeadText)
 {
 // if it is a header / footer text, and eMode == 
TextRangeMode::AllowTableNode
@@ -1113,43 +1109,53 @@ bool XTextRangeToSwPaM( SwUnoInternalPaM & rToFill,
 pCursor = xTextCursor.get();
 pCursor->GetPaM()->Normalize();
 }
-else if (pText)
+else if (SwXText* pText = dynamic_cast(xTextRange.get()))
 {
 xTextCursor = pText->createXTextCursor();
 xTextCursor->gotoEnd(true);
 pCursor = xTextCursor.get();
 }
+else
+{
+pCursor = dynamic_cast(xTextRange.get());
+}
 
+SwXTextRange* pRange = dynamic_cast(xTextRange.get());
 if(pRange && >GetDoc() == ())
 {
 bRet = pRange->GetPositions(rToFill, eMode);
 }
+else if (SwXParagraph* pPara = 
dynamic_cast(xTextRange.get()))
+{
+bRet = pPara->SelectPaM(rToFill);
+}
 else
 {
-if (pPara)
+SwDoc* pDoc = nullptr;
+const SwPaM* pUnoCursor = nullptr;
+if (pCursor)
 {
-bRet = pPara->SelectPaM(rToFill);
+pDoc = pCursor->GetDoc();
+pUnoCursor = pCursor->GetPaM();
 }
-else
+else if (SwXTextPortion* pPortion = 
dynamic_cast(xTextRange.get()))
 {
-SwDoc* const pDoc = pCursor ? pCursor->GetDoc()
-: (pPortion ? >GetCursor().GetDoc() : nullptr);
-const SwPaM* const pUnoCursor = pCursor ? pCursor->GetPaM()
-: (pPortion ? >GetCursor() : nullptr);
-if (pUnoCursor && pDoc == ())
+pDoc = >GetCursor().GetDoc();
+pUnoCursor = >GetCursor();
+}
+if (pUnoCursor && pDoc == ())
+{
+OSL_ENSURE(!pUnoCursor->IsMultiSelection(),
+"what to do about rings?");
+bRet = true;
+*rToFill.GetPoint() = *pUnoCursor->GetPoint();
+if (pUnoCursor->HasMark())
 {
-OSL_ENSURE(!pUnoCursor->IsMultiSelection(),
-"what to do about rings?");
-bRet = true;
-*rToFill.GetPoint() = *pUnoCursor->GetPoint();
-if (pUnoCursor->HasMark())
-{
-rToFill.SetMark();
-*rToFill.GetMark() = *pUnoCursor->GetMark();
-}
-else
-rToFill.DeleteMark();
+rToFill.SetMark();
+*rToFill.GetMark() = *pUnoCursor->GetMark();
 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2023-04-19 Thread Noel Grandin (via logerrit)
 sw/inc/tblafmt.hxx  |   10 +-
 sw/inc/unostyle.hxx |3 ++-
 sw/source/core/doc/tblafmt.cxx  |5 +
 sw/source/core/unocore/unostyle.cxx |9 +
 4 files changed, 17 insertions(+), 10 deletions(-)

New commits:
commit 55adcc8d5671c2710b22d25866b9ce90cc8bedc9
Author: Noel Grandin 
AuthorDate: Tue Apr 18 21:46:05 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 19 09:03:30 2023 +0200

use more concrete UNO type in SwTableAutoFormat

Change-Id: I5c36a268a76afcf7af5829dc7f873f4410f68298
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150588
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index d007130f1fa8..dbbec1909ae2 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -44,6 +44,7 @@ struct SwAfVersions;
 class SvNumberFormatter;
 class SwTable;
 class SwXTextCellStyle;
+class SwXTextTableStyle;
 
 class SW_DLLPUBLIC SwBoxAutoFormat : public AutoFormatBase
 {
@@ -156,7 +157,7 @@ class SW_DLLPUBLIC SwTableAutoFormat
 friend void FinitCore();   // To destroy default pointer.
 static SwBoxAutoFormat* s_pDefaultBoxAutoFormat;
 
-css::uno::WeakReference m_wXObject;
+unotools::WeakReference m_xUnoTextTableStyle;
 
 OUString m_aName;
 sal_uInt16 m_nStrResId;
@@ -246,10 +247,9 @@ public:
 bool Load( SvStream& rStream, const SwAfVersions& );
 bool Save( SvStream& rStream, sal_uInt16 fileVersion ) const;
 
-css::uno::WeakReference const& GetXObject() const
-{ return m_wXObject; }
-void SetXObject(css::uno::Reference const& xObject)
-{ m_wXObject = xObject; }
+unotools::WeakReference const& GetXObject() const
+{ return m_xUnoTextTableStyle; }
+void SetXObject(rtl::Reference const& xObject);
 
 /// Returns the cell's name postfix. eg. ".1"
 OUString GetTableTemplateCellSubName(const SwBoxAutoFormat& rBoxFormat) 
const;
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 858441f87b6c..7233c788e380 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -922,6 +922,11 @@ sal_uInt8 SwTableAutoFormat::CountPos(sal_uInt32 nCol, 
sal_uInt32 nCols, sal_uIn
 return nRet;
 }
 
+void SwTableAutoFormat::SetXObject(rtl::Reference const& 
xObject)
+{
+m_xUnoTextTableStyle = xObject.get();
+}
+
 struct SwTableAutoFormatTable::Impl
 {
 std::vector> m_AutoFormats;
diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index dfe82b61d858..8a916cf589ef 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -4285,11 +4285,11 @@ SwXTextTableStyle::SwXTextTableStyle(SwDocShell* 
pDocShell, const OUString& rTab
 uno::Reference 
SwXTextTableStyle::CreateXTextTableStyle(SwDocShell* pDocShell, const OUString& 
rTableAutoFormatName)
 {
 SolarMutexGuard aGuard;
-uno::Reference xTextTableStyle;
+rtl::Reference xTextTableStyle;
 SwTableAutoFormat* pAutoFormat = GetTableAutoFormat(pDocShell, 
rTableAutoFormatName);
 if (pAutoFormat && pAutoFormat->GetName() == rTableAutoFormatName)
 {
-xTextTableStyle.set(pAutoFormat->GetXObject(), uno::UNO_QUERY);
+xTextTableStyle = pAutoFormat->GetXObject();
 if (!xTextTableStyle.is())
 {
 xTextTableStyle.set(new SwXTextTableStyle(pDocShell, pAutoFormat));
@@ -4392,7 +4392,7 @@ void SwXTextTableStyle::SetPhysical()
 }
 m_pTableAutoFormat_Impl = nullptr;
 m_pTableAutoFormat = pTableAutoFormat;
-
m_pTableAutoFormat->SetXObject(uno::Reference(this));
+m_pTableAutoFormat->SetXObject(this);
 }
 else
 SAL_WARN("sw.uno", "setting style physical, but SwTableAutoFormat 
in document not found");
commit 7f3df1a07dd55ebff1c9c572d3ec93e06dfe854b
Author: Noel Grandin 
AuthorDate: Tue Apr 18 21:25:30 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 19 09:03:20 2023 +0200

use more concrete UNO type in SwXTextTableStyle

Change-Id: I19b556a5fc2ee9f475478b16e228aa3670146551
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150587
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx
index 2c936486032e..bcd2c96aba6a 100644
--- a/sw/inc/unostyle.hxx
+++ b/sw/inc/unostyle.hxx
@@ -18,6 +18,7 @@
  */
 #pragma once
 
+#include 
 #include 
 #include 
 #include "unocoll.hxx"
@@ -267,7 +268,7 @@ class SwXTextTableStyle final : public cppu::WeakImplHelper
 /// Fills m_aCellStyles with SwXTextCellStyles pointing to children of 
this style.
 void UpdateCellStylesMapping();
 static const CellStyleNameMap& GetCellStyleNameMap();
-css::uno::Reference m_aCellStyles[STYLE_COUNT];
+rtl::Reference m_aCellStyles[STYLE_COUNT];
 public:
 SwXTextTableStyle(SwDocShell* pDocShell, SwTableAutoFormat* 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2023-01-20 Thread Noel Grandin (via logerrit)
 sw/inc/unotextrange.hxx |   10 +-
 sw/source/core/inc/unobookmark.hxx  |   10 +-
 sw/source/core/unocore/unobkm.cxx   |   20 +++-
 sw/source/core/unocore/unocontentcontrol.cxx|3 +--
 sw/source/core/unocore/unocrsrhelper.cxx|4 ++--
 sw/source/core/unocore/unodraw.cxx  |2 +-
 sw/source/core/unocore/unofield.cxx |3 +--
 sw/source/core/unocore/unoframe.cxx |3 +--
 sw/source/core/unocore/unoftn.cxx   |8 ++--
 sw/source/core/unocore/unoidx.cxx   |7 ++-
 sw/source/core/unocore/unoobj.cxx   |3 +--
 sw/source/core/unocore/unoobj2.cxx  |   15 +--
 sw/source/core/unocore/unorefmk.cxx |7 ++-
 sw/source/core/unocore/unosect.cxx  |3 +--
 sw/source/core/unocore/unotbl.cxx   |3 +--
 sw/source/core/unocore/unotext.cxx  |   24 +++-
 sw/source/core/unocore/unotextmarkup.cxx|4 +---
 sw/source/filter/xml/XMLRedlineImportHelper.cxx |6 ++
 sw/source/uibase/uno/unoatxt.cxx|   10 --
 sw/source/uibase/uno/unotxdoc.cxx   |3 +--
 sw/source/uibase/uno/unotxvw.cxx|3 +--
 21 files changed, 37 insertions(+), 114 deletions(-)

New commits:
commit 048dd914c251ef62d7cebf4d35ded3549bf42110
Author: Noel Grandin 
AuthorDate: Thu Jan 19 10:12:30 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Jan 20 08:20:29 2023 +

XUnoTunnel->dynamic_cast in SwXBookmark

Change-Id: Iaf544314d0c47209b254c3bb40d35c03e6556f5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145858
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/core/inc/unobookmark.hxx 
b/sw/source/core/inc/unobookmark.hxx
index aa3ef430387a..d1d800d9a28e 100644
--- a/sw/source/core/inc/unobookmark.hxx
+++ b/sw/source/core/inc/unobookmark.hxx
@@ -19,7 +19,6 @@
 
 #pragma once
 
-#include 
 #include 
 #include 
 #include 
@@ -40,7 +39,6 @@ class SwXTextRange;
 
 typedef ::cppu::ImplInheritanceHelper
 <   ::sfx2::MetadatableMixin
-,   css::lang::XUnoTunnel
 ,   css::lang::XServiceInfo
 ,   css::beans::XPropertySet
 ,   css::container::XNamed
@@ -91,18 +89,12 @@ public:
 
 /// @return IMark for this, but only if it lives in pDoc
 static ::sw::mark::IMark const* GetBookmarkInDoc(SwDoc const*const pDoc,
-const css::uno::Reference & xUT);
+const css::uno::Reference & xUT);
 
 // MetadatableMixin
 virtual ::sfx2::Metadatable* GetCoreObject() override;
 virtual css::uno::Reference< css::frame::XModel > GetModel() override;
 
-static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
-
-// XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething(
-const css::uno::Sequence< sal_Int8 >& rIdentifier) override;
-
 // XServiceInfo
 virtual OUString SAL_CALL getImplementationName() override;
 virtual sal_Bool SAL_CALL supportsService(
diff --git a/sw/source/core/unocore/unobkm.cxx 
b/sw/source/core/unocore/unobkm.cxx
index 7eb1f4d05480..ed99a076244a 100644
--- a/sw/source/core/unocore/unobkm.cxx
+++ b/sw/source/core/unocore/unobkm.cxx
@@ -182,10 +182,9 @@ rtl::Reference SwXBookmark::CreateXBookmark(
 }
 
 ::sw::mark::IMark const* SwXBookmark::GetBookmarkInDoc(SwDoc const*const pDoc,
-const uno::Reference< lang::XUnoTunnel> & xUT)
+const uno::Reference & xUT)
 {
-SwXBookmark *const pXBkm(
-comphelper::getFromUnoTunnel(xUT));
+SwXBookmark *const pXBkm = dynamic_cast(xUT.get());
 if (pXBkm && (pDoc == pXBkm->m_pImpl->m_pDoc))
 {
 return pXBkm->m_pImpl->m_pRegisteredBookmark;
@@ -193,17 +192,6 @@ rtl::Reference SwXBookmark::CreateXBookmark(
 return nullptr;
 }
 
-const uno::Sequence< sal_Int8 > & SwXBookmark::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit theSwXBookmarkUnoTunnelId;
-return theSwXBookmarkUnoTunnelId.getSeq();
-}
-
-sal_Int64 SAL_CALL SwXBookmark::getSomething( const uno::Sequence< sal_Int8 >& 
rId )
-{
-return comphelper::getSomethingImpl(rId, this);
-}
-
 void SwXBookmark::attachToRangeEx(
 const uno::Reference< text::XTextRange > & xTextRange,
 IDocumentMarkAccess::MarkType eType,
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx 
b/sw/source/core/unocore/unocrsrhelper.cxx
index df73ee184c04..1e37c4015b1d 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -256,8 +256,8 @@ void GetSelectableFromAny(uno::Reference 
const& xIfc,
 return;
 }
 
-::sw::mark::IMark const*const pMark(
-SwXBookmark::GetBookmarkInDoc(& rTargetDoc, xTunnel));
+::sw::mark::IMark const*const pMark =
+SwXBookmark::GetBookmarkInDoc(& rTargetDoc, xIfc);
 if (pMark)
 {
 o_rpMark = pMark;
diff --git 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2023-01-19 Thread Noel Grandin (via logerrit)
 sw/inc/unotbl.hxx|   19 +++
 sw/source/core/unocore/unocrsrhelper.cxx |6 ++
 sw/source/core/unocore/unotbl.cxx|   30 +-
 sw/source/core/unocore/unotext.cxx   |   12 
 sw/source/filter/xml/xmltble.cxx |3 +--
 sw/source/filter/xml/xmltbli.cxx |2 +-
 sw/source/ui/vba/vbatablehelper.cxx  |3 +--
 7 files changed, 13 insertions(+), 62 deletions(-)

New commits:
commit 7d2bee35c46018e9699d76f117f9a80f71cb4597
Author: Noel Grandin 
AuthorDate: Wed Jan 18 15:21:27 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 19 17:56:25 2023 +

XUnoTunnel->dynamic_cast in SwXTextTable

Change-Id: I18c229f31738707e4a379c9379425141ba4dc690
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145787
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx
index c9483a020bfc..d7074b5919bf 100644
--- a/sw/inc/unotbl.hxx
+++ b/sw/inc/unotbl.hxx
@@ -246,7 +246,7 @@ struct SwRangeDescriptor
 void Normalize();
 };
 
-class SAL_DLLPUBLIC_RTTI SwXTextTable final : public cppu::WeakImplHelper
+class SW_DLLPUBLIC SwXTextTable final : public cppu::WeakImplHelper
 <
 css::text::XTextTable,
 css::lang::XServiceInfo,
@@ -256,7 +256,6 @@ class SAL_DLLPUBLIC_RTTI SwXTextTable final : public 
cppu::WeakImplHelper
 css::container::XNamed,
 css::table::XAutoFormattable,
 css::util::XSortable,
-css::lang::XUnoTunnel,
 css::sheet::XCellRangeData
 >
 {
@@ -272,15 +271,9 @@ public:
 static rtl::Reference
 CreateXTextTable(SwFrameFormat * pFrameFormat);
 
-SW_DLLPUBLIC static const css::uno::Sequence< sal_Int8 > & 
getUnoTunnelId();
-
-SW_DLLPUBLIC static void GetCellPosition(std::u16string_view aCellName, 
sal_Int32& o_rColumn, sal_Int32& o_rRow);
-
-SW_DLLPUBLIC SwFrameFormat* GetFrameFormat();
-
-//XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override;
+static void GetCellPosition(std::u16string_view aCellName, sal_Int32& 
o_rColumn, sal_Int32& o_rRow);
 
+SwFrameFormat* GetFrameFormat();
 
 //XTextTable
 virtual void SAL_CALL initialize( sal_Int32 nRows, sal_Int32 nColumns ) 
override;
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx 
b/sw/source/core/unocore/unocrsrhelper.cxx
index 0c4721c954bd..d41bf32e4ba9 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -202,8 +202,7 @@ void GetSelectableFromAny(uno::Reference 
const& xIfc,
 return;
 }
 
-SwXTextTable *const pTextTable(
-comphelper::getFromUnoTunnel(xTunnel));
+SwXTextTable *const pTextTable = dynamic_cast(xIfc.get());
 if (pTextTable)
 {
 SwFrameFormat *const pFrameFormat(pTextTable->GetFrameFormat());
diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index 18fde41a8e7a..0aaedfa8b8d3 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -1947,18 +1947,6 @@ public:
 
 };
 
-const uno::Sequence< sal_Int8 > & SwXTextTable::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit theSwXTextTableUnoTunnelId;
-return theSwXTextTableUnoTunnelId.getSeq();
-}
-
-sal_Int64 SAL_CALL SwXTextTable::getSomething( const uno::Sequence< sal_Int8 
>& rId )
-{
-return comphelper::getSomethingImpl(rId, this);
-}
-
-
 SwXTextTable::SwXTextTable()
 : m_pImpl(new Impl(nullptr))
 {
@@ -2072,7 +2060,7 @@ SwXTextTable::attach(const 
uno::Reference & xTextRange)
 if (!m_pImpl->IsDescriptor())  /* already attached ? */
 throw uno::RuntimeException("SwXTextTable: already attached to 
range.", static_cast(this));
 
-uno::Reference xRangeTunnel(xTextRange, uno::UNO_QUERY);
+uno::Reference xRangeTunnel(xTextRange, uno::UNO_QUERY);
 SwXTextRange* 
pRange(comphelper::getFromUnoTunnel(xRangeTunnel));
 OTextCursorHelper* 
pCursor(dynamic_cast(xTextRange.get()));
 SwDoc* pDoc = pRange ? >GetDoc() : pCursor ? pCursor->GetDoc() : 
nullptr;
diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index 6248e0dfc8e3..52df5295dea7 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -647,8 +647,7 @@ SwXText::insertTextContentBefore(
 uno::UNO_QUERY);
 SwXTextSection *const pXSection =
 comphelper::getFromUnoTunnel(xSuccTunnel);
-SwXTextTable *const pXTable =
-comphelper::getFromUnoTunnel(xSuccTunnel);
+SwXTextTable *const pXTable = 
dynamic_cast(xSuccessor.get());
 SwFrameFormat *const pTableFormat = pXTable ? pXTable->GetFrameFormat() : 
nullptr;
 SwTextNode * pTextNode = nullptr;
 if(pTableFormat && pTableFormat->GetDoc() == GetDoc())
@@ -701,8 +700,7 @@ SwXText::insertTextContentAfter(
 uno::UNO_QUERY);
 SwXTextSection 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2023-01-19 Thread Noel Grandin (via logerrit)
 sw/inc/unosett.hxx   |   10 ++
 sw/inc/unosrch.hxx   |9 +
 sw/source/core/unocore/unocrsrhelper.cxx |2 +-
 sw/source/core/unocore/unosett.cxx   |   16 
 sw/source/core/unocore/unosrch.cxx   |   11 ---
 sw/source/core/unocore/unostyle.cxx  |6 +++---
 sw/source/uibase/uno/unotxdoc.cxx|5 ++---
 sw/source/uibase/utlui/uiitems.cxx   |2 +-
 8 files changed, 10 insertions(+), 51 deletions(-)

New commits:
commit bc87e206f4201cbd3d4df8f14355fb29643768f7
Author: Noel Grandin 
AuthorDate: Wed Jan 18 15:13:06 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 19 17:56:04 2023 +

XUnoTunnel->dynamic_cast in SwXTextSearch

Change-Id: Id9d80bac06377018eaf768bdbd68e98b1de0666b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145782
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/unosrch.hxx b/sw/inc/unosrch.hxx
index ac8623160fa0..169903764377 100644
--- a/sw/inc/unosrch.hxx
+++ b/sw/inc/unosrch.hxx
@@ -21,7 +21,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -37,8 +36,7 @@ namespace i18nutil {
 class SwXTextSearch final : public cppu::WeakImplHelper
 <
 css::util::XPropertyReplace,
-css::lang::XServiceInfo,
-css::lang::XUnoTunnel
+css::lang::XServiceInfo
 >
 {
 friend class SwXTextDocument;
@@ -68,11 +66,6 @@ class SwXTextSearch final : public cppu::WeakImplHelper
 public:
 SwXTextSearch();
 
-static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
-
-//XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override;
-
 //XSearchDescriptor
 virtual OUString SAL_CALL getSearchString(  ) override;
 virtual void SAL_CALL setSearchString( const OUString& aString ) override;
diff --git a/sw/source/core/unocore/unosrch.cxx 
b/sw/source/core/unocore/unosrch.cxx
index ee260c077b61..e7684861b5c9 100644
--- a/sw/source/core/unocore/unosrch.cxx
+++ b/sw/source/core/unocore/unosrch.cxx
@@ -346,17 +346,6 @@ namespace
 {
 }
 
-const uno::Sequence< sal_Int8 > & SwXTextSearch::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit theSwXTextSearchUnoTunnelId;
-return theSwXTextSearchUnoTunnelId.getSeq();
-}
-
-sal_Int64 SAL_CALL SwXTextSearch::getSomething( const uno::Sequence< sal_Int8 
>& rId )
-{
-return comphelper::getSomethingImpl(rId, this);
-}
-
 OUString SwXTextSearch::getSearchString()
 {
 SolarMutexGuard aGuard;
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 6b5b52d105dd..b19827e1ad74 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -696,9 +696,8 @@ SwUnoCursor* 
SwXTextDocument::CreateCursorForSearch(Reference< XTextCursor > & x
 sal_Int32 SwXTextDocument::replaceAll(const Reference< util::XSearchDescriptor 
> & xDesc)
 {
 SolarMutexGuard aGuard;
-Reference< XUnoTunnel > xDescTunnel(xDesc, UNO_QUERY_THROW);
 SwXTextSearch* pSearch;
-if (!IsValid() || !(pSearch = 
comphelper::getFromUnoTunnel(xDescTunnel)))
+if (!IsValid() || !(pSearch = dynamic_cast(xDesc.get(
 throw DisposedException("", static_cast< XTextDocument* >(this));
 
 Reference< XTextCursor >  xCursor;
@@ -770,7 +769,7 @@ SwUnoCursor* SwXTextDocument::FindAny(const Reference< 
util::XSearchDescriptor >
  sal_Int32& nResult,
  Reference< XInterface > const & 
xLastResult)
 {
-const auto pSearch = comphelper::getFromUnoTunnel(xDesc);
+const auto pSearch = dynamic_cast(xDesc.get());
 if(!IsValid() || !pSearch)
 return nullptr;
 
commit 9ebf0023e663b18f06631dbd4fd5782a626c2458
Author: Noel Grandin 
AuthorDate: Wed Jan 18 12:45:10 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 19 17:55:53 2023 +

XUnoTunnel->dynamic_cast in SwXNumberingRules

Change-Id: If22cf501522115ebd87dee8580831750ea8bbbd5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145781
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx
index fcaed54b1bfe..590046b97412 100644
--- a/sw/inc/unosett.hxx
+++ b/sw/inc/unosett.hxx
@@ -26,12 +26,11 @@
 #include "swtypes.hxx"
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
-#include 
+#include 
 #include "unobaseclass.hxx"
 
 class SwDoc;
@@ -132,10 +131,9 @@ public:
 voidInvalidate() {m_pDoc = nullptr;}
 };
 
-class SwXNumberingRules : public cppu::WeakAggImplHelper5
+class SwXNumberingRules : public cppu::WeakAggImplHelper4
 <
 css::container::XIndexReplace,
-css::lang::XUnoTunnel,
 css::beans::XPropertySet,
 css::container::XNamed,
 css::lang::XServiceInfo
@@ -161,10 +159,6 @@ public:
 SwXNumberingRules(const SwNumRule& rRule, SwDoc* doc = nullptr); // 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2023-01-19 Thread Noel Grandin (via logerrit)
 sw/inc/unochart.hxx |   17 ++--
 sw/inc/unoparagraph.hxx |8 -
 sw/source/core/unocore/unochart.cxx |   43 ++--
 sw/source/core/unocore/unodraw.cxx  |2 -
 sw/source/core/unocore/unoobj2.cxx  |2 -
 sw/source/core/unocore/unoparagraph.cxx |   12 
 sw/source/core/unocore/unotext.cxx  |6 +---
 sw/source/uibase/uno/unotxvw.cxx|2 -
 8 files changed, 34 insertions(+), 58 deletions(-)

New commits:
commit 70eb1c9838bf9ab7650318381e7d48f811e761d4
Author: Noel Grandin 
AuthorDate: Wed Jan 18 12:41:50 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 19 17:55:44 2023 +

XUnoTunnel->dynamic_cast in SwXParagraph

Change-Id: Ib39e51900826b13824906c33775a8aa375955fcd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145780
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/unoparagraph.hxx b/sw/inc/unoparagraph.hxx
index ab1bb903a7cd..860edc18e938 100644
--- a/sw/inc/unoparagraph.hxx
+++ b/sw/inc/unoparagraph.hxx
@@ -22,7 +22,6 @@
 
 #include 
 
-#include 
 #include 
 #include 
 #include 
@@ -49,7 +48,6 @@ class SwXTextPortionEnumeration;
 
 typedef ::cppu::ImplInheritanceHelper
 <   ::sfx2::MetadatableMixin
-,   css::lang::XUnoTunnel
 ,   css::lang::XServiceInfo
 ,   css::beans::XPropertySet
 ,   css::beans::XPropertyState
@@ -99,12 +97,6 @@ public:
 virtual css::uno::Reference< css::frame::XModel >
 GetModel() override;
 
-static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
-
-// XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething(
-const css::uno::Sequence< sal_Int8 >& rIdentifier) override;
-
 // XServiceInfo
 virtual OUString SAL_CALL getImplementationName() override;
 virtual sal_Bool SAL_CALL supportsService(
diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index 00685756c39d..a11dff3a87cc 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1995,7 +1995,7 @@ void SwXShape::attach(const uno::Reference< 
text::XTextRange > & xTextRange)
 pDoc = pCursor->GetDoc();
 else if (auto pPortion = 
comphelper::getFromUnoTunnel(xRangeTunnel))
 pDoc = >GetCursor().GetDoc();
-else if (auto pParagraph = 
comphelper::getFromUnoTunnel(xRangeTunnel);
+else if (auto pParagraph = dynamic_cast(xTextRange.get());
  pParagraph && pParagraph->GetTextNode())
 pDoc = >GetTextNode()->GetDoc();
 
diff --git a/sw/source/core/unocore/unoobj2.cxx 
b/sw/source/core/unocore/unoobj2.cxx
index a40e92a92cec..87abdf72ffd1 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -,7 +,7 @@ bool XTextRangeToSwPaM( SwUnoInternalPaM & rToFill,
 OTextCursorHelper* pCursor = 
dynamic_cast(xTextRange.get());
 SwXTextPortion* pPortion = 
comphelper::getFromUnoTunnel(xRangeTunnel);
 SwXText* pText = dynamic_cast(xTextRange.get());
-SwXParagraph* pPara = 
comphelper::getFromUnoTunnel(xRangeTunnel);
+SwXParagraph* pPara = dynamic_cast(xTextRange.get());
 SwXHeadFootText* pHeadText
 = eMode == TextRangeMode::AllowTableNode ? 
dynamic_cast(pText) : nullptr;
 
diff --git a/sw/source/core/unocore/unoparagraph.cxx 
b/sw/source/core/unocore/unoparagraph.cxx
index a41f11ef873c..55c71ca730a4 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -295,18 +295,6 @@ bool SwXParagraph::SelectPaM(SwPaM & rPaM)
 return true;
 }
 
-const uno::Sequence< sal_Int8 > & SwXParagraph::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit theSwXParagraphUnoTunnelId;
-return theSwXParagraphUnoTunnelId.getSeq();
-}
-
-sal_Int64 SAL_CALL
-SwXParagraph::getSomething(const uno::Sequence< sal_Int8 >& rId)
-{
-return comphelper::getSomethingImpl(rId, this);
-}
-
 OUString SAL_CALL
 SwXParagraph::getImplementationName()
 {
diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index b38c14c9e5fe..6248e0dfc8e3 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -636,8 +636,7 @@ SwXText::insertTextContentBefore(
 throw aRuntime;
 }
 
-SwXParagraph *const pPara =
-comphelper::getFromUnoTunnel(xNewContent);
+SwXParagraph *const pPara = dynamic_cast(xNewContent.get());
 if (!pPara || !pPara->IsDescriptor() || !xSuccessor.is())
 {
 throw lang::IllegalArgumentException();
@@ -692,8 +691,7 @@ SwXText::insertTextContentAfter(
 throw uno::RuntimeException();
 }
 
-SwXParagraph *const pPara =
-comphelper::getFromUnoTunnel(xNewContent);
+SwXParagraph *const pPara = dynamic_cast(xNewContent.get());
 if(!pPara || !pPara->IsDescriptor() || !xPredecessor.is())
 {
 throw lang::IllegalArgumentException();
diff --git 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2022-10-29 Thread Noel Grandin (via logerrit)
 sw/inc/calbck.hxx   |7 +++
 sw/inc/swtable.hxx  |3 +++
 sw/source/filter/xml/XMLRedlineImportHelper.cxx |2 +-
 sw/source/filter/xml/xmlfmt.cxx |8 
 sw/source/filter/xml/xmlimp.cxx |   12 +---
 sw/source/filter/xml/xmlimp.hxx |4 
 sw/source/filter/xml/xmlmeta.cxx|2 +-
 sw/source/filter/xml/xmltbli.cxx|4 ++--
 sw/source/filter/xml/xmltexti.cxx   |4 ++--
 9 files changed, 21 insertions(+), 25 deletions(-)

New commits:
commit 2c4aabb220ad1e8f1cbc75f2361fe17893d7cc29
Author: Noel Grandin 
AuthorDate: Sat Oct 29 11:11:36 2022 +0200
Commit: Noel Grandin 
CommitDate: Sat Oct 29 18:10:42 2022 +0200

tdf#126788 speed up GetDocFromXMLImport

we can just static_cast to SwXMLImport, no need to use XUnoTunnel

Change-Id: I5ca1a1e2d63ae632578261630f67c9d164727cef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142016
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx 
b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index e681f2025b6c..5b7b008129b5 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -343,7 +343,7 @@ XMLRedlineImportHelper::~XMLRedlineImportHelper()
 aAny <<= true;
 m_xModelPropertySet->setPropertyValue( g_sShowChanges, aAny );
 // TODO maybe we need some property for the view-setting?
-SwDoc *const pDoc(SwImport::GetDocFromXMLImport(m_rImport));
+SwDoc *const pDoc(static_cast(m_rImport).getDoc());
 assert(pDoc);
 pDoc->GetDocumentRedlineManager().SetHideRedlines(!m_bShowChanges);
 }
diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx
index ac12df0779bf..8d21591e12b9 100644
--- a/sw/source/filter/xml/xmlfmt.cxx
+++ b/sw/source/filter/xml/xmlfmt.cxx
@@ -525,7 +525,7 @@ SvXMLImportContext 
*SwXMLItemSetStyleContext_Impl::CreateItemSetContext(
 
 SvXMLImportContext *pContext = nullptr;
 
-SwDoc* pDoc = SwImport::GetDocFromXMLImport( GetSwImport() );
+SwDoc* pDoc = GetSwImport().getDoc();
 
 SfxItemPool& rItemPool = pDoc->GetAttrPool();
 switch( GetFamily() )
@@ -615,7 +615,7 @@ void SwXMLItemSetStyleContext_Impl::ConnectPageDesc()
 return;
 m_bPageDescConnected = true;
 
-SwDoc *pDoc = SwImport::GetDocFromXMLImport( GetSwImport() );
+SwDoc *pDoc = GetSwImport().getDoc();
 
 // #i40788# - first determine the display name of the page style,
 // then map this name to the corresponding user interface name.
@@ -673,7 +673,7 @@ bool SwXMLItemSetStyleContext_Impl::ResolveDataStyleName()
 {
 if( !m_oItemSet )
 {
-SwDoc *pDoc = SwImport::GetDocFromXMLImport( GetSwImport() );
+SwDoc *pDoc = GetSwImport().getDoc();
 
 SfxItemPool& rItemPool = pDoc->GetAttrPool();
 m_oItemSet.emplace( rItemPool, aTableBoxSetRange );
@@ -1006,7 +1006,7 @@ void SwXMLImport::FinishStyles()
 void SwXMLImport::UpdateTextCollConditions( SwDoc *pDoc )
 {
 if( !pDoc )
-pDoc = SwImport::GetDocFromXMLImport( *this );
+pDoc = getDoc();
 
 const SwTextFormatColls& rColls = *pDoc->GetTextFormatColls();
 const size_t nCount = rColls.size();
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 62263ce2737f..1fa30ceedfdd 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -828,7 +828,7 @@ void SwXMLImport::endDocument()
 // tdf#150753: pDoc may be null e.g. when the package lacks content.xml;
 // we should not forget to tidy up here, including unlocking draw model
 if (!pDoc)
-pDoc = SwImport::GetDocFromXMLImport(*this);
+pDoc = getDoc();
 assert(pDoc);
 // SJ: #i49801# -> now permitting repaints
 if (getImportFlags() == SvXMLImportFlags::ALL)
@@ -1632,16 +1632,6 @@ void SwXMLImport::initialize(
 }
 }
 
-SwDoc* SwImport::GetDocFromXMLImport( SvXMLImport const & rImport )
-{
-auto pTextDoc = 
comphelper::getFromUnoTunnel(rImport.GetModel());
-assert( pTextDoc );
-assert( pTextDoc->GetDocShell() );
-SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
-OSL_ENSURE( pDoc, "Where is my document?" );
-return pDoc;
-}
-
 void SwXMLImport::initXForms()
 {
 // obtain SwDoc
diff --git a/sw/source/filter/xml/xmlimp.hxx b/sw/source/filter/xml/xmlimp.hxx
index d5e988badeb7..22f012c4dbfc 100644
--- a/sw/source/filter/xml/xmlimp.hxx
+++ b/sw/source/filter/xml/xmlimp.hxx
@@ -48,10 +48,6 @@ enum class SfxStyleFamily;
 // for styles, autostyles and settings + meta
 #define PROGRESS_BAR_STEP 20
 
-namespace SwImport {
-SwDoc* GetDocFromXMLImport( SvXMLImport const & );
-}
-
 // we 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2022-10-29 Thread Noel Grandin (via logerrit)
 sw/inc/swcrsr.hxx   |8 
 sw/source/core/unocore/unoparagraph.cxx |   17 ++---
 2 files changed, 14 insertions(+), 11 deletions(-)

New commits:
commit 32b0b79c3f71e4aca995aa92ee519d93a3ca2b3b
Author: Noel Grandin 
AuthorDate: Sat Oct 29 11:10:13 2022 +0200
Commit: Noel Grandin 
CommitDate: Sat Oct 29 18:10:23 2022 +0200

tdf#126788 replace dynamic_cast with static_cast

no need to dynamic_cast here

Change-Id: I36b2c20c0f8743c39a8b8b0f14a9eb2ee6effee7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142015
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx
index 486507b23c4e..e2b5ad10966a 100644
--- a/sw/inc/swcrsr.hxx
+++ b/sw/inc/swcrsr.hxx
@@ -216,10 +216,10 @@ public:
 
 sal_Int32 GetCursorRowSpanOffset() const { return m_nRowSpanOffset; }
 
-SwCursor* GetNext() { return dynamic_cast(GetNextInRing()); }
-const SwCursor* GetNext() const { return dynamic_cast(GetNextInRing()); }
-SwCursor* GetPrev() { return dynamic_cast(GetPrevInRing()); }
-const SwCursor* GetPrev() const { return dynamic_cast(GetPrevInRing()); }
+SwCursor* GetNext() { return static_cast(GetNextInRing()); }
+const SwCursor* GetNext() const { return static_cast(GetNextInRing()); }
+SwCursor* GetPrev() { return static_cast(GetPrevInRing()); }
+const SwCursor* GetPrev() const { return static_cast(GetPrevInRing()); }
 };
 
 /**
commit ebe2a3e948df1622f3532afeeaeb31d1066d40c2
Author: Noel Grandin 
AuthorDate: Sat Oct 29 13:23:28 2022 +0200
Commit: Noel Grandin 
CommitDate: Sat Oct 29 18:10:10 2022 +0200

tdf#126788 check if we need to fire an event

before calling the rather expensive weak->reference conversion

Change-Id: I83f22ae3a016f4d44bf1589339d6dc31579cc9e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142019
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/core/unocore/unoparagraph.cxx 
b/sw/source/core/unocore/unoparagraph.cxx
index 866d5aad23f2..7f8aa247260c 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -189,14 +189,17 @@ void SwXParagraph::Impl::Notify(const SfxHint& rHint)
 if(rHint.GetId() == SfxHintId::Dying)
 {
 m_pTextNode = nullptr;
-uno::Reference const xThis(m_wThis);
-if (!xThis.is())
-{   // fdo#72695: if UNO object is already dead, don't revive it with 
event
-return;
-}
-lang::EventObject const ev(xThis);
 std::unique_lock aGuard(m_Mutex);
-m_EventListeners.disposeAndClear(aGuard, ev);
+if (m_EventListeners.getLength(aGuard) != 0)
+{
+uno::Reference const xThis(m_wThis);
+if (!xThis.is())
+{   // fdo#72695: if UNO object is already dead, don't revive it 
with event
+return;
+}
+lang::EventObject const ev(xThis);
+m_EventListeners.disposeAndClear(aGuard, ev);
+}
 }
 }
 


[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2022-10-07 Thread Noel Grandin (via logerrit)
 sw/inc/redline.hxx  |2 
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   10 -
 sw/source/core/doc/docredln.cxx |  156 
 sw/source/core/frmedt/fefly1.cxx|   12 -
 4 files changed, 89 insertions(+), 91 deletions(-)

New commits:
commit dbee0c128b75b3ea0cb527300ebcd0ad55745fb1
Author: Noel Grandin 
AuthorDate: Fri Oct 7 12:54:39 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Oct 7 18:23:12 2022 +0200

use more unique_ptr in GetAllValidRanges

Change-Id: I59f6afb5b39779a58d2b0ea47b524df299e1c0d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141050
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index 1ad8c456b56c..f2d6c31a40ac 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -338,7 +338,7 @@ class SW_DLLPUBLIC SwRedlineHint final : public SfxHint
 
 namespace sw {
 
-std::vector GetAllValidRanges(std::unique_ptr 
p);
+std::vector> 
GetAllValidRanges(std::unique_ptr p);
 
 } // namespace sw
 
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index ec52d3ec1221..677ae7f0b8fd 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -4094,12 +4094,12 @@ bool 
DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl(SwPaM & rPam
 return false; // do not add empty redlines
 }
 
-std::vector redlines;
+std::vector> redlines;
 {
 auto pRedline(std::make_unique(RedlineType::Delete, 
rPam));
 if (pRedline->HasValidRange())
 {
-redlines.push_back(pRedline.release());
+redlines.push_back(std::move(pRedline));
 }
 else // sigh ... why is such a selection even possible...
 {// split it up so we get one SwUndoRedlineDelete per inserted RL
@@ -4160,7 +4160,7 @@ bool 
DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl(SwPaM & rPam
 m_rDoc.getIDocumentRedlineAccess().SetRedlineFlags(
 RedlineFlags::On | RedlineFlags::ShowInsert | 
RedlineFlags::ShowDelete);
 
-for (SwRangeRedline * pRedline : redlines)
+for (std::unique_ptr & pRedline : redlines)
 {
 assert(pRedline->HasValidRange());
 undos.emplace_back(std::make_unique(
@@ -4195,14 +4195,14 @@ bool 
DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl(SwPaM & rPam
 }
 }
 
-for (SwRangeRedline *const pRedline : redlines)
+for (std::unique_ptr & pRedline : redlines)
 {
 // note: 1. the pRedline can still be merged & deleted
 //   2. the impl. can even DeleteAndJoin the range => no plain PaM
 std::shared_ptr const 
pCursor(m_rDoc.CreateUnoCursor(*pRedline->GetMark()));
 pCursor->SetMark();
 *pCursor->GetPoint() = *pRedline->GetPoint();
-m_rDoc.getIDocumentRedlineAccess().AppendRedline(pRedline, true);
+m_rDoc.getIDocumentRedlineAccess().AppendRedline(pRedline.release(), 
true);
 // sw_redlinehide: 2 reasons why this is needed:
 // 1. it's the first redline in node => RedlineDelText was sent but 
ignored
 // 2. redline spans multiple nodes => must merge text frames
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 68225e0741b7..cfd77733e331 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -477,9 +477,9 @@ bool SwRedlineTable::Insert(SwRangeRedline*& p, size_type& 
rP)
 
 namespace sw {
 
-std::vector GetAllValidRanges(std::unique_ptr 
p)
+std::vector> 
GetAllValidRanges(std::unique_ptr p)
 {
-std::vector ret;
+std::vector> ret;
 // Create valid "sub-ranges" from the Selection
 auto [pStt, pEnd] = p->StartEnd(); // SwPosition*
 SwPosition aNewStt( *pStt );
@@ -493,91 +493,90 @@ std::vector 
GetAllValidRanges(std::unique_ptr p
 aNewStt.Assign(rNds.GetEndOfContent());
 }
 
-SwRangeRedline* pNew = nullptr;
 
-if( aNewStt < *pEnd )
-do {
-if( !pNew )
-pNew = new SwRangeRedline( p->GetRedlineData(), aNewStt );
-else
-{
-pNew->DeleteMark();
-*pNew->GetPoint() = aNewStt;
-}
+if( aNewStt >= *pEnd )
+return ret;
 
-pNew->SetMark();
-GoEndSection( pNew->GetPoint() );
-// i60396: If the redlines starts before a table but the table is 
the last member
-// of the section, the GoEndSection will end inside the table.
-// This will result in an incorrect redline, so we've to go back
-SwNode* pTab = 
pNew->GetPoint()->GetNode().StartOfSectionNode()->FindTableNode();
-// We end in a table when pTab != 0
-if( 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2022-09-28 Thread Noel Grandin (via logerrit)
 sw/inc/calc.hxx  |   12 
 sw/inc/ccoll.hxx |2 +-
 sw/inc/fmtcol.hxx|8 
 sw/source/core/bastyp/calc.cxx   |4 ++--
 sw/source/core/doc/DocumentFieldsManager.cxx |   10 +-
 sw/source/core/doc/docfld.cxx|4 ++--
 sw/source/core/doc/fmtcol.cxx|4 ++--
 7 files changed, 24 insertions(+), 20 deletions(-)

New commits:
commit 50bd2ca20618ba9c9f512716d8de7521a9fde0f6
Author: Noel Grandin 
AuthorDate: Wed Sep 28 11:12:32 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Sep 28 13:08:28 2022 +0200

sal_uLong->sal_uInt32 in CommandStruct

we are already using sal_uInt32 for this in some places

Change-Id: I69ed8f6c29215fcedcafc403861cdd0e06c034ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140701
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/ccoll.hxx b/sw/inc/ccoll.hxx
index 978b8c698a83..4052d4f0afdd 100644
--- a/sw/inc/ccoll.hxx
+++ b/sw/inc/ccoll.hxx
@@ -31,7 +31,7 @@ enum class Master_CollCondition;
 struct CommandStruct
 {
 Master_CollCondition nCnd;
-sal_uLong nSubCond;
+sal_uInt32 nSubCond;
 };
 
 sal_Int16 GetCommandContextIndex( std::u16string_view rContextName );
diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx
index 1b1bd7d2e46d..b5706dc0761b 100644
--- a/sw/inc/fmtcol.hxx
+++ b/sw/inc/fmtcol.hxx
@@ -207,12 +207,12 @@ enum class Master_CollCondition
 class SW_DLLPUBLIC SwCollCondition final : public SwClient
 {
 Master_CollCondition m_nCondition;
-sal_uLong m_nSubCondition;
+sal_uInt32 m_nSubCondition;
 
 public:
 
 SwCollCondition( SwTextFormatColl* pColl, Master_CollCondition nMasterCond,
-sal_uLong nSubCond );
+sal_uInt32 nSubCond );
 virtual ~SwCollCondition() override;
 
 /// @@@ public copy ctor, but no copy assignment?
@@ -225,9 +225,9 @@ public:
 bool operator==( const SwCollCondition& rCmp ) const;
 
 Master_CollCondition GetCondition() const  { return m_nCondition; }
-sal_uLong GetSubCondition() const   { return m_nSubCondition; }
+sal_uInt32 GetSubCondition() const   { return m_nSubCondition; }
 
-void SetCondition( Master_CollCondition nCond, sal_uLong nSubCond );
+void SetCondition( Master_CollCondition nCond, sal_uInt32 nSubCond );
 SwTextFormatColl* GetTextFormatColl() const { return 
const_cast(static_cast(GetRegisteredIn())); }
 void RegisterToFormat( SwFormat& );
 };
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index 9cc951b52a0c..b2e66b7c4d31 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -495,7 +495,7 @@ void SwTextFormatColls::dumpAsXml(xmlTextWriterPtr pWriter) 
const
 //FEATURE::CONDCOLL
 
 SwCollCondition::SwCollCondition( SwTextFormatColl* pColl, 
Master_CollCondition nMasterCond,
-sal_uLong nSubCond )
+sal_uInt32 nSubCond )
 : SwClient( pColl ), m_nCondition( nMasterCond ),
   m_nSubCondition( nSubCond )
 {
@@ -523,7 +523,7 @@ bool SwCollCondition::operator==( const SwCollCondition& 
rCmp ) const
 && ( m_nSubCondition == rCmp.m_nSubCondition );
 }
 
-void SwCollCondition::SetCondition( Master_CollCondition nCond, sal_uLong 
nSubCond )
+void SwCollCondition::SetCondition( Master_CollCondition nCond, sal_uInt32 
nSubCond )
 {
 m_nCondition = nCond;
 m_nSubCondition = nSubCond;
commit 913ed3e5673c2d70e2c4e519eb65368b0606d7f0
Author: Noel Grandin 
AuthorDate: Wed Sep 28 11:01:22 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Sep 28 13:08:15 2022 +0200

sal_uLong->sal_uInt32 in SwHashTable

Also
(*) increase the number of items this table supports from SAL_MAX_UINT16
to SAL_MAX_UINT32
(*) add some asserts to document and verify the above limit

Change-Id: I53f83303af04a9ac4f3786b221e338a7684fa1ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140700
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/calc.hxx b/sw/inc/calc.hxx
index 2a770dc447cd..f88fe8582f6c 100644
--- a/sw/inc/calc.hxx
+++ b/sw/inc/calc.hxx
@@ -154,15 +154,19 @@ class SwHashTable
 {
 std::vector> m_aData;
 public:
-SwHashTable(size_t nSize) : m_aData(nSize) {}
+SwHashTable(size_t nSize) : m_aData(nSize)
+{
+assert(nSize < SAL_MAX_UINT32);
+}
 std::unique_ptr & operator[](size_t idx) { return m_aData[idx]; }
 std::unique_ptr const & operator[](size_t idx) const { return 
m_aData[idx]; }
 void resize(size_t nSize) { m_aData.resize(nSize); }
 
-T* Find( const OUString& rStr, sal_uInt16* pPos = nullptr ) const
+T* Find( const OUString& rStr, sal_uInt32* pPos = nullptr ) const
 {
 size_t nTableSize = m_aData.size();
-sal_uLong ii = 0;
+assert(nTableSize < 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2022-08-13 Thread Noel Grandin (via logerrit)
 sw/inc/ndarr.hxx  |2 +-
 sw/source/core/docnode/ndsect.cxx |   10 +-
 sw/source/core/docnode/ndtbl.cxx  |   16 +++-
 sw/source/core/undo/untbl.cxx |2 +-
 4 files changed, 14 insertions(+), 16 deletions(-)

New commits:
commit 8d99841e2c2884d3305d1643b95f88f460bb8b6e
Author: Noel Grandin 
AuthorDate: Wed Aug 10 18:34:46 2022 +0200
Commit: Noel Grandin 
CommitDate: Sat Aug 13 10:13:00 2022 +0200

pass SwNode instead of SwNodeIndex to SwNodes::MergeTable

part of the process of hiding the internals of SwPosition

Change-Id: Ia3b2563c23aaaf86f58b56bcdd60ded3c9d8404f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138219
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index e95d5bf7e7dc..386b01aae663 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -293,7 +293,7 @@ public:
 SwTableNode* SplitTable( const SwNodeIndex& rPos, bool bAfter = true,
 bool bCalcNewSize = false );
 /// Two Tables that are following one another are merged.
-bool MergeTable( const SwNodeIndex& rPos, bool bWithPrev = true,
+bool MergeTable( SwNode& rPos, bool bWithPrev = true,
 sal_uInt16 nMode = 0 );
 
 /// Insert a new SwSection.
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 9f8c6833ff3d..7b0641da54dc 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -3508,8 +3508,7 @@ bool SwDoc::MergeTable( const SwPosition& rPos, bool 
bWithPrev, sal_uInt16 nMode
 getIDocumentFieldsAccess().UpdateTableFields(  );
 
 // The actual merge
-SwNodeIndex aIdx( bWithPrev ? *pTableNd : *pDelTableNd );
-bool bRet = rNds.MergeTable( aIdx, !bWithPrev, nMode );
+bool bRet = rNds.MergeTable( bWithPrev ? *pTableNd : *pDelTableNd, 
!bWithPrev, nMode );
 
 if( pHistory )
 {
@@ -3527,10 +3526,9 @@ bool SwDoc::MergeTable( const SwPosition& rPos, bool 
bWithPrev, sal_uInt16 nMode
 return bRet;
 }
 
-bool SwNodes::MergeTable( const SwNodeIndex& rPos, bool bWithPrev,
-sal_uInt16 nMode )
+bool SwNodes::MergeTable( SwNode& rPos, bool bWithPrev, sal_uInt16 nMode )
 {
-SwTableNode* pDelTableNd = rPos.GetNode().GetTableNode();
+SwTableNode* pDelTableNd = rPos.GetTableNode();
 OSL_ENSURE( pDelTableNd, "Where did the TableNode go?" );
 
 SwTableNode* pTableNd = (*this)[ rPos.GetIndex() - 1]->FindTableNode();
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 7e96d8fe04bb..e27f534bd8a4 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -2893,7 +2893,7 @@ void SwUndoSplitTable::UndoImpl(::sw::UndoRedoContext & 
rContext)
 default: break;
 }
 
-pDoc->GetNodes().MergeTable( rIdx );
+pDoc->GetNodes().MergeTable( rIdx.GetNode() );
 
 if( m_pHistory )
 {
commit 0cedac9c64fe4d636be66d43d89c4c939865359b
Author: Noel Grandin 
AuthorDate: Wed Aug 10 08:19:05 2022 +0200
Commit: Noel Grandin 
CommitDate: Sat Aug 13 10:12:43 2022 +0200

no need to allocate these on the heap

Change-Id: I692428cc8821f3dea53b4d6b52ced965b17f2ec4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138218
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/core/docnode/ndsect.cxx 
b/sw/source/core/docnode/ndsect.cxx
index 538dcd3beef4..ac731e549823 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -916,13 +916,13 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex 
const& rNdIdx,
 // but by simply rewiring them
 bool bInsFrame = bCreateFrames && !pSectNd->GetSection().IsHiddenFlag() &&
GetDoc().getIDocumentLayoutAccess().GetCurrentViewShell();
-SwNode2LayoutSaveUpperFrames *pNode2Layout = nullptr;
+std::optional oNode2Layout;
 if( bInsFrame )
 {
 SwNodeIndex aTmp( *pSectNd );
 if( !pSectNd->GetNodes().FindPrvNxtFrameNode( aTmp, 
pSectNd->EndOfSectionNode() ) )
 // Collect all Uppers
-pNode2Layout = new SwNode2LayoutSaveUpperFrames(*pSectNd);
+oNode2Layout.emplace(*pSectNd);
 }
 
 // Set the right StartNode for all in this Area
@@ -966,11 +966,11 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex 
const& rNdIdx,
 
 if( bInsFrame )
 {
-if( pNode2Layout )
+if( oNode2Layout )
 {
 SwNodeOffset nIdx = pSectNd->GetIndex();
-pNode2Layout->RestoreUpperFrames( pSectNd->GetNodes(), nIdx, nIdx 
+ 1 );
-delete pNode2Layout;
+oNode2Layout->RestoreUpperFrames( pSectNd->GetNodes(), nIdx, nIdx 
+ 1 );
+oNode2Layout.reset();
 }
 else
 pSectNd->MakeOwnFrames();
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2022-08-10 Thread Noel Grandin (via logerrit)
 sw/inc/crsrsh.hxx |3 ++-
 sw/inc/undobj.hxx |6 +++---
 sw/source/core/crsr/crsrsh.cxx|   10 ++
 sw/source/core/inc/UndoCore.hxx   |2 +-
 sw/source/core/undo/undobj.cxx|   20 ++--
 sw/source/core/undo/undobj1.cxx   |2 +-
 sw/source/uibase/docvw/edtwin.cxx |4 ++--
 sw/source/uibase/inc/wrtsh.hxx|3 ++-
 sw/source/uibase/wrtsh/wrtsh1.cxx |8 
 9 files changed, 31 insertions(+), 27 deletions(-)

New commits:
commit a51509ee69b730e8987c149ac19e0bedccded127
Author: Noel Grandin 
AuthorDate: Mon Aug 8 14:31:31 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Aug 11 07:58:11 2022 +0200

unique_ptr->optional in SwUndoSaveSection

Change-Id: I5fb07b35dbe3da55b6ca71537ac57dec9a5d0183
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138056
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index 51d406f84cb8..7d1d38759529 100644
--- a/sw/inc/undobj.hxx
+++ b/sw/inc/undobj.hxx
@@ -200,13 +200,13 @@ public:
 // Save a complete section in nodes-array.
 class SwUndoSaveSection : private SwUndoSaveContent
 {
-std::unique_ptr m_pMovedStart;
+std::optional m_oMovedStart;
 std::unique_ptr m_pRedlineSaveData;
 SwNodeOffset m_nMoveLen;   // Index into UndoNodes-Array.
 SwNodeOffset m_nStartPos;
 
 protected:
-SwNodeIndex* GetMvSttIdx() const { return m_pMovedStart.get(); }
+const SwNodeIndex* GetMvSttIdx() const { return m_oMovedStart ? 
&*m_oMovedStart : nullptr; }
 SwNodeOffset GetMvNodeCnt() const { return m_nMoveLen; }
 
 public:
@@ -309,7 +309,7 @@ protected:
 
 SwUndoFlyBase( SwFrameFormat* pFormat, SwUndoId nUndoId );
 
-SwNodeIndex* GetMvSttIdx() const { return 
SwUndoSaveSection::GetMvSttIdx(); }
+const SwNodeIndex* GetMvSttIdx() const { return 
SwUndoSaveSection::GetMvSttIdx(); }
 SwNodeOffset GetMvNodeCnt() const { return 
SwUndoSaveSection::GetMvNodeCnt(); }
 
 public:
diff --git a/sw/source/core/inc/UndoCore.hxx b/sw/source/core/inc/UndoCore.hxx
index c1c66b702a78..76d474adcc99 100644
--- a/sw/source/core/inc/UndoCore.hxx
+++ b/sw/source/core/inc/UndoCore.hxx
@@ -54,7 +54,7 @@ public:
 
 void RedlineToDoc( SwPaM const & rPam );
 
-SwNodeIndex* GetMvSttIdx() const
+const SwNodeIndex* GetMvSttIdx() const
 {
 return SwUndoSaveSection::GetMvSttIdx();
 }
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index b91eb0c6a0ac..3fc087bfc443 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1212,14 +1212,14 @@ SwUndoSaveSection::SwUndoSaveSection()
 
 SwUndoSaveSection::~SwUndoSaveSection()
 {
-if (m_pMovedStart) // delete also the section from UndoNodes array
+if (m_oMovedStart) // delete also the section from UndoNodes array
 {
 // SaveSection saves the content in the PostIt section.
-SwNodes& rUNds = m_pMovedStart->GetNode().GetNodes();
+SwNodes& rUNds = m_oMovedStart->GetNode().GetNodes();
 // cid#1486004 Uncaught exception
-suppress_fun_call_w_exception(rUNds.Delete(*m_pMovedStart, 
m_nMoveLen));
+suppress_fun_call_w_exception(rUNds.Delete(*m_oMovedStart, 
m_nMoveLen));
 
-m_pMovedStart.reset();
+m_oMovedStart.reset();
 }
 m_pRedlineSaveData.reset();
 }
@@ -1272,9 +1272,9 @@ void SwUndoSaveSection::SaveSection(
 
 // Keep positions as SwContentIndex so that this section can be deleted in 
DTOR
 SwNodeOffset nEnd;
-m_pMovedStart.reset(new SwNodeIndex(rRange.aStart));
-MoveToUndoNds(aPam, m_pMovedStart.get(), );
-m_nMoveLen = nEnd - m_pMovedStart->GetIndex() + 1;
+m_oMovedStart = rRange.aStart;
+MoveToUndoNds(aPam, &*m_oMovedStart, );
+m_nMoveLen = nEnd - m_oMovedStart->GetIndex() + 1;
 }
 
 void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, SwNodeIndex* pIdx,
@@ -1303,11 +1303,11 @@ void SwUndoSaveSection::RestoreSection(
 return;
 
 SwPosition aInsPos( rInsPos );
-SwNodeOffset nEnd = m_pMovedStart->GetIndex() + m_nMoveLen - 1;
-MoveFromUndoNds(*pDoc, m_pMovedStart->GetIndex(), aInsPos, , 
bForceCreateFrames);
+SwNodeOffset nEnd = m_oMovedStart->GetIndex() + m_nMoveLen - 1;
+MoveFromUndoNds(*pDoc, m_oMovedStart->GetIndex(), aInsPos, , 
bForceCreateFrames);
 
 // destroy indices again, content was deleted from UndoNodes array
-m_pMovedStart.reset();
+m_oMovedStart.reset();
 m_nMoveLen = SwNodeOffset(0);
 
 if( m_pRedlineSaveData )
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index 55b0f622d694..c8af10da32d6 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -444,7 +444,7 @@ SwRewriter SwUndoDelLayFormat::GetRewriter() const
 
 if (pDoc)
 {
-SwNodeIndex* pIdx = GetMvSttIdx();
+const SwNodeIndex* pIdx = GetMvSttIdx();
 if( 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2022-08-05 Thread Noel Grandin (via logerrit)
 sw/inc/ndarr.hxx|2 
 sw/inc/pam.hxx  |4 -
 sw/source/core/crsr/crsrsh.cxx  |   11 +--
 sw/source/core/crsr/pam.cxx |8 +-
 sw/source/core/crsr/swcrsr.cxx  |   12 +--
 sw/source/core/doc/CntntIdxStore.cxx|6 -
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   49 
 sw/source/core/doc/DocumentRedlineManager.cxx   |4 -
 sw/source/core/doc/docbm.cxx|   26 
 sw/source/core/doc/doccomp.cxx  |4 -
 sw/source/core/doc/docfld.cxx   |3 
 sw/source/core/doc/docnum.cxx   |   14 +---
 sw/source/core/doc/docredln.cxx |8 --
 sw/source/core/doc/doctxm.cxx   |5 -
 sw/source/core/docnode/ndtbl.cxx|   19 ++
 sw/source/core/docnode/nodes.cxx|   34 +++
 sw/source/core/edit/eddel.cxx   |3 
 sw/source/core/edit/edglbldc.cxx|6 -
 sw/source/core/fields/expfld.cxx|5 -
 sw/source/core/frmedt/fetab.cxx |3 
 sw/source/core/undo/unattr.cxx  |9 --
 sw/source/core/undo/unins.cxx   |   10 ---
 sw/source/core/undo/unredln.cxx |6 -
 sw/source/core/undo/unspnd.cxx  |7 --
 sw/source/core/undo/untbl.cxx   |6 -
 sw/source/core/unocore/unoframe.cxx |5 -
 sw/source/core/unocore/unoobj.cxx   |   15 +---
 sw/source/core/unocore/unoobj2.cxx  |7 --
 sw/source/core/unocore/unoredline.cxx   |   10 ---
 sw/source/core/unocore/unotext.cxx  |   14 
 sw/source/filter/ascii/parasc.cxx   |5 -
 sw/source/filter/html/htmltab.cxx   |5 -
 sw/source/uibase/docvw/AnnotationWin2.cxx   |6 -
 sw/source/uibase/docvw/edtwin.cxx   |   12 +--
 34 files changed, 146 insertions(+), 197 deletions(-)

New commits:
commit e95bb3c1074bca7460977fe962a1042a2aef415d
Author: Noel Grandin 
AuthorDate: Thu Aug 4 16:13:20 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Aug 5 09:18:19 2022 +0200

introduce SwNodes::GoNext(SwPosition*) and similar GoPrevious

as part of the process of hiding the internals of SwPosition

These are still the easy ones, i.e. no functional change intended

Change-Id: Ic1128d9e31fb87c015e1e9e66f5c365b3c2ebdca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137803
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index 87c78c5172b1..0bf1f69f63fd 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -183,7 +183,9 @@ public:
 static void GoEndOfSection(SwNodeIndex *);
 
 SwContentNode* GoNext(SwNodeIndex *) const;
+SwContentNode* GoNext(SwPosition *) const;
 static SwContentNode* GoPrevious(SwNodeIndex *);
+static SwContentNode* GoPrevious(SwPosition *);
 
 /** Go to next content-node that is not protected or hidden
(Both set FALSE ==> GoNext/GoPrevious!!!). */
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 8097ca0823b1..13779e0b6999 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -594,12 +594,13 @@ void SwCursorShell::ExtendedSelectAll(bool bFootnotes)
 {
 SwNodes& rNodes = GetDoc()->GetNodes();
 SwPosition* pPos = m_pCurrentCursor->GetPoint();
-pPos->nNode = bFootnotes ? rNodes.GetEndOfPostIts() : 
rNodes.GetEndOfAutotext();
-pPos->nContent.Assign( rNodes.GoNext( >nNode ), 0 );
+pPos->Assign( bFootnotes ? rNodes.GetEndOfPostIts() : 
rNodes.GetEndOfAutotext() );
+rNodes.GoNext( pPos );
 pPos = m_pCurrentCursor->GetMark();
-pPos->nNode = rNodes.GetEndOfContent();
-SwContentNode* pCNd = SwNodes::GoPrevious( >nNode );
-pPos->nContent.Assign( pCNd, pCNd ? pCNd->Len() : 0 );
+pPos->Assign(rNodes.GetEndOfContent());
+SwContentNode* pCNd = SwNodes::GoPrevious( pPos );
+if (pCNd)
+pPos->AssignEndIndex(*pCNd);
 }
 
 bool SwCursorShell::ExtendedSelectedAll()
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 5d962d9e2e3e..a0004bf47650 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -1114,29 +1114,29 @@ void SwCursor::FillFindPos( SwDocPositions ePos, 
SwPosition& rPos ) const
 {
 case SwDocPositions::Start:
 rPos.nNode = *rNds.GetEndOfContent().StartOfSectionNode();
-pCNd = rNds.GoNext(  );
+pCNd = rNds.GoNext(  );
 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2022-07-21 Thread Noel Grandin (via logerrit)
 sw/inc/numrule.hxx  |4 ++--
 sw/inc/unoparagraph.hxx |3 +++
 sw/source/core/doc/number.cxx   |   12 ++--
 sw/source/core/edit/edfcol.cxx  |   22 --
 sw/source/core/inc/unoport.hxx  |3 ++-
 sw/source/core/unocore/unoparagraph.cxx |   14 ++
 sw/source/core/unocore/unoportenum.cxx  |   25 -
 7 files changed, 55 insertions(+), 28 deletions(-)

New commits:
commit 4d42b6fa4e69fed38f069bdc8b24e793ba82626a
Author: Noel Grandin 
AuthorDate: Thu Jul 21 10:40:05 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 21 14:07:57 2022 +0200

tdf#119840 don't load redlines in lcl_FindParagraphClassificationField

we don't need them here.

Shaves 10% off load time

Change-Id: I38050c131af24bf0cc7cadb71d0d4d9fa7a5a9f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137290
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/unoparagraph.hxx b/sw/inc/unoparagraph.hxx
index 82540afdc58b..ab1bb903a7cd 100644
--- a/sw/inc/unoparagraph.hxx
+++ b/sw/inc/unoparagraph.hxx
@@ -45,6 +45,7 @@ class SwStartNode;
 class SwTextNode;
 class SwTableBox;
 class SwXText;
+class SwXTextPortionEnumeration;
 
 typedef ::cppu::ImplInheritanceHelper
 <   ::sfx2::MetadatableMixin
@@ -206,6 +207,8 @@ public:
 virtual OUString SAL_CALL getString() override;
 virtual void SAL_CALL setString(const OUString& rString) override;
 
+/// tries to return less data, but may return more than just text fields
+rtl::Reference createTextFieldsEnumeration();
 };
 
 
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 9ea61b6e5462..4d7f80d6d3d1 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -96,6 +96,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -542,17 +543,16 @@ bool lcl_IsParagraphClassificationField(const 
uno::Reference& xMo
 }
 
 uno::Reference lcl_FindParagraphClassificationField(const 
uno::Reference& xModel,
-  const 
uno::Reference& xParagraph,
+  const 
rtl::Reference& xParagraph,
   
std::u16string_view sKey = u"")
 {
 uno::Reference xTextField;
 
-uno::Reference 
xTextPortionEnumerationAccess(xParagraph, uno::UNO_QUERY);
-if (!xTextPortionEnumerationAccess.is())
+if (!xParagraph.is())
 return xTextField;
 
 // Enumerate text portions to find metadata fields. This is expensive, 
best to enumerate fields only.
-uno::Reference xTextPortions = 
xTextPortionEnumerationAccess->createEnumeration();
+rtl::Reference xTextPortions = 
xParagraph->createTextFieldsEnumeration();
 while (xTextPortions->hasMoreElements())
 {
 uno::Reference 
xTextPortion(xTextPortions->nextElement(), uno::UNO_QUERY);
@@ -1159,7 +1159,7 @@ void SwEditShell::SetClassification(const OUString& 
rName, SfxClassificationPoli
 // on a performance-sensitive path.
 static void lcl_ApplyParagraphClassification(SwDoc* pDoc,
   const uno::Reference& 
xModel,
-  const 
uno::Reference& xParent,
+  const rtl::Reference& 
xParent,
   const 
css::uno::Reference& xNodeSubject,
   std::vector 
aResults)
 {
@@ -1932,11 +1932,12 @@ void 
SwEditShell::RestoreMetadataFieldsAndValidateParagraphSignatures()
 
 while (xParagraphs->hasMoreElements())
 {
-uno::Reference 
xParagraph(xParagraphs->nextElement(), uno::UNO_QUERY);
+uno::Reference 
xParaOrTable(xParagraphs->nextElement(), uno::UNO_QUERY);
+rtl::Reference 
xParagraph(dynamic_cast(xParaOrTable.get()));
 
 try
 {
-const css::uno::Reference 
xSubject(xParagraph, uno::UNO_QUERY);
+const css::uno::Reference 
xSubject(xParagraph);
 const std::map aStatements = 
SwRDFHelper::getStatements(xModel, aGraphNames, xSubject);
 
 const auto it = 
aStatements.find(ParagraphClassificationFieldNamesRDFName);
@@ -1991,7 +1992,7 @@ void 
SwEditShell::RestoreMetadataFieldsAndValidateParagraphSignatures()
 
 // Get Signatures
 std::map aSignatures;
-for (const auto& pair : lcl_getRDFStatements(xModel, xParagraph))
+for (const auto& pair : lcl_getRDFStatements(xModel, 
uno::Reference(xParagraph)))
 {
 const OUString& sName = pair.first;
 if (sName.startsWith(ParagraphSignatureRDFNamespace))
@@ -2080,7 +2081,7 @@ bool SwEditShell::RemoveParagraphMetadataFieldAtCursor()
 }
 
 static OUString lcl_GetParagraphClassification(SfxClassificationHelper & 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2022-03-10 Thread Michael Stahl (via logerrit)
 sw/inc/swrect.hxx  |2 -
 sw/source/core/text/widorp.cxx |   42 +
 2 files changed, 43 insertions(+), 1 deletion(-)

New commits:
commit 5099c72ea8bfd469bf6e6ab9f8f47f447ab717f3
Author: Michael Stahl 
AuthorDate: Thu Mar 10 12:49:56 2022 +0100
Commit: Michael Stahl 
CommitDate: Thu Mar 10 14:31:29 2022 +0100

sw: downgrade "SVRect() without Width or Height" to SAL_INFO

This occurs 2500 times in CppunitTest logs.

Change-Id: I946ed240d978f1588ca3bc51c82407cba85e8e1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131316
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx
index b4db7384f456..eeb02df23c95 100644
--- a/sw/inc/swrect.hxx
+++ b/sw/inc/swrect.hxx
@@ -291,7 +291,7 @@ inline SwRect ::operator-=( const Point  )
 // other
 inline tools::Rectangle SwRect::SVRect() const
 {
-SAL_WARN_IF( IsEmpty(), "sw", "SVRect() without Width or Height" );
+SAL_INFO_IF( IsEmpty(), "sw.core", "SVRect() without Width or Height" );
 return tools::Rectangle( m_Point.getX(), m_Point.getY(),
 m_Point.getX() + m_Size.getWidth() - 1, //Right()
 m_Point.getY() + m_Size.getHeight() - 1 );  //Bottom()
commit c79bf7865bff4e88cc201357370d8faeef8e6ad9
Author: Michael Stahl 
AuthorDate: Wed Mar 9 15:24:50 2022 +0100
Commit: Michael Stahl 
CommitDate: Thu Mar 10 14:31:17 2022 +0100

(related: tdf#139687) sw: ignore following footnotes in SwTextFrameBreak

With the fix it now happens that after SwUndoDelete there is a gap at
the bottom of page 21 and the paragraph at the bottom of it is split
with 2 lines ("(here, wisdom), " etc.) on page 22.

This is because when this SwTextFrame 1927 is formatted, there are next
frames also on the page and those have footnotes on the page.

These footnotes take up space and so SwTextFrameBreak::IsInside()
breaks off the last 2 lines (1 may still fit but it has 2 widorp).

A similar problem was fixed in commit 
391613785ae6fbb735cf7a86ea2f6a93161a8769
for footnotes anchored in follow of the current frame, but here
RemoveFootnotes() cannot be used as it requires the next frame to
already have moved to a different footnote boss, which clearly hasn't
happened yet.

So try something similar to commit e37ffdd118da2d21c5e78e8c7b67252d0d1adc8c
and count the space taken by such footnotes as available for the text
frame.

Change-Id: I8f4c1332dc471a68539306a8788a0f59d0b12b1d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131256
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx
index 526f4ea1b794..f6b9ba20184f 100644
--- a/sw/source/core/text/widorp.cxx
+++ b/sw/source/core/text/widorp.cxx
@@ -135,6 +135,48 @@ bool SwTextFrameBreak::IsInside( SwTextMargin const  
) const
 // If everything is inside the existing frame the result is true;
 bFit = nDiff >= 0;
 
+// If it didn't fit, try to add the space of footnotes that are 
anchored
+// in frames below (in next-chain of) this one as they will need to 
move
+// forward anyway if this frame is split.
+// - except if in tables (need to check if row is splittable?
+//   also, multiple columns looks difficult)
+if (!bFit && !m_pFrame->IsInTab())
+{
+if (SwFootnoteBossFrame const*const pBoss = 
m_pFrame->FindFootnoteBossFrame())
+{
+if (SwFootnoteContFrame const*const pCont = 
pBoss->FindFootnoteCont())
+{
+SwContentFrame const* pContent(m_pFrame);
+while (pContent->HasFollow())
+{
+pContent = pContent->GetFollow();
+}
+// start with first text frame that isn't a follow
+// (ignoring Keep attribute for now, MakeAll should handle 
it?)
+pContent = pContent->GetNextContentFrame();
+::std::set nextFrames;
+while (pBoss->IsAnLower(pContent))
+{
+nextFrames.insert(pContent);
+pContent = pContent->GetNextContentFrame();
+}
+SwTwips nNextFootnotes(0);
+for (SwFootnoteFrame const* pFootnote = 
static_cast(pCont->Lower());
+ pFootnote != nullptr;
+ pFootnote = static_cast(pFootnote->GetNext()))
+{
+SwContentFrame const*const pAnchor = 
pFootnote->GetRef();
+if (nextFrames.find(pAnchor) != nextFrames.end())
+{
+nNextFootnotes += 
aRectFnSet.GetHeight(pFootnote->getFrameArea());
+   

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2022-03-01 Thread Noel Grandin (via logerrit)
 sw/inc/hintids.hxx  |6 ++
 sw/source/core/bastyp/calc.cxx  |6 +++---
 sw/source/core/fields/expfld.cxx|8 
 sw/source/filter/ww8/writerhelper.cxx   |2 +-
 sw/source/filter/ww8/writerhelper.hxx   |   28 
 sw/source/filter/ww8/writerwordglue.cxx |4 ++--
 sw/source/filter/ww8/wrtw8esh.cxx   |2 +-
 sw/source/filter/ww8/wrtw8nds.cxx   |2 +-
 sw/source/filter/ww8/ww8atr.cxx |   12 +---
 sw/source/filter/ww8/ww8par6.cxx|2 +-
 sw/source/uibase/shells/annotsh.cxx |6 --
 sw/source/uibase/shells/drwtxtsh.cxx|8 ++--
 sw/source/uibase/shells/textsh.cxx  |   12 +++-
 13 files changed, 41 insertions(+), 57 deletions(-)

New commits:
commit 919b923e9fe59bd83d954a53c21635317fea0de7
Author: Noel Grandin 
AuthorDate: Tue Mar 1 19:04:01 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 2 08:31:07 2022 +0100

remove writerhelper::ItemGet

the TypedWhichId template methods on SwContentNode supercede this

Change-Id: Ibb9a6a6a1642e2d764004c7179dce642fef7a40a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130804
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/filter/ww8/writerhelper.cxx 
b/sw/source/filter/ww8/writerhelper.cxx
index 64cb0d7959c7..740274453dfb 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -592,7 +592,7 @@ namespace sw
 pBreak = &(ItemGet(*pApply, 
RES_BREAK));
 }
 else if (const SwContentNode *pNd = rNd.GetContentNode())
-pBreak = &(ItemGet(*pNd, RES_BREAK));
+pBreak = >GetAttr(RES_BREAK);
 
 return pBreak && pBreak->GetBreak() == SvxBreak::PageBefore;
 }
diff --git a/sw/source/filter/ww8/writerhelper.hxx 
b/sw/source/filter/ww8/writerhelper.hxx
index 29e9a8e6b495..65d5c2501bc4 100644
--- a/sw/source/filter/ww8/writerhelper.hxx
+++ b/sw/source/filter/ww8/writerhelper.hxx
@@ -248,34 +248,6 @@ namespace sw
 return dynamic_cast(pItem);
 }
 
-/** Extract a SfxPoolItem derived property from a SwContentNode
-
-Writer's attributes are retrieved by passing a numeric identifier
-and receiving a SfxPoolItem reference which must then typically be
-cast back to its original type which is both tedious and verbose.
-
-ItemGet uses item_cast () on the retrieved reference to test that 
the
-retrieved property is of the type that the developer thinks it is.
-
-@param rNode
-The SwContentNode to retrieve the property from
-
-@param eType
-The numeric identifier of the property to be retrieved
-
-@tplparam T
-A SfxPoolItem derived class of the retrieved property
-
-@exception std::bad_cast Thrown if the property was not a T
-
-@return The T requested
-*/
-template const T & ItemGet(const SwContentNode ,
-sal_uInt16 eType)
-{
-return item_cast(rNode.GetAttr(eType));
-}
-
 /** Extract a SfxPoolItem derived property from a SwFormat
 
 Writer's attributes are retrieved by passing a numeric identifier
diff --git a/sw/source/filter/ww8/writerwordglue.cxx 
b/sw/source/filter/ww8/writerwordglue.cxx
index fda1043db476..5474148b5c5d 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -532,8 +532,8 @@ namespace sw
 if (!rText.isEmpty())
 nScript = g_pBreakIt->GetBreakIter()->getScriptType(rText, 0);
 
-rtl_TextEncoding eChrSet = ItemGet(rTextNd,
-GetWhichOfScript(RES_CHRATR_FONT, nScript)).GetCharSet();
+TypedWhichId nFontWhichId = 
GetWhichOfScript(RES_CHRATR_FONT, nScript);
+rtl_TextEncoding eChrSet = 
rTextNd.GetAttr(nFontWhichId).GetCharSet();
 eChrSet = GetExtendedTextEncoding(eChrSet);
 
 CharRuns aRunChanges;
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx 
b/sw/source/filter/ww8/wrtw8esh.cxx
index 6ce80301125c..82392ea5106c 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -2425,7 +2425,7 @@ bool WinwordAnchoring::ConvertPosition( 
SwFormatHoriOrient& _iorHoriOri,
 {
 SwTextNode& rAnchorTextNode =
 
dynamic_cast(_rFrameFormat.GetAnchor().GetContentAnchor()->nNode.GetNode());
-const SvxFormatBreakItem& rBreak = 
ItemGet(rAnchorTextNode, RES_BREAK);
+const SvxFormatBreakItem& rBreak = rAnchorTextNode.GetAttr(RES_BREAK);
 if (rBreak.GetBreak() == SvxBreak::ColumnBefore)
 {
 bConvDueToAnchoredAtColBreakPara = true;
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index bf0d049b1d6a..394203367dc4 100644
--- 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2021-12-31 Thread Noel Grandin (via logerrit)
 sw/inc/unochart.hxx |   12 +++---
 sw/source/core/unocore/unochart.cxx |   63 ++--
 sw/source/core/unocore/unofield.cxx |   36 +---
 3 files changed, 54 insertions(+), 57 deletions(-)

New commits:
commit 94e021c5e1f1fdb19d18fe8f5be7b5b4e5b841a7
Author: Noel Grandin 
AuthorDate: Tue Dec 21 18:54:53 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Jan 1 07:15:13 2022 +0100

osl::Mutex->std::mutex in SwChartData

Change-Id: I1bc85e4c8ac4945e13063793203fd308526263a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127814
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/unochart.hxx b/sw/inc/unochart.hxx
index 632efdee5530..2df27f9dbda2 100644
--- a/sw/inc/unochart.hxx
+++ b/sw/inc/unochart.hxx
@@ -39,7 +39,7 @@
 #include 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 
@@ -125,7 +125,7 @@ class SwChartDataProvider final :
 // all tables of the document.
 mutable Map_Set_DataSequenceRef_t   m_aDataSequences;
 
-::comphelper::OInterfaceContainerHelper3 
m_aEventListeners;
+::comphelper::OInterfaceContainerHelper4 
m_aEventListeners;
 const SwDoc *   m_pDoc;
 boolm_bDisposed;
 
@@ -232,8 +232,8 @@ class SwChartDataSequence final :
 public SvtListener
 {
 SwFrameFormat* m_pFormat;
-::comphelper::OInterfaceContainerHelper3 
m_aEvtListeners;
-::comphelper::OInterfaceContainerHelper3 
m_aModifyListeners;
+::comphelper::OInterfaceContainerHelper4 
m_aEvtListeners;
+::comphelper::OInterfaceContainerHelper4 
m_aModifyListeners;
 css::chart2::data::DataSequenceRole   m_aRole;
 
 OUString  m_aRowLabelText;
@@ -328,8 +328,8 @@ SwChartLabeledDataSequenceBaseClass;
 class SwChartLabeledDataSequence final :
 public SwChartLabeledDataSequenceBaseClass
 {
-::comphelper::OInterfaceContainerHelper3 
m_aEventListeners;
-::comphelper::OInterfaceContainerHelper3 
m_aModifyListeners;
+::comphelper::OInterfaceContainerHelper4 
m_aEventListeners;
+::comphelper::OInterfaceContainerHelper4 
m_aModifyListeners;
 
 css::uno::Reference< css::chart2::data::XDataSequence > m_xData;
 css::uno::Reference< css::chart2::data::XDataSequence > m_xLabels;
diff --git a/sw/source/core/unocore/unochart.cxx 
b/sw/source/core/unocore/unochart.cxx
index ef60775a6e3d..d1bc07765758 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -25,7 +25,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include "XMLRangeHelper.hxx"
@@ -149,14 +149,14 @@ IMPL_LINK_NOARG( SwChartLockController_Helper, 
DoUnlockAllCharts, Timer *, void
 UnlockAllCharts();
 }
 
-static osl::Mutex &GetChartMutex()
+static std::mutex &GetChartMutex()
 {
-static osl::Mutex   aMutex;
+static std::mutex aMutex;
 return aMutex;
 }
 
 static void LaunchModifiedEvent(
-::comphelper::OInterfaceContainerHelper3 ,
+::comphelper::OInterfaceContainerHelper4 ,
 const uno::Reference< uno::XInterface >  )
 {
 lang::EventObject aEvtObj( rxI );
@@ -498,7 +498,6 @@ static void SortSubranges( uno::Sequence< OUString > 
, bool bCmpByCol
 }
 
 SwChartDataProvider::SwChartDataProvider( const SwDoc& rSwDoc ) :
-m_aEventListeners( GetChartMutex() ),
 m_pDoc(  )
 {
 m_bDisposed = false;
@@ -1357,7 +1356,7 @@ void SAL_CALL SwChartDataProvider::dispose(  )
 {
 bool bMustDispose( false );
 {
-osl::MutexGuard  aGuard( GetChartMutex() );
+std::unique_lock aGuard( GetChartMutex() );
 bMustDispose = !m_bDisposed;
 if (!m_bDisposed)
 m_bDisposed = true;
@@ -1375,13 +1374,14 @@ void SAL_CALL SwChartDataProvider::dispose(  )
 
 // require listeners to release references to this object
 lang::EventObject aEvtObj( static_cast< chart2::data::XDataProvider * 
>(this) );
-m_aEventListeners.disposeAndClear( aEvtObj );
+std::unique_lock aGuard( GetChartMutex() );
+m_aEventListeners.disposeAndClear( aGuard, aEvtObj );
 }
 
 void SAL_CALL SwChartDataProvider::addEventListener(
 const uno::Reference< lang::XEventListener >& rxListener )
 {
-osl::MutexGuard  aGuard( GetChartMutex() );
+std::unique_lock aGuard( GetChartMutex() );
 if (!m_bDisposed && rxListener.is())
 m_aEventListeners.addInterface( rxListener );
 }
@@ -1389,7 +1389,7 @@ void SAL_CALL SwChartDataProvider::addEventListener(
 void SAL_CALL SwChartDataProvider::removeEventListener(
 const uno::Reference< lang::XEventListener >& rxListener )
 {
-osl::MutexGuard  aGuard( GetChartMutex() );
+std::unique_lock aGuard( GetChartMutex() );
 if (!m_bDisposed && rxListener.is())
 m_aEventListeners.removeInterface( rxListener );
 }
@@ -1772,8 +1772,6 @@ SwChartDataSequence::SwChartDataSequence(
 SwFrameFormat& rTableFormat,

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2021-12-22 Thread Michael Stahl (via logerrit)
 sw/inc/ndarr.hxx |4 +--
 sw/source/core/docnode/nodes.cxx |   46 +++
 2 files changed, 20 insertions(+), 30 deletions(-)

New commits:
commit e0f13ce0f9e2dac836c42141bb848d2bf4fbda75
Author: Michael Stahl 
AuthorDate: Tue Dec 21 13:52:56 2021 +0100
Commit: Michael Stahl 
CommitDate: Wed Dec 22 12:59:45 2021 +0100

sw: simplify SwNodes::FindPrvNxtFrameNode(), pEnd is always passed

Change-Id: I6bd606e8c70704cb716b1eb474934dedb54d81da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127270
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index 5393af72e776..28c96cc8a249 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -301,8 +301,8 @@ public:
 const   SwDoc& GetDoc() const   { return m_rMyDoc; }
 
 /** Search previous / next content node or table node with frames.
- If no end is given begin with the FrameIndex, else start search
- with that before rFrameIdx and pEnd at the back.
+ Search is started backward with the one before rFrameIdx and
+ forward after pEnd.
  If no valid node is found, return 0. rFrameIdx points to the node with 
frames. **/
 SwNode* FindPrvNxtFrameNode( SwNodeIndex& rFrameIdx,
 const SwNode* pEnd ) const;
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 1b16c73b46eb..9ee61dd93d50 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -2027,8 +2027,7 @@ SwContentNode* SwNodes::GoPrevSection( SwNodeIndex * pIdx,
 /** find the next/previous ContentNode or table node that should have layout
  * frames that are siblings to the ones of the node at rFrameIdx.
  *
- * If no pEnd is given, search is started with FrameIndex; otherwise
- * search is started backward with the one before rFrameIdx and
+ * Search is started backward with the one before rFrameIdx and
  * forward after pEnd.
  *
  * @param rFrameIdx in: node with frames to search in; out: found node
@@ -2038,6 +2037,8 @@ SwContentNode* SwNodes::GoPrevSection( SwNodeIndex * pIdx,
 SwNode* SwNodes::FindPrvNxtFrameNode( SwNodeIndex& rFrameIdx,
 const SwNode* pEnd ) const
 {
+assert(pEnd != nullptr); // every caller currently
+
 SwNode* pFrameNd = nullptr;
 
 // no layout -> skip
@@ -2057,12 +2058,8 @@ SwNode* SwNodes::FindPrvNxtFrameNode( SwNodeIndex& 
rFrameIdx,
 ? pSttNd->StartOfSectionNode()->FindTableNode()
 : pSttNd->FindTableNode();
 SwNodeIndex aIdx( rFrameIdx );
-SwNode* pNd;
-if( pEnd )
-{
---aIdx;
-}
-pNd = ();
+--aIdx;
+SwNode *const pNd = ();
 
 if( ( pFrameNd = pNd )->IsContentNode() )
 rFrameIdx = aIdx;
@@ -2083,13 +2080,10 @@ SwNode* SwNodes::FindPrvNxtFrameNode( SwNodeIndex& 
rFrameIdx,
 }
 else
 {
-if( pEnd )
-aIdx = pEnd->GetIndex() + 1;
-else
-aIdx = rFrameIdx;
+aIdx = pEnd->GetIndex() + 1;
 
 // NEVER leave the section when doing this!
-if( ( pEnd && ( pFrameNd = ())->IsContentNode() ) 
||
+if( ( ( pFrameNd = ())->IsContentNode() ) ||
 ( nullptr != ( pFrameNd = GoNextSection( , true, 
false )) &&
 ::CheckNodesRange( aIdx, rFrameIdx, true ) &&
 ( pFrameNd->FindTableNode() == pTableNd &&
@@ -2122,10 +2116,7 @@ SwNode* SwNodes::FindPrvNxtFrameNode( SwNodeIndex& 
rFrameIdx,
 }
 else
 {
-if( pEnd )
-aIdx = pEnd->GetIndex() + 1;
-else
-aIdx = rFrameIdx.GetIndex() + 1;
+aIdx = pEnd->GetIndex() + 1;
 
 if( (pFrameNd = ())->IsTableNode() )
 rFrameIdx = aIdx;
commit 25aa814aa466cb0a59e34dfef33c50065c445f60
Author: Michael Stahl 
AuthorDate: Tue Dec 21 13:47:32 2021 +0100
Commit: Michael Stahl 
CommitDate: Wed Dec 22 12:59:31 2021 +0100

sw: simplify SwNodes::FindPrvNxtFrameNode(), improve comments

Change-Id: I2f715ffe49d1c3ef373ffeb2a3cc335d511e0c13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127269
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index aa9dd63f4bfd..1b16c73b46eb 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -2023,16 +2023,17 @@ SwContentNode* SwNodes::GoPrevSection( SwNodeIndex * 
pIdx,
 return nullptr;
 }
 
-//TODO: improve documentation
 //TODO: The inventor of the "single responsibility principle" will be crying 
if 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2021-08-05 Thread Vasily Melenchuk (via logerrit)
 sw/inc/strings.hrc  |1 +
 sw/inc/swundo.hxx   |3 ++-
 sw/source/core/doc/docnum.cxx   |   15 +++
 sw/source/core/draw/dview.cxx   |5 +
 sw/source/core/inc/UndoCore.hxx |   14 ++
 sw/source/core/undo/undobj.cxx  |3 +++
 sw/source/core/undo/unoutl.cxx  |   24 
 7 files changed, 64 insertions(+), 1 deletion(-)

New commits:
commit 6e879d5f142766c941d1c3bafd17f67b78c1c9f4
Author: Vasily Melenchuk 
AuthorDate: Thu Aug 5 11:16:58 2021 +0300
Commit: Thorsten Behrens 
CommitDate: Thu Aug 5 18:34:09 2021 +0200

tdf#99932: sw: fix for invalid anchor location for FLY_AT_CHAR mode

In such case anchor position depends on LastCharRect which can be
invalid because of happened frame movement, resize, etc.

Change-Id: I3d3c6318ee1ce5f4043e21ab091417d283c4260c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120059
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index 276fbf922c9a..aa116d3d7bb7 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -236,6 +236,11 @@ void SwDrawView::AddCustomHdl()
 // #i28701# - use last character rectangle saved at object
 // in order to avoid a format of the anchor frame
 SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj 
)->GetAnchoredObj( pObj );
+
+// Invalidate/recalc LastCharRect which can contain invalid frame 
offset because
+// of later frame changes
+pAnchoredObj->CheckCharRectAndTopOfLine(false);
+
 SwRect aAutoPos = pAnchoredObj->GetLastCharRect();
 if ( aAutoPos.Height() )
 {
commit 4edf3a964e764dcc40be729b8305476c5b968f1c
Author: Vasily Melenchuk 
AuthorDate: Fri Jul 23 14:28:04 2021 +0300
Commit: Thorsten Behrens 
CommitDate: Thu Aug 5 18:33:54 2021 +0200

sw: undo/redo for outline modification

Outline changes done via "Tools"->"Chapter Numbering" were
not tracked by undo/redo before.

Change-Id: I764dda526d2b17ecbb62eca0d6a9fb0b368c4a69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119405
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index 4d374a5591f5..a6b502742989 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -453,6 +453,7 @@
 #define STR_TEXT_CORRECTION NC_("STR_TEXT_CORRECTION", 
"Text Correction")
 #define STR_OUTLINE_LR  NC_("STR_OUTLINE_LR", 
"Promote/demote outline")
 #define STR_OUTLINE_UD  NC_("STR_OUTLINE_UD", "Move 
outline")
+#define STR_OUTLINE_EDITNC_("STR_OUTLINE_EDIT", 
"Modify outline")
 #define STR_INSNUM  NC_("STR_INSNUM", "Insert 
numbering")
 #define STR_NUMUP   NC_("STR_NUMUP", "Promote 
level")
 #define STR_NUMDOWN NC_("STR_NUMDOWN", "Demote 
level")
diff --git a/sw/inc/swundo.hxx b/sw/inc/swundo.hxx
index 90fa6c51d055..cda4ec02c49f 100644
--- a/sw/inc/swundo.hxx
+++ b/sw/inc/swundo.hxx
@@ -164,7 +164,8 @@ enum class SwUndoId
 UI_TABLE_DELETE,   // 133
 CONFLICT,  // 134
 
-INSERT_FORM_FIELD  // 135
+INSERT_FORM_FIELD, // 135
+OUTLINE_EDIT,  // 136
 };
 
 OUString GetUndoComment(SwUndoId eId);
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index fad2322f07d9..430d19220329 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -114,6 +114,16 @@ static sal_uInt8 GetUpperLvlChg( sal_uInt8 nCurLvl, 
sal_uInt8 nLevel, sal_uInt16
 
 void SwDoc::SetOutlineNumRule( const SwNumRule& rRule )
 {
+if (GetIDocumentUndoRedo().DoesUndo())
+{
+GetIDocumentUndoRedo().StartUndo(SwUndoId::OUTLINE_EDIT, nullptr);
+if (mpOutlineRule)
+{
+GetIDocumentUndoRedo().AppendUndo(
+std::make_unique(*mpOutlineRule, rRule, 
*this));
+}
+}
+
 if( mpOutlineRule )
 (*mpOutlineRule) = rRule;
 else
@@ -158,6 +168,11 @@ void SwDoc::SetOutlineNumRule( const SwNumRule& rRule )
 
 getIDocumentFieldsAccess().UpdateExpFields(nullptr, true);
 
+if (GetIDocumentUndoRedo().DoesUndo())
+{
+GetIDocumentUndoRedo().EndUndo(SwUndoId::OUTLINE_EDIT, nullptr);
+}
+
 getIDocumentState().SetModified();
 }
 
diff --git a/sw/source/core/inc/UndoCore.hxx b/sw/source/core/inc/UndoCore.hxx
index 1fcfae22f6e2..62fcccd0231c 100644
--- a/sw/source/core/inc/UndoCore.hxx
+++ b/sw/source/core/inc/UndoCore.hxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -221,6 +222,19 @@ public:
 virtual void RepeatImpl( ::sw::RepeatContext & ) override;
 };
 
+class SwUndoOutlineEdit final : 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2021-06-11 Thread Noel Grandin (via logerrit)
 sw/inc/IDocumentContentOperations.hxx   |2 +-
 sw/inc/crsrsh.hxx   |4 ++--
 sw/inc/doc.hxx  |6 +++---
 sw/inc/editsh.hxx   |5 +
 sw/inc/fesh.hxx |2 +-
 sw/inc/ndtxt.hxx|2 +-
 sw/inc/swcrsr.hxx   |2 +-
 sw/inc/swddetbl.hxx |2 +-
 sw/source/core/crsr/crsrsh.cxx  |9 ++---
 sw/source/core/crsr/crstrvl.cxx |5 ++---
 sw/source/core/crsr/swcrsr.cxx  |9 +
 sw/source/core/doc/DocumentContentOperationsManager.cxx |3 +--
 sw/source/core/doc/docnum.cxx   |7 +--
 sw/source/core/docnode/ndtbl.cxx|   11 ---
 sw/source/core/edit/edattr.cxx  |6 ++
 sw/source/core/fields/ddetbl.cxx|8 +++-
 sw/source/core/frmedt/fetab.cxx |8 
 sw/source/core/inc/DocumentContentOperationsManager.hxx |2 +-
 sw/source/core/txtnode/ndtxt.cxx|6 +-
 sw/source/uibase/inc/wrtsh.hxx  |4 ++--
 sw/source/uibase/wrtsh/select.cxx   |6 ++
 21 files changed, 41 insertions(+), 68 deletions(-)

New commits:
commit 36b33c50bd620a0879bf5c8b29de3ac2dada19d0
Author: Noel Grandin 
AuthorDate: Thu Jun 10 12:14:42 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jun 11 11:48:15 2021 +0200

loplugin:unnecessaryreturn in sw/

Change-Id: Iaca3f5385fd2c763cd1121ae50624aaa4a1f6165
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117029
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/IDocumentContentOperations.hxx 
b/sw/inc/IDocumentContentOperations.hxx
index 14724eae3731..7b6960e1c074 100644
--- a/sw/inc/IDocumentContentOperations.hxx
+++ b/sw/inc/IDocumentContentOperations.hxx
@@ -152,7 +152,7 @@ public:
 
 /** Move a range.
 */
-virtual bool MoveAndJoin(SwPaM&, SwPosition&) = 0;
+virtual void MoveAndJoin(SwPaM&, SwPosition&) = 0;
 
 /** Overwrite string in an existing text node.
 */
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 5b7e71a23634..38b12309c4f2 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -544,7 +544,7 @@ public:
 
 bool GoPrevCursor();
 
-bool GoNextPrevCursorSetSearchLabel(const bool bNext);
+void GoNextPrevCursorSetSearchLabel(const bool bNext);
 
 // at CurrentCursor.SPoint
 ::sw::mark::IMark* SetBookmark(
@@ -613,7 +613,7 @@ public:
 SwOutlineNodes::size_type GetOutlinePos(sal_uInt8 nLevel = UCHAR_MAX, 
SwPaM* pPaM = nullptr);
 // select the given range of OutlineNodes. Optionally including the 
children
 // the sal_uInt16s are the positions in OutlineNodes-Array (EditShell)
-bool MakeOutlineSel(SwOutlineNodes::size_type nSttPos, 
SwOutlineNodes::size_type nEndPos,
+void MakeOutlineSel(SwOutlineNodes::size_type nSttPos, 
SwOutlineNodes::size_type nEndPos,
  bool bWithChildren, bool bKillPams = true );
 
 bool GotoNextOutline();
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 19a2b6af64b1..c94e5f04c5f3 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -1090,7 +1090,7 @@ public:
 
 void UpdateNumRule();   // Update all invalids.
 void ChgNumRuleFormats( const SwNumRule& rRule );
-bool ReplaceNumRule( const SwPosition& rPos, const OUString& rOldRule,
+void ReplaceNumRule( const SwPosition& rPos, const OUString& rOldRule,
 const OUString& rNewRule );
 
 // Goto next/previous on same level.
@@ -1254,7 +1254,7 @@ public:
 
 void AppendUndoForInsertFromDB( const SwPaM& rPam, bool bIsTable );
 
-bool SetColRowWidthHeight( SwTableBox& rCurrentBox, 
TableChgWidthHeightType eType,
+void SetColRowWidthHeight( SwTableBox& rCurrentBox, 
TableChgWidthHeightType eType,
 SwTwips nAbsDiff, SwTwips nRelDiff );
 SwTableBoxFormat* MakeTableBoxFormat();
 SwTableLineFormat* MakeTableLineFormat();
@@ -1279,7 +1279,7 @@ public:
   bool* pFullTableProtection );
 
 // Split table at baseline position, i.e. create a new table.
-bool SplitTable( const SwPosition& rPos, SplitTable_HeadlineOption eMode,
+void SplitTable( const SwPosition& rPos, SplitTable_HeadlineOption eMode,
 bool bCalcNewSize );
 
 /** And vice versa: rPos must be in the table that remains. The flag 
indicates
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index c5f5be3c34c7..f2d8c5300535 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -257,11 +257,8 @@ public:
  * @param rSet
  * output parameter 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2021-05-30 Thread Noel Grandin (via logerrit)
 sw/inc/node.hxx   |4 ++--
 sw/inc/shellres.hxx   |7 ---
 sw/source/core/docnode/ndtbl.cxx  |4 ++--
 sw/source/core/docnode/node.cxx   |   20 ++--
 sw/source/core/inc/UndoTable.hxx  |2 +-
 sw/source/core/txtnode/thints.cxx |5 ++---
 sw/source/core/undo/untbl.cxx |   16 
 sw/source/uibase/utlui/initui.cxx |8 
 8 files changed, 33 insertions(+), 33 deletions(-)

New commits:
commit 8ee22cb0bd6e741a553ef7d5b78cedc7ca669939
Author: Noel Grandin 
AuthorDate: Fri May 28 15:45:46 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun May 30 09:08:41 2021 +0200

std::unique_ptr -> std::optional

Change-Id: I78e5995b1a5cccff9c632ef4bcf75ea3ec01ff65
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116382
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/shellres.hxx b/sw/inc/shellres.hxx
index ef81f1a64eaa..6cbcd91e8ab0 100644
--- a/sw/inc/shellres.hxx
+++ b/sw/inc/shellres.hxx
@@ -20,6 +20,7 @@
 #define INCLUDED_SW_INC_SHELLRES_HXX
 
 #include 
+#include 
 #include 
 #include "swdllapi.h"
 #include 
@@ -78,7 +79,7 @@ struct SW_DLLPUBLIC ShellResource
 
 private:
 void GetAutoFormatNameLst_() const;
-mutable std::unique_ptr> pAutoFormatNameLst;
+mutable std::optional> mxAutoFormatNameLst;
 OUStringsPageDescFirstName;
 OUStringsPageDescFollowName;
 OUStringsPageDescName;
@@ -86,9 +87,9 @@ private:
 
 inline const std::vector& ShellResource::GetAutoFormatNameLst() const
 {
-if( !pAutoFormatNameLst )
+if( !mxAutoFormatNameLst )
 GetAutoFormatNameLst_();
-return *pAutoFormatNameLst;
+return *mxAutoFormatNameLst;
 }
 
 #endif // INCLUDED_SW_INC_SHELLRES_HXX
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index d11f09ecf69a..1b23437c3fbd 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -759,14 +759,14 @@ const SwTable* SwDoc::TextToTable( const 
SwInsertTableOptions& rInsTableOpts,
 {
 sal_uInt8 nBoxArrLen = pTAFormat ? 16 : 4;
 std::unique_ptr< DfltBoxAttrList_t > aBoxFormatArr1;
-std::unique_ptr< std::vector > aBoxFormatArr2;
+std::optional< std::vector > aBoxFormatArr2;
 if( bUseBoxFormat )
 {
 aBoxFormatArr1.reset(new DfltBoxAttrList_t( nBoxArrLen, nullptr ));
 }
 else
 {
-aBoxFormatArr2.reset(new std::vector( 
nBoxArrLen, nullptr ));
+aBoxFormatArr2 = std::vector( nBoxArrLen, 
nullptr );
 }
 
 SfxItemSet aCharSet( GetAttrPool(), svl::Items{} );
diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
index 81b4780b9792..c15f0f10ca1c 100644
--- a/sw/source/core/inc/UndoTable.hxx
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -175,7 +175,7 @@ class SwUndoTableNdsChg : public SwUndo
 BoxMove(sal_uLong idx, bool moved=false) : index(idx), hasMoved(moved) 
{};
 bool operator<(const BoxMove& other) const { return index < 
other.index; };
 };
-std::unique_ptr< std::set > m_pNewSttNds;
+std::optional< std::set > m_xNewSttNds;
 std::unique_ptr m_pDelSects;
 tools::Long m_nMin, m_nMax;// for redo of delete column
 sal_uLong m_nSttNode;
diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index 2a97d9017e79..bc49210e14f0 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -2183,7 +2183,7 @@ bool SwTextNode::GetParaAttr(SfxItemSet& rSet, sal_Int32 
nStt, sal_Int32 nEnd,
 else// a query range is defined
 {
 // #i75299#
-std::unique_ptr< std::vector< SwPoolItemEndPair > > pAttrArr;
+std::optional< std::vector< SwPoolItemEndPair > > pAttrArr;
 
 const size_t coArrSz = RES_TXTATR_WITHEND_END - RES_CHRATR_BEGIN;
 
@@ -2243,8 +2243,7 @@ bool SwTextNode::GetParaAttr(SfxItemSet& rSet, sal_Int32 
nStt, sal_Int32 nEnd,
 
 if (!pAttrArr)
 {
-pAttrArr.reset(
-new std::vector< SwPoolItemEndPair >(coArrSz));
+pAttrArr = std::vector< SwPoolItemEndPair 
>(coArrSz);
 }
 
 std::vector< SwPoolItemEndPair >::iterator pPrev = 
pAttrArr->begin();
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 28f54bcd7277..ee509e6b602c 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -1491,7 +1491,7 @@ void SwUndoTableNdsChg::SaveNewBoxes( const SwTableNode& 
rTableNd,
 const SwTableSortBoxes& rTableBoxes = rTable.GetTabSortBoxes();
 
 OSL_ENSURE( ! IsDelBox(), "wrong Action" );
-m_pNewSttNds.reset( new std::set );
+m_xNewSttNds.emplace();
 
 size_t i = 0;
 for 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2021-05-29 Thread Noel Grandin (via logerrit)
 sw/inc/calbck.hxx|4 ++--
 sw/source/core/attr/calbck.cxx   |9 -
 sw/source/uibase/docvw/AnnotationWin.cxx |3 ---
 3 files changed, 6 insertions(+), 10 deletions(-)

New commits:
commit e4b5aaade285ecad39332ad8b195738feb51151a
Author: Noel Grandin 
AuthorDate: Fri May 28 12:19:09 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat May 29 12:41:23 2021 +0200

no need to allocate this hint on the heap

Change-Id: I6321d03cb5786aa0c17705cc8c8bcf1f85326f44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116369
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx
index 11a62033c5cc..0863b2da7f2f 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class SwModify;
 class SwFormat;
@@ -76,7 +77,6 @@ namespace sw
 struct ModifyChangedHint final: SfxHint
 {
 ModifyChangedHint(const SwModify* pNew) : m_pNew(pNew) {};
-virtual ~ModifyChangedHint() override;
 const SwModify* m_pNew;
 };
 // Observer pattern using svl implementation
@@ -151,7 +151,7 @@ public:
 
 // in case an SwModify object is destroyed that itself is registered in 
another SwModify,
 // its SwClient objects can decide to get registered to the latter instead 
by calling this method
-std::unique_ptr CheckRegistration( const 
SfxPoolItem* pOldValue );
+std::optional CheckRegistration( const SfxPoolItem* 
pOldValue );
 // SwFormat wants to die different than the rest: It wants to reparent 
every client to its parent
 // and then send a SwFormatChg hint.
 void CheckRegistrationFormat(SwFormat& rOld);
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
index a37ee5bef376..3f4253cd2566 100644
--- a/sw/source/core/attr/calbck.cxx
+++ b/sw/source/core/attr/calbck.cxx
@@ -54,7 +54,6 @@ namespace sw
 }
 
 sw::LegacyModifyHint::~LegacyModifyHint() {}
-sw::ModifyChangedHint::~ModifyChangedHint() {}
 
 SwClient::SwClient(SwClient&& o) noexcept
 : m_pRegisteredIn(nullptr)
@@ -75,19 +74,19 @@ SwClient::~SwClient()
 m_pRegisteredIn->Remove( this );
 }
 
-std::unique_ptr SwClient::CheckRegistration( const 
SfxPoolItem* pOld )
+std::optional SwClient::CheckRegistration( const 
SfxPoolItem* pOld )
 {
 DBG_TESTSOLARMUTEX();
 // this method only handles notification about dying SwModify objects
 if( !pOld || pOld->Which() != RES_OBJECTDYING )
-return nullptr;
+return {};
 
 assert(dynamic_cast(pOld));
 const SwPtrMsgPoolItem* pDead = static_cast(pOld);
 if(pDead->pObject != m_pRegisteredIn)
 {
 // we should only care received death notes from objects we are 
following
-return nullptr;
+return {};
 }
 // I've got a notification from the object I know
 SwModify* pAbove = m_pRegisteredIn->GetRegisteredIn();
@@ -102,7 +101,7 @@ std::unique_ptr 
SwClient::CheckRegistration( const SfxPoo
 // destroy connection
 EndListeningAll();
 }
-return std::unique_ptr(new 
sw::ModifyChangedHint(pAbove));
+return sw::ModifyChangedHint(pAbove);
 }
 
 void SwClient::CheckRegistrationFormat(SwFormat& rOld)
commit 1df758fce8ac23b54f96f2c0f3dd608bb1da024a
Author: Noel Grandin 
AuthorDate: Fri May 28 15:59:43 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat May 29 12:41:05 2021 +0200

remove IsDisposed check in sw

already checked by call sites

Change-Id: Id03d07b7aebd36e891f831ff4bdab7e63a7c4ff7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116345
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx 
b/sw/source/uibase/docvw/AnnotationWin.cxx
index e354a62204a8..01d12affedad 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -138,9 +138,6 @@ SwAnnotationWin::~SwAnnotationWin()
 
 void SwAnnotationWin::dispose()
 {
-if (IsDisposed())
-return;
-
 mrMgr.DisconnectSidebarWinFromFrame( 
*(mrSidebarItem.maLayoutInfo.mpAnchorFrame),
*this );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2021-05-17 Thread Caolán McNamara (via logerrit)
 sw/inc/viewsh.hxx   |   12 -
 sw/source/core/unocore/unotbl.cxx   |   11 -
 sw/source/core/view/viewsh.cxx  |   28 +-
 sw/source/filter/ascii/ascatr.cxx   |   43 +---
 sw/source/filter/ascii/parasc.cxx   |  232 
 sw/source/uibase/docvw/FrameControlsManager.cxx |1 
 6 files changed, 163 insertions(+), 164 deletions(-)

New commits:
commit 49fd5ed7f040eaa2352b2e684c1349f42db3ac66
Author: Caolán McNamara 
AuthorDate: Sun May 16 20:40:03 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon May 17 09:45:25 2021 +0200

cid#1484877 Unchecked dynamic_cast

Change-Id: I17e93665482a401bb9ffe489f0f9d35302675adf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115686
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/uibase/docvw/FrameControlsManager.cxx 
b/sw/source/uibase/docvw/FrameControlsManager.cxx
index 9b6cbdf2a8db..1da032330d57 100644
--- a/sw/source/uibase/docvw/FrameControlsManager.cxx
+++ b/sw/source/uibase/docvw/FrameControlsManager.cxx
@@ -209,6 +209,7 @@ void 
SwFrameControlsManager::SetOutlineContentVisibilityButton(const SwContentFr
 }
 
 SwOutlineContentVisibilityWin* pWin = 
dynamic_cast(pControl->GetWindow());
+assert(pWin != nullptr);
 pWin->Set();
 
 if (pWin->GetSymbol() == ButtonSymbol::SHOW)
commit 44c5a8977aa77d99abc0c179a4f5b9df55c17ec6
Author: Miklos Vajna 
AuthorDate: Mon May 17 09:00:36 2021 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 17 09:45:14 2021 +0200

sw: prefix members of SwASCIIParser, SwASC_AttrIter, ...

... SwTableProperties_Impl and SwViewShell

See tdf#94879 for motivation.

Change-Id: I7c8fe1f95d9ff1dbd7b9980845ff7fdfb36d1e26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115691
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 27d29e9f65f0..4800cadcf9ba 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -97,7 +97,7 @@ class SW_DLLPUBLIC SwViewShell : public sw::Ring
 std::unique_ptr m_xReplaceBmp; ///< replaced display of still 
loaded images
 std::unique_ptr m_xErrorBmp;   ///< error display of missed 
images
 
-static bool mbLstAct;// true if EndAction of last Shell
+static bool sbLstAct;// true if EndAction of last Shell
  // i.e. if the EndActions of the other
  // Shells on the document are through.
 
@@ -163,8 +163,8 @@ class SW_DLLPUBLIC SwViewShell : public 
sw::Ring
 SAL_DLLPRIVATE void ImplApplyViewOptions( const SwViewOption  );
 
 protected:
-static ShellResource*  mpShellRes;  ///< Resources for the Shell.
-static vcl::DeleteOnDeinit< std::shared_ptr > mpCareDialog;  
  ///< Avoid this window.
+static ShellResource*  spShellRes;  ///< Resources for the Shell.
+static vcl::DeleteOnDeinit< std::shared_ptr > spCareDialog;  
  ///< Avoid this window.
 
 SwRect  maVisArea;   ///< The modern version of 
VisArea.
 tools::RectanglemaLOKVisibleArea;///< The visible area in the 
LibreOfficeKit client.
@@ -339,7 +339,7 @@ public:
 
 void SetWin(vcl::Window* win) { mpWin = win; }
 void SetOut(vcl::RenderContext* pOut) { mpOut = pOut; }
-static bool IsLstEndAction() { return SwViewShell::mbLstAct; }
+static bool IsLstEndAction() { return SwViewShell::sbLstAct; }
 
 // Change of all page descriptors.
 void   ChgAllPageOrientation( Orientation eOri );
@@ -430,13 +430,13 @@ public:
 
 const SwAccessibilityOptions* GetAccessibilityOptions() const { return 
mpAccOptions.get();}
 
-static void   SetShellRes( ShellResource* pRes ) { mpShellRes = 
pRes; }
+static void   SetShellRes( ShellResource* pRes ) { spShellRes = 
pRes; }
 static ShellResource* GetShellRes();
 
 static weld::Window*   CareChildWin(SwViewShell const & rVSh);
 static void   SetCareDialog(const std::shared_ptr& 
rNew);
 static weld::Window*  GetCareDialog(SwViewShell const & rVSh)
-  { return (*mpCareDialog.get()) ? 
mpCareDialog.get()->get() : CareChildWin(rVSh); }
+  { return (*spCareDialog.get()) ? 
spCareDialog.get()->get() : CareChildWin(rVSh); }
 
 SfxViewShell   *GetSfxViewShell() const { return mpSfxViewShell; }
 void   SetSfxViewShell(SfxViewShell *pNew) { mpSfxViewShell = 
pNew; }
diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index 395b6864318a..0e2cff68a5b5 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -1761,7 +1761,8 @@ namespace {
 
 class SwTableProperties_Impl
 {
-SwUnoCursorHelper::SwAnyMapHelper aAnyMap;
+SwUnoCursorHelper::SwAnyMapHelper m_aAnyMap;
+
 public:
 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2020-11-02 Thread Bjoern Michaelsen (via logerrit)
 sw/inc/fldbas.hxx  |8 ++--
 sw/inc/format.hxx  |1 +
 sw/source/core/attr/format.cxx |5 +
 sw/source/core/docnode/ndsect.cxx  |8 ++--
 sw/source/core/docnode/section.cxx |3 +--
 sw/source/core/fields/fldbas.cxx   |   12 
 sw/source/core/tox/tox.cxx |5 ++---
 sw/source/core/txtnode/atrfld.cxx  |5 ++---
 sw/source/core/undo/undobj1.cxx|5 +
 sw/source/core/undo/undraw.cxx |   30 --
 sw/source/core/undo/untbl.cxx  |2 +-
 sw/source/core/view/viewsh.cxx |   11 +++
 12 files changed, 40 insertions(+), 55 deletions(-)

New commits:
commit 4839756fcb381e37f7c4cc65e392d772b325c8b4
Author: Bjoern Michaelsen 
AuthorDate: Mon Nov 2 12:18:46 2020 +0100
Commit: Bjoern Michaelsen 
CommitDate: Mon Nov 2 15:06:04 2020 +0100

SwFieldType: ModifyNotification no more ...

Change-Id: Idb6c0a6cca5df729037067f6def5594eed2cca19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105178
Tested-by: Jenkins
Reviewed-by: Bjoern Michaelsen 

diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index 68cd955f97c0..82461033fe1b 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -271,7 +271,8 @@ public:
 
 SwFieldIds  Which() const { return m_nWhich; }
 
-inline  voidUpdateFields() const;
+void UpdateFields() const;
+void PrintHiddenPara();
 virtual void dumpAsXml(xmlTextWriterPtr pWriter) const;
 SwFormatField* FindFormatForField(const SwField*) const;
 SwFormatField* FindFormatForPostItId(sal_uInt32 nPostItId) const;
@@ -282,11 +283,6 @@ public:
 void GatherFields(std::vector& rvFormatFields, bool 
bCollectOnlyInDocNodes=true) const;
 };
 
-inline void SwFieldType::UpdateFields() const
-{
-const_cast(this)->ModifyNotification( nullptr, nullptr );
-}
-
 /** Base class of all fields.
  Type of field is queried via Which.
  Expanded content of field is queried via ExpandField(). */
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index ce63d378f3fd..2a8da69042cb 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace nsSwDocInfoSubType;
@@ -144,6 +145,17 @@ void SwFieldType::PutValue( const uno::Any& , sal_uInt16 )
 {
 }
 
+void SwFieldType::UpdateFields() const
+{
+const_cast(this)->SwClientNotify(*this, 
sw::LegacyModifyHint(nullptr, nullptr));
+}
+
+void SwFieldType::PrintHiddenPara()
+{
+const SwMsgPoolItem aHint(RES_HIDDENPARA_PRINT);
+SwClientNotify(*this, sw::LegacyModifyHint(, nullptr));
+}
+
 void SwFieldType::dumpAsXml(xmlTextWriterPtr pWriter) const
 {
 std::vector vFields;
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index cac98fffaace..95129e6b90dc 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -940,10 +940,8 @@ void SwViewShell::SetEmptyDbFieldHidesPara(bool 
bEmptyDbFieldHidesPara)
 GetDoc()->getIDocumentState().SetModified();
 for (auto const & pFieldType : 
*GetDoc()->getIDocumentFieldsAccess().GetFieldTypes())
 {
-if (pFieldType->Which() == SwFieldIds::Database)
-{
-pFieldType->ModifyNotification(nullptr, nullptr);
-}
+if(pFieldType->Which() == SwFieldIds::Database)
+pFieldType->UpdateFields();
 }
 EndAction();
 }
@@ -2172,10 +2170,7 @@ void SwViewShell::ImplApplyViewOptions( const 
SwViewOption  )
 SwHiddenParaFieldType* pFieldType = 
static_cast(GetDoc()->
   
getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::HiddenPara));
 if( pFieldType && pFieldType->HasWriterListeners() )
-{
-SwMsgPoolItem aHint( RES_HIDDENPARA_PRINT );
-pFieldType->ModifyNotification( , nullptr);
-}
+pFieldType->PrintHiddenPara();
 bReformat = true;
 }
 if ( !bReformat && mpOpt->IsShowHiddenChar() != rOpt.IsShowHiddenChar() )
commit d0292dd0a3bd241ab073bea6f5a985b8be154d78
Author: Bjoern Michaelsen 
AuthorDate: Mon Nov 2 10:41:44 2020 +0100
Commit: Bjoern Michaelsen 
CommitDate: Mon Nov 2 15:05:55 2020 +0100

sw/source/core/undo: ModifyNotification no more ...

- also: introduce SwFormat::RemoveAllUnos() as a member function,
  because that is where this belongs ...
- ... and then also use it elsewhere if possible.

Change-Id: I9cc073a41ef1077429f648309806fa433bdcec99
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105173
Tested-by: Jenkins
Reviewed-by: Bjoern Michaelsen 

diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx
index de607a382da3..d04799bcf7fd 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -250,6 +250,7 @@ public:
 // Access to DrawingLayer FillAttributes in 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2020-10-05 Thread Michael Stahl (via logerrit)
 sw/inc/swtable.hxx  |4 +++-
 sw/inc/tblsel.hxx   |8 ++--
 sw/source/core/doc/gctable.cxx  |   15 +++
 sw/source/core/docnode/node.cxx |2 ++
 4 files changed, 26 insertions(+), 3 deletions(-)

New commits:
commit e65b1ba0033e1adaa4135539bb7b34b28cbedd7c
Author: Michael Stahl 
AuthorDate: Thu Oct 1 17:29:06 2020 +0200
Commit: Michael Stahl 
CommitDate: Mon Oct 5 12:54:09 2020 +0200

sw: SwTable::GCLines(): don't throw away row background

If there's a row background, and a cell in the row doesn't override it,
apply the row background to the cell.

Change-Id: I37cd33249d3ab66c898c537e3bc6bab067d6f74b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103772
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/doc/gctable.cxx b/sw/source/core/doc/gctable.cxx
index 355eb70538dd..7f428dee033c 100644
--- a/sw/source/core/doc/gctable.cxx
+++ b/sw/source/core/doc/gctable.cxx
@@ -360,6 +360,21 @@ static bool lcl_MergeGCBox(SwTableBox* pTableBox, 
GCLinePara* pPara)
 for( auto pTabBox : pCpyLine->GetTabBoxes() )
 pTabBox->SetUpper( pInsLine );
 
+SfxPoolItem const* pRowBrush(nullptr);
+pCpyLine->GetFrameFormat()->GetItemState(RES_BACKGROUND, true, 
);
+if (pRowBrush)
+{
+for (auto pBox : pCpyLine->GetTabBoxes())
+{
+SfxPoolItem const* pCellBrush(nullptr);
+if (pBox->GetFrameFormat()->GetItemState(RES_BACKGROUND, 
true, ) != SfxItemState::SET)
+{   // set inner row background on inner cell
+pBox->ClaimFrameFormat();
+pBox->GetFrameFormat()->SetFormatAttr(*pRowBrush);
+}
+}
+}
+
 // remove the old box from its parent line
 it = pInsLine->GetTabBoxes().erase( it );
 // insert the nested line's boxes in its place
commit 309868c32f00e5ca045f941deafb5216aad2538c
Author: Michael Stahl 
AuthorDate: Thu Oct 1 17:26:43 2020 +0200
Commit: Michael Stahl 
CommitDate: Mon Oct 5 12:53:55 2020 +0200

sw: improve comments, dump rowspan to nodes.xml

Change-Id: Ifcd011f6d55ac534c449050d07009680dcd71d51
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103771
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index bb43c2e86388..66a1795ce183 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -310,7 +310,9 @@ public:
 // Search in format for registered table.
 static SwTable * FindTable( SwFrameFormat const*const pFormat );
 
-// Clean up structure a bit.
+// Clean up structure of subtables a bit:
+// convert row with 1 box with subtable; box with subtable with 1 row;
+// by removing the subtable (both recursively)
 void GCLines();
 
 // Returns the table node via m_TabSortContentBoxes or pTableNode.
diff --git a/sw/inc/tblsel.hxx b/sw/inc/tblsel.hxx
index 4d929ba224a7..35f88cb9bb54 100644
--- a/sw/inc/tblsel.hxx
+++ b/sw/inc/tblsel.hxx
@@ -160,8 +160,8 @@ class FndBox_
 FndLines_t m_Lines;
 FndLine_* m_pUpper;
 
-SwTableLine *m_pLineBefore;   // For deleting/restoring the layout.
-SwTableLine *m_pLineBehind;
+SwTableLine *m_pLineBefore; ///< For deleting/restoring the layout.
+SwTableLine *m_pLineBehind; ///< For deleting/restoring the layout.
 
 FndBox_(FndBox_ const&) = delete;
 FndBox_& operator=(FndBox_ const&) = delete;
@@ -224,6 +224,10 @@ struct FndPara
 : rBoxes(rPara.rBoxes), pFndLine(pFL), pFndBox(rPara.pFndBox) {}
 };
 
+/** This creates a structure mirroring the SwTable structure that contains all
+rows and non-leaf boxes (as pointers to SwTableBox/SwTableLine, not 
copies),
+plus the leaf boxes that are selected by pFndPara->rBoxes
+ */
 SW_DLLPUBLIC void ForEach_FndLineCopyCol(SwTableLines& rLines, FndPara* 
pFndPara );
 
 #endif // INCLUDED_SW_INC_TBLSEL_HXX
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 94beca340c78..b65b45fe5196 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1028,6 +1028,8 @@ void SwStartNode::dumpAsXml(xmlTextWriterPtr pWriter) 
const
 }
 else if (GetStartNodeType() == SwTableBoxStartNode)
 {
+if (SwTableBox* pBox = GetTableBox())
+xmlTextWriterWriteAttribute(pWriter, BAD_CAST("rowspan"), 
BAD_CAST(OString::number(pBox->getRowSpan()).getStr()));
 xmlTextWriterStartElement(pWriter, BAD_CAST("attrset"));
 if (SwTableBox* pBox = GetTableBox())
 pBox->GetFrameFormat()->GetAttrSet().dumpAsXml(pWriter);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source vcl/unx

2020-10-05 Thread Caolán McNamara (via logerrit)
 sw/inc/flddat.hxx  |2 +-
 sw/source/core/fields/docufld.cxx  |4 ++--
 sw/source/core/fields/flddat.cxx   |   10 +-
 sw/source/core/unocore/unocoll.cxx |   16 
 sw/source/core/unocore/unoidx.cxx  |   12 ++--
 vcl/unx/gtk3/gtk3gtksys.cxx|   37 +
 6 files changed, 23 insertions(+), 58 deletions(-)

New commits:
commit 73b1188a3af5edce43508965f95fab1345ccda0e
Author: Caolán McNamara 
AuthorDate: Sun Oct 4 20:57:30 2020 +0100
Commit: Caolán McNamara 
CommitDate: Mon Oct 5 12:40:35 2020 +0200

we are guaranteed to have gdk_screen_get_primary_monitor now

Change-Id: I03419ff5233da53aeb3644f62357c983b0fe76ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103930
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/unx/gtk3/gtk3gtksys.cxx b/vcl/unx/gtk3/gtk3gtksys.cxx
index 379c87343ae8..a0627a6f81e2 100644
--- a/vcl/unx/gtk3/gtk3gtksys.cxx
+++ b/vcl/unx/gtk3/gtk3gtksys.cxx
@@ -186,46 +186,11 @@ bool GtkSalSystem::IsUnifiedDisplay()
 return gdk_display_get_n_screens (mpDisplay) == 1;
 }
 
-namespace {
-int _fallback_get_primary_monitor (GdkScreen *pScreen)
-{
-// Use monitor name as primacy heuristic
-int max = gdk_screen_get_n_monitors (pScreen);
-for (int i = 0; i < max; ++i)
-{
-char *name = gdk_screen_get_monitor_plug_name (pScreen, i);
-bool bLaptop = (name && !g_ascii_strncasecmp (name, "LVDS", 4));
-g_free (name);
-if (bLaptop)
-return i;
-}
-return 0;
-}
-
-int _get_primary_monitor (GdkScreen *pScreen)
-{
-static int (*get_fn) (GdkScreen *) = nullptr;
-get_fn = gdk_screen_get_primary_monitor;
-// Perhaps we have a newer gtk+ with this symbol:
-if (!get_fn)
-{
-get_fn = 
reinterpret_cast(osl_getAsciiFunctionSymbol(nullptr,
-"gdk_screen_get_primary_monitor"));
-}
-if (!get_fn)
-get_fn = _fallback_get_primary_monitor;
-if (get_fn)
-return get_fn (pScreen);
-else
-return 0;
-}
-} // end anonymous namespace
-
 unsigned int GtkSalSystem::GetDisplayBuiltInScreen()
 {
 GdkScreen *pDefault = gdk_display_get_default_screen (mpDisplay);
 int idx = getScreenIdxFromPtr (pDefault);
-return idx + _get_primary_monitor (pDefault);
+return idx + gdk_screen_get_primary_monitor(pDefault);
 }
 
 tools::Rectangle GtkSalSystem::GetDisplayScreenPosSizePixel (unsigned int 
nScreen)
commit 1d35f90dfe46cadc913e35f509669785cfa8ec18
Author: Caolán McNamara 
AuthorDate: Sun Oct 4 19:58:51 2020 +0100
Commit: Caolán McNamara 
CommitDate: Mon Oct 5 12:40:13 2020 +0200

SwDateTimeField::GetDateTime always dereferences its SwDoc*

ditto:
SwXFrameEnumeration ctor
lcl_ReAssignTOXType

Change-Id: Idaa6bef29cbc4c3a08d578ef4bedcaa071547944
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103928
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sw/inc/flddat.hxx b/sw/inc/flddat.hxx
index 66f13c98bf51..38c16c9039a3 100644
--- a/sw/inc/flddat.hxx
+++ b/sw/inc/flddat.hxx
@@ -68,7 +68,7 @@ public:
 DateGetDate() const;
 tools::Time GetTime() const;
 voidSetDateTime(const DateTime& rDT);
-static double   GetDateTime(SwDoc* pDoc, const DateTime& rDT);
+static double   GetDateTime(SwDoc& rDoc, const DateTime& rDT);
 
 virtual boolQueryValue( css::uno::Any& rVal, sal_uInt16 
nMId ) const override;
 virtual boolPutValue( const css::uno::Any& rVal, 
sal_uInt16 nMId ) override;
diff --git a/sw/source/core/fields/docufld.cxx 
b/sw/source/core/fields/docufld.cxx
index cca0e4ee8c7f..196dcba31d3b 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -952,7 +952,7 @@ OUString SwDocInfoFieldType::Expand( sal_uInt16 nSub, 
sal_uInt32 nFormat,
 else
 {
 // start the number formatter
-double fVal = SwDateTimeField::GetDateTime( GetDoc(),
+double fVal = SwDateTimeField::GetDateTime( *GetDoc(),
 aDate);
 aStr = ExpandValue(fVal, nFormat, nLang);
 }
@@ -968,7 +968,7 @@ OUString SwDocInfoFieldType::Expand( sal_uInt16 nSub, 
sal_uInt32 nFormat,
 else
 {
 // start the number formatter
-double fVal = SwDateTimeField::GetDateTime( GetDoc(),
+double fVal = SwDateTimeField::GetDateTime( *GetDoc(),
 aDate);
 aStr = ExpandValue(fVal, nFormat, nLang);
 }
diff --git a/sw/source/core/fields/flddat.cxx 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2020-07-24 Thread Szymon Kłos (via logerrit)
 sw/inc/swabstdlg.hxx|7 +-
 sw/source/ui/chrdlg/break.cxx   |   34 ++
 sw/source/ui/dialog/swdlgfact.cxx   |   27 +++
 sw/source/ui/dialog/swdlgfact.hxx   |9 ++-
 sw/source/uibase/inc/break.hxx  |2 
 sw/source/uibase/shells/basesh.cxx  |4 +
 sw/source/uibase/shells/textsh1.cxx |   86 ++--
 7 files changed, 89 insertions(+), 80 deletions(-)

New commits:
commit c20b10817690d8c3990c1bf71fe6f998b166d146
Author: Szymon Kłos 
AuthorDate: Mon Jul 20 12:29:44 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri Jul 24 09:12:59 2020 +0200

Make Title Page dialog async

Change-Id: I5d7b3b494e874a5107f4977fb7d93802b241f833
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99036
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99281
Tested-by: Jenkins

diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index c01c31da877c..34b42f64351a 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -2513,7 +2513,9 @@ void SwBaseShell::ExecDlg(SfxRequest )
 {
 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
 ScopedVclPtr 
pDlg(pFact->CreateTitlePageDlg(pMDI));
-pDlg->Execute();
+VclAbstractDialog::AsyncContext aContext;
+aContext.maEndDialogFn = [](sal_Int32){};
+pDlg->StartExecuteAsync(aContext);
 }
 break;
 case FN_FORMAT_PAGE_DLG:
commit c32f31309fc0d8a846418fd373608dd6f84c7972
Author: Szymon Kłos 
AuthorDate: Mon Jul 20 11:35:00 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri Jul 24 09:12:47 2020 +0200

Make InsertBreak dialog async

Change-Id: I2191ef0ea6b79bd45d682eb1ae6b0d60627f7486
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99033
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99280
Tested-by: Jenkins

diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 1533d816eb8e..0b530d170e77 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -229,15 +229,16 @@ public:
 
 };
 
-class AbstractSwBreakDlg : public VclAbstractDialog
+class AbstractSwBreakDlg
 {
 protected:
-virtual ~AbstractSwBreakDlg() override = default;
+virtual ~AbstractSwBreakDlg() = default;
 public:
 virtual OUStringGetTemplateName() = 0;
 virtual sal_uInt16  GetKind() = 0;
 virtual ::std::optional   GetPageNumber() = 0;
 
+virtual std::shared_ptr getDialogController() = 0;
 };
 
 class AbstractSplitTableDialog : public VclAbstractDialog // add for
@@ -379,7 +380,7 @@ public:
 SvStream* 
pStream) = 0;
 virtual VclPtr CreateSwInsertBookmarkDlg(weld::Window 
*pParent, SwWrtShell , SfxRequest& rReq) = 0;
 
-virtual VclPtr CreateSwBreakDlg(weld::Window *pParent, 
SwWrtShell ) = 0;
+virtual std::shared_ptr CreateSwBreakDlg(weld::Window 
*pParent, SwWrtShell ) = 0;
 virtual VclPtr CreateSwChangeDBDlg(SwView& rVw) = 0;
 virtual VclPtr  CreateSwCharDlg(weld::Window* 
pParent, SwView& pVw, const SfxItemSet& rCoreSet,
 SwCharDlgMode nDialogMode, const OUString* pFormatStr = nullptr) = 0;
diff --git a/sw/source/ui/chrdlg/break.cxx b/sw/source/ui/chrdlg/break.cxx
index 80f0d19fd641..03b316895b09 100644
--- a/sw/source/ui/chrdlg/break.cxx
+++ b/sw/source/ui/chrdlg/break.cxx
@@ -31,32 +31,27 @@
 #include 
 #include 
 
-short SwBreakDlg::run()
+void SwBreakDlg::rememberResult()
 {
-short nRet = GenericDialogController::run();
-if (nRet == RET_OK)
+nKind = 0;
+if (m_xLineBtn->get_active())
+nKind = 1;
+else if(m_xColumnBtn->get_active())
+nKind = 2;
+else if(m_xPageBtn->get_active())
 {
-nKind = 0;
-if (m_xLineBtn->get_active())
-nKind = 1;
-else if(m_xColumnBtn->get_active())
-nKind = 2;
-else if(m_xPageBtn->get_active())
+nKind = 3;
+const int nPos = m_xPageCollBox->get_active();
+if (nPos != 0 && nPos != -1)
 {
-nKind = 3;
-const int nPos = m_xPageCollBox->get_active();
-if (nPos != 0 && nPos != -1)
+m_aTemplate = m_xPageCollBox->get_active_text();
+oPgNum.reset();
+if (m_xPageNumBox->get_active())
 {
-m_aTemplate = m_xPageCollBox->get_active_text();
-oPgNum.reset();
-if (m_xPageNumBox->get_active())
-{
-oPgNum = 
static_cast(m_xPageNumEdit->get_value());
-}
+oPgNum = static_cast(m_xPageNumEdit->get_value());
 }
 }
 }
-return nRet;
 }
 
 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2020-02-02 Thread Noel Grandin (via logerrit)
 sw/inc/accmap.hxx |4 ++--
 sw/inc/doc.hxx|3 ++-
 sw/source/core/doc/DocumentRedlineManager.cxx |4 ++--
 sw/source/core/doc/doc.cxx|4 ++--
 sw/source/core/doc/docftn.cxx |2 +-
 sw/source/core/doc/doclay.cxx |4 ++--
 sw/source/core/doc/doctxm.cxx |2 +-
 sw/source/core/doc/ftnidx.cxx |4 ++--
 sw/source/core/undo/unsect.cxx|2 +-
 9 files changed, 15 insertions(+), 14 deletions(-)

New commits:
commit 220cdd6f2c178a115dd2776658fdaaf826315eed
Author: Noel Grandin 
AuthorDate: Sun Feb 2 12:41:43 2020 +0200
Commit: Noel Grandin 
CommitDate: Sun Feb 2 12:51:33 2020 +0100

std::set->o3tl::sorted_vector in SwDoc

Change-Id: Id8f6df99245aeb25e1c32ef4d7c06187c8ab353e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87823
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index f19ea9d40269..20954f7ed608 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -21,6 +21,7 @@
 
 // SwDoc interfaces
 #include 
+#include 
 #include 
 #include "swdllapi.h"
 #include "swtypes.hxx"
@@ -680,7 +681,7 @@ public:
 OUString GetUniqueFrameName() const;
 OUString GetUniqueShapeName() const;
 
-std::set GetAllLayouts();
+o3tl::sorted_vector GetAllLayouts();
 
 void SetFlyName( SwFlyFrameFormat& rFormat, const OUString& rName );
 const SwFlyFrameFormat* FindFlyByName( const OUString& rName, SwNodeType 
nNdTyp = SwNodeType::NONE ) const;
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index 57621a2f6cd9..768f4772a9c2 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -936,7 +936,7 @@ void DocumentRedlineManager::SetRedlineFlags( RedlineFlags 
eMode )
 CheckAnchoredFlyConsistency(m_rDoc);
 CHECK_REDLINE( *this )
 
-std::set hiddenLayouts;
+o3tl::sorted_vector hiddenLayouts;
 if (eShowMode == (RedlineFlags::ShowInsert | 
RedlineFlags::ShowDelete))
 {
 // sw_redlinehide: the problem here is that MoveFromSection
@@ -944,7 +944,7 @@ void DocumentRedlineManager::SetRedlineFlags( RedlineFlags 
eMode )
 // SwRangeRedline has wrong positions until after the nodes
 // are all moved, so fix things up by force by re-creating
 // all merged frames from scratch.
-std::set const layouts(m_rDoc.GetAllLayouts());
+o3tl::sorted_vector const 
layouts(m_rDoc.GetAllLayouts());
 for (SwRootFrame *const pLayout : layouts)
 {
 if (pLayout->IsHideRedlines())
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 4ad631e560b2..7cf8984bbae9 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1184,7 +1184,7 @@ static bool lcl_CheckSmartTagsAgain( const SwNodePtr& 
rpNd, void*  )
  */
 void SwDoc::SpellItAgainSam( bool bInvalid, bool bOnlyWrong, bool bSmartTags )
 {
-std::set aAllLayouts = GetAllLayouts();
+o3tl::sorted_vector aAllLayouts = GetAllLayouts();
 assert(getIDocumentLayoutAccess().GetCurrentLayout() && "SpellAgain: 
Where's my RootFrame?");
 if( bInvalid )
 {
@@ -1207,7 +1207,7 @@ void SwDoc::InvalidateAutoCompleteFlag()
 SwRootFrame* pTmpRoot = getIDocumentLayoutAccess().GetCurrentLayout();
 if( pTmpRoot )
 {
-std::set aAllLayouts = GetAllLayouts();
+o3tl::sorted_vector aAllLayouts = GetAllLayouts();
 for( auto aLayout : aAllLayouts )
 aLayout->AllInvalidateAutoCompleteWords();
 for( sal_uLong nNd = 1, nCnt = GetNodes().Count(); nNd < nCnt; ++nNd )
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index 882959ede139..9bd2a9ec63c7 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -316,7 +316,7 @@ void SwDoc::SetFootnoteInfo(const SwFootnoteInfo& rInfo)
 
 if (pTmpRoot)
 {
-std::set aAllLayouts = GetAllLayouts();
+o3tl::sorted_vector aAllLayouts = GetAllLayouts();
 if ( bFootnotePos )
 for( auto aLayout : aAllLayouts )
 aLayout->AllRemoveFootnotes();
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index b5a98cf724dd..4b43892c4abe 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1657,9 +1657,9 @@ bool SwDoc::IsInVerticalText( const SwPosition& rPos ) 
const
 return SvxFrameDirection::Vertical_RL_TB == nDir || 
SvxFrameDirection::Vertical_LR_TB == nDir;
 }
 
-std::set SwDoc::GetAllLayouts()
+o3tl::sorted_vector SwDoc::GetAllLayouts()
 {
-std::set aAllLayouts;
+o3tl::sorted_vector aAllLayouts;
 SwViewShell *pStart = 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2019-12-20 Thread Noel Grandin (via logerrit)
 sw/inc/cmdid.h   |   15 ---
 sw/source/filter/html/swhtml.cxx |1 +
 sw/source/filter/html/swhtml.hxx |1 -
 3 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit ee6ce44b4227a9a84b962b458e2209b39e26dc73
Author: Noel Grandin 
AuthorDate: Wed Dec 18 11:56:00 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Dec 20 13:28:50 2019 +0100

loplugin:duplicate-defines

already defined in wrthtml.hxx, randomly chose a place to keep it

Change-Id: I8aa1d20bee04a5c1e5919b593e6befddb593f18a
Reviewed-on: https://gerrit.libreoffice.org/85566
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index ddafcc9f0cee..845ca782f394 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -106,6 +106,7 @@
 #include 
 #include "htmlnum.hxx"
 #include "swhtml.hxx"
+#include "wrthtml.hxx"
 #include 
 #include 
 #include 
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index d4f9876e3ab6..c8d58de80b6a 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -55,7 +55,6 @@ struct SwPending;
 class SvxCSS1PropertyInfo;
 struct ImplSVEvent;
 
-#define HTML_PARSPACE (MM50)
 #define HTML_CJK_PARSPACE (MM50/2)
 #define HTML_CTL_PARSPACE (MM50/2)
 
commit c3f9eba777a508f4fb0bfd5cbe2cbfb399366caa
Author: Noel Grandin 
AuthorDate: Wed Dec 18 10:43:59 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Dec 20 13:28:38 2019 +0100

loplugin:duplicate-defines

Change-Id: I38694d03dbe2e5d8eba94e2d2a490db7b91efaad
Reviewed-on: https://gerrit.libreoffice.org/85563
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index f382e820cf0b..30663dbbe670 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -21,24 +21,25 @@
 #define INCLUDED_SW_INC_CMDID_H
 
 #include 
+#include 
 #include 
 
 #define FN_FILE SID_SW_START
-#define FN_EDIT (SID_SW_START +  100)
+//#define FN_EDIT (SID_SW_START +  100) defined in svxids.hrc
 #define FN_VIEW (SID_SW_START +  200)
-#define FN_INSERT   (SID_SW_START +  300)
-#define FN_FORMAT   (SID_SW_START +  400)
-#define FN_EXTRA(SID_SW_START +  600)
-#define FN_SELECTION(SID_SW_START +  900)
+//#define FN_INSERT   (SID_SW_START +  300) defined in svxids.hrc
+//#define FN_FORMAT   (SID_SW_START +  400) defined in svxids.hrc
+//#define FN_EXTRA(SID_SW_START +  600) defined in svxids.hrc
+//#define FN_SELECTION(SID_SW_START +  900) defined in svxids.hrc
 #define FN_QUERY(SID_SW_START + 1000)
 #define FN_ENVELP   (SID_SW_START + 1050)
 #define FN_PARAM(SID_SW_START + 1100)
 #define FN_STAT (SID_SW_START + 1180)
-#define FN_PGPREVIEW(SID_SW_START + 1250)
+//#define FN_PGPREVIEW(SID_SW_START + 1250) defined in svxids.hrc
 #define FN_FRAME(SID_SW_START + 1300)
 #define FN_INSERT2  (SID_SW_START + 1400)
 #define FN_FORMAT2  (SID_SW_START + 1600)
-#define FN_EDIT2(SID_SW_START + 1800)
+//#define FN_EDIT2(SID_SW_START + 1800) defined in svxids.hrc
 #define FN_QUERY2   (SID_SW_START + 2000)
 #define FN_EXTRA2   (SID_SW_START + 2200)
 #define FN_PARAM2   (SID_SW_START + 2400)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2019-12-11 Thread Noel Grandin (via logerrit)
 sw/inc/comcore.hxx  |2 
 sw/inc/poolfmt.hxx  |   44 ++---
 sw/inc/strings.hrc  |   44 ++---
 sw/inc/swtypes.hxx  |   10 -
 sw/inc/viewsh.hxx   |2 
 sw/source/core/doc/DocumentStylePoolManager.cxx |  188 
 sw/source/core/doc/SwStyleNameMapper.cxx|4 
 sw/source/core/doc/number.cxx   |4 
 sw/source/core/doc/poolfmt.cxx  |4 
 sw/source/core/edit/autofmt.cxx |   20 +-
 sw/source/core/layout/fly.cxx   |2 
 sw/source/core/layout/pagechg.cxx   |4 
 sw/source/core/layout/paintfrm.cxx  |   20 +-
 sw/source/core/tox/tox.cxx  |2 
 sw/source/core/unocore/unosett.cxx  |2 
 sw/source/core/view/viewsh.cxx  |   10 -
 sw/source/filter/html/css1atr.cxx   |   10 -
 sw/source/filter/html/htmlatr.cxx   |   34 ++--
 sw/source/filter/html/htmlcss1.cxx  |4 
 sw/source/filter/html/htmlgrin.cxx  |2 
 sw/source/filter/html/htmlnum.hxx   |4 
 sw/source/filter/html/htmlnumreader.cxx |   24 +--
 sw/source/filter/html/htmlnumwriter.cxx |8 -
 sw/source/filter/html/htmltab.cxx   |2 
 sw/source/filter/html/htmltabw.cxx  |2 
 sw/source/filter/html/swhtml.cxx|   16 +-
 sw/source/filter/html/swhtml.hxx|   10 -
 sw/source/filter/html/wrthtml.cxx   |2 
 sw/source/filter/html/wrthtml.hxx   |   10 -
 sw/source/filter/ww8/wrtw8sty.cxx   |   20 +-
 sw/source/ui/config/optpage.cxx |6 
 sw/source/ui/fmtui/tmpdlg.cxx   |2 
 sw/source/ui/misc/num.cxx   |2 
 sw/source/uibase/app/docshini.cxx   |6 
 sw/source/uibase/docvw/FrameControlsManager.cxx |8 -
 sw/source/uibase/docvw/PageBreakWin.cxx |2 
 sw/source/uibase/docvw/edtwin.cxx   |   32 ++--
 sw/source/uibase/shells/txtcrsr.cxx |8 -
 sw/source/uibase/shells/txtnum.cxx  |2 
 sw/source/uibase/uiview/view.cxx|8 -
 sw/source/uibase/wrtsh/wrtsh1.cxx   |2 
 41 files changed, 294 insertions(+), 294 deletions(-)

New commits:
commit 696689c1da7dd8097a2322548572a0fe44b17c28
Author: Noel Grandin 
AuthorDate: Wed Dec 11 11:23:15 2019 +0200
Commit: Noel Grandin 
CommitDate: Wed Dec 11 15:45:36 2019 +0100

num->number and bul->bullet in sw/

make some symbols easier to read

Change-Id: Icb5ea48dce1bcf4ae17e57e8f4c7bec3acd33f82
Reviewed-on: https://gerrit.libreoffice.org/84924
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/comcore.hxx b/sw/inc/comcore.hxx
index 4ef35ae44bf9..6b6230e87268 100644
--- a/sw/inc/comcore.hxx
+++ b/sw/inc/comcore.hxx
@@ -39,7 +39,7 @@
 #define STR_AUTOFMTREDL_SET_TMPL_NEG_INDENT 16
 #define STR_AUTOFMTREDL_SET_TMPL_TEXT_INDENT17
 #define STR_AUTOFMTREDL_SET_TMPL_HEADLINE   18
-#define STR_AUTOFMTREDL_SET_NUMBULLET   19
+#define STR_AUTOFMTREDL_SET_NUMBER_BULLET   19
 #define STR_AUTOFMTREDL_DEL_MORELINES   20
 #define STR_AUTOFMTREDL_NON_BREAK_SPACE 21
 // !!  always set the correct end 
diff --git a/sw/inc/poolfmt.hxx b/sw/inc/poolfmt.hxx
index 22b075978aff..2f66749e30a9 100644
--- a/sw/inc/poolfmt.hxx
+++ b/sw/inc/poolfmt.hxx
@@ -116,7 +116,7 @@ RES_POOLCHR_PAGENO, ///< 
Pages/field.
 RES_POOLCHR_LABEL,  ///< Label.
 RES_POOLCHR_DROPCAPS,   ///< Dropcaps.
 RES_POOLCHR_NUM_LEVEL,  ///< Numbering symbols
-RES_POOLCHR_BUL_LEVEL,  ///< Bullets.
+RES_POOLCHR_BULLET_LEVEL,   ///< Bullets.
 
 RES_POOLCHR_INET_NORMAL,///< Internet normal.
 RES_POOLCHR_INET_VISIT, ///< Internet visited.
@@ -275,7 +275,7 @@ RES_POOLCOLL_TEXT_END,
 /// Group lists.
 RES_POOLCOLL_LISTS_BEGIN = COLL_LISTS_BITS,
 
-RES_POOLCOLL_NUMBUL_BASE = RES_POOLCOLL_LISTS_BEGIN,///< Base list.
+RES_POOLCOLL_NUMBER_BULLET_BASE = RES_POOLCOLL_LISTS_BEGIN,///< Base list.
 
 /// Subgroup numberings.
 RES_POOLCOLL_NUM_LEVEL1S,   ///< Start 1st level.
@@ -300,26 +300,26 @@ RES_POOLCOLL_NUM_LEVEL5E,   
///< End 5th level.
 RES_POOLCOLL_NUM_NONUM5,///< No numbering.
 
 ///Subgroup bullets.
-RES_POOLCOLL_BUL_LEVEL1S,   ///< Start 1st level.
-RES_POOLCOLL_BUL_LEVEL1,///< 1st level.
-RES_POOLCOLL_BUL_LEVEL1E,

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source writerfilter/source

2019-12-02 Thread Justin Luth (via logerrit)
 sw/inc/ftnidx.hxx|6 
 sw/inc/txatritr.hxx  |6 
 sw/source/core/doc/ftnidx.cxx|8 -
 sw/source/core/inc/UndoInsert.hxx|   18 +-
 sw/source/core/txtnode/txatritr.cxx  |   30 +--
 sw/source/core/undo/unins.cxx|  116 +++
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |   38 
 writerfilter/source/dmapper/DomainMapperTableHandler.hxx |2 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx|8 -
 writerfilter/source/dmapper/DomainMapper_Impl.hxx|   10 -
 10 files changed, 92 insertions(+), 150 deletions(-)

New commits:
commit 749fd6508504cf3b2e3822eca52a67fa36d75fb8
Author: Justin Luth 
AuthorDate: Sat Nov 30 12:07:11 2019 +0300
Commit: László Németh 
CommitDate: Mon Dec 2 11:00:25 2019 +0100

revert obsolete writerfilter hacks for tdf#119054 and tdf#128752

These are obsoleted in LibreOffice 6.5 by tdf#118947's
commit 6bced3c6a1bf8d4652dd6ba75e41b128ce1bfc5c

Both of these hacks were backported to 6.4, but
I have no intention of backporting my patch.

Change-Id: Ie639b9d55d90d25b58e140fba443fce98f2d7ba1
Reviewed-on: https://gerrit.libreoffice.org/84125
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: László Németh 

diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 9fa23720ba00..fb596a983204 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -809,9 +809,6 @@ CellPropertyValuesSeq_t 
DomainMapperTableHandler::endTableGetCellProperties(Tabl
 // Remove properties from style/row that aren't allowed in 
cells
 pAllCellProps->Erase( PROP_HEADER_ROW_COUNT );
 pAllCellProps->Erase( PROP_TBL_HEADER );
-// Remove paragraph properties from style/row that paragraph 
style can overwrite
-pAllCellProps->Erase( PROP_PARA_BOTTOM_MARGIN );
-pAllCellProps->Erase( PROP_PARA_LINE_SPACING );
 
 // Then add the cell properties
 pAllCellProps->InsertProps(*aCellIterator);
@@ -984,36 +981,6 @@ css::uno::Sequence 
DomainMapperTableHandler::endTabl
 return aRowProperties;
 }
 
-// table style has got bigger precedence than docDefault style,
-// but lower precedence than the paragraph styles and direct paragraph 
formatting
-void DomainMapperTableHandler::ApplyParaProperty(css::beans::PropertyValues 
aTableProperties, PropertyIds eId)
-{
-OUString sPropertyName = getPropertyName(eId);
-auto pTableProp = std::find_if(aTableProperties.begin(), 
aTableProperties.end(),
-[&](const beans::PropertyValue& rProp) { return rProp.Name == 
sPropertyName; });
-if (pTableProp != aTableProperties.end())
-{
-uno::Any aValue = pTableProp->Value;
-for (const auto& rParaProp : m_rDMapper_Impl.m_aParagraphsToEndTable)
-{
-// there is no direct paragraph formatting
-if (!rParaProp.m_pPropertyMap->isSet(eId))
-{
-OUString sParaStyleName;
-rParaProp.m_rPropertySet->getPropertyValue("ParaStyleName") 
>>= sParaStyleName;
-StyleSheetEntryPtr pEntry = 
m_rDMapper_Impl.GetStyleSheetTable()->FindStyleSheetByConvertedStyleName(sParaStyleName);
-uno::Any aMargin = 
m_rDMapper_Impl.GetPropertyFromStyleSheet(eId, pEntry, true, true);
-uno::Any aMarginDocDefault = 
m_rDMapper_Impl.GetPropertyFromStyleSheet(eId, nullptr, true, true);
-// use table style only when 1) both values are empty (no 
docDefault and paragraph style definitions) or
-// 2) both non-empty values are equal (docDefault paragraph 
properties are copied to the base paragraph style during import)
-// TODO check the case, when two parent styles modify the 
docDefault and the last one set back the docDefault value
-if (aMargin == aMarginDocDefault)
-rParaProp.m_rPropertySet->setPropertyValue(sPropertyName, 
aValue);
-}
-}
-}
-}
-
 void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool 
bTableStartsAtCellStart)
 {
 #ifdef DBG_UTIL
@@ -,10 +1078,6 @@ void DomainMapperTableHandler::endTable(unsigned int 
nestedTableLevel, bool bTab
 }
 }
 }
-
-// OOXML table style may container paragraph properties, apply 
these now.
-ApplyParaProperty(aTableInfo.aTableProperties, 
PROP_PARA_BOTTOM_MARGIN);
-ApplyParaProperty(aTableInfo.aTableProperties, 
PROP_PARA_LINE_SPACING);
 }
 }
 catch ( const 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2019-10-04 Thread Michael Stahl (via logerrit)
 sw/inc/IDocumentMarkAccess.hxx |2 ++
 sw/inc/hintids.hxx |1 +
 sw/source/core/doc/docbm.cxx   |   18 +-
 sw/source/core/inc/MarkManager.hxx |1 +
 sw/source/core/text/itratr.cxx |   16 +---
 sw/source/core/text/itrform2.cxx   |4 
 sw/source/core/text/portxt.cxx |4 ++--
 sw/source/core/txtnode/ndtxt.cxx   |1 +
 sw/source/core/undo/undel.cxx  |2 ++
 sw/source/core/unocore/unoportenum.cxx |6 +++---
 sw/source/filter/ascii/ascatr.cxx  |1 +
 sw/source/filter/html/wrthtml.cxx  |2 +-
 sw/source/filter/ww8/writerhelper.cxx  |2 +-
 sw/source/filter/ww8/wrtw8nds.cxx  |6 +++---
 14 files changed, 48 insertions(+), 18 deletions(-)

New commits:
commit 080eb8544ab65f757b0dc6c95328d3b9b47a5e64
Author: Michael Stahl 
AuthorDate: Tue Sep 24 18:06:53 2019 +0200
Commit: Michael Stahl 
CommitDate: Fri Oct 4 12:11:43 2019 +0200

sw: add CH_TXT_ATR_FIELDSEP

... and handle it in obvious places.

Change-Id: I7e9668994be0bd246f89ecc60fd0a42c240cce0c
Reviewed-on: https://gerrit.libreoffice.org/80051
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx
index 6e818b03349b..dcbc5f4247ff 100644
--- a/sw/inc/hintids.hxx
+++ b/sw/inc/hintids.hxx
@@ -50,6 +50,7 @@ class SvxLRSpaceItem;
 #define CH_TXT_ATR_FORMELEMENT u'\x0006'
 
 #define CH_TXT_ATR_FIELDSTART u'\x0007'
+#define CH_TXT_ATR_FIELDSEP u'\x0003'
 #define CH_TXT_ATR_FIELDEND u'\x0008'
 #define CH_TXT_ATR_SUBST_FIELDSTART ("[")
 #define CH_TXT_ATR_SUBST_FIELDEND ("]")
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 59b7277ff849..02f44d5cc74e 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -707,16 +707,18 @@ static sal_Int32 GetNextAttrImpl(SwTextNode const*const 
pTextNode,
 while (p < l)
 {
 sal_Unicode aChar = pStr[p];
-if (aChar < CH_TXT_ATR_FORMELEMENT
-|| aChar > CH_TXT_ATR_FIELDEND)
+switch (aChar)
 {
-++p;
-}
-else
-{
-break;
+case CH_TXT_ATR_FORMELEMENT:
+case CH_TXT_ATR_FIELDSTART:
+case CH_TXT_ATR_FIELDSEP:
+case CH_TXT_ATR_FIELDEND:
+goto break_; // sigh...
+default:
+++p;
 }
 }
+break_:
 assert(p <= nNext);
 if (p < l)
 {
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index c273d32f0009..395fcc23ce2c 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -889,11 +889,15 @@ SwTextPortion *SwTextFormatter::WhichTextPor( 
SwTextFormatInfo  ) const
 {
 if (ch == CH_TXT_ATR_FIELDSTART)
 pPor = new SwFieldFormDatePortion(pBM, true);
+else if (ch == CH_TXT_ATR_FIELDSEP)
+pPor = new SwFieldMarkPortion(); // it's added in 
DateFieldmark?
 else if (ch == CH_TXT_ATR_FIELDEND)
 pPor = new SwFieldFormDatePortion(pBM, false);
 }
 else if (ch == CH_TXT_ATR_FIELDSTART)
 pPor = new SwFieldMarkPortion();
+else if (ch == CH_TXT_ATR_FIELDSEP)
+pPor = new SwFieldMarkPortion();
 else if (ch == CH_TXT_ATR_FIELDEND)
 pPor = new SwFieldMarkPortion();
 else if (ch == CH_TXT_ATR_FORMELEMENT)
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 062343808edd..8d321ddd9b45 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -3575,6 +3575,7 @@ bool SwTextNode::CopyExpandText(SwTextNode& rDestNd, 
const SwIndex* pDestIdx,
 sal_Unicode const cur(rDestNd.GetText()[aDestIdx.GetIndex()]);
 if (   (cChar == cur) // filter substituted hidden text
 || (CH_TXT_ATR_FIELDSTART  == cur) // filter all fieldmarks
+|| (CH_TXT_ATR_FIELDSEP== cur)
 || (CH_TXT_ATR_FIELDEND== cur)
 || (CH_TXT_ATR_FORMELEMENT == cur))
 {
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index a1a8ca52f841..e23382e5f0a3 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -641,6 +641,7 @@ static bool lcl_IsSpecialCharacter(sal_Unicode nChar)
 case CH_TXT_ATR_INPUTFIELDEND:
 case CH_TXT_ATR_FORMELEMENT:
 case CH_TXT_ATR_FIELDSTART:
+case CH_TXT_ATR_FIELDSEP:
 case CH_TXT_ATR_FIELDEND:
 return true;
 
@@ -681,6 +682,7 @@ static OUString lcl_DenotedPortion(const OUString& rStr, 
sal_Int32 nStart, sal_I
 case CH_TXT_ATR_INPUTFIELDEND:
 case CH_TXT_ATR_FORMELEMENT:
 case CH_TXT_ATR_FIELDSTART:
+case CH_TXT_ATR_FIELDSEP:
 case 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2019-09-26 Thread Bjoern Michaelsen (via logerrit)
 sw/inc/ndtxt.hxx |1 
 sw/inc/node.hxx  |2 
 sw/source/core/access/accframebase.cxx   |   68 +++---
 sw/source/core/access/accframebase.hxx   |7 -
 sw/source/core/access/accnotextframe.cxx |  115 +--
 sw/source/core/access/accnotextframe.hxx |3 
 sw/source/core/access/acctable.cxx   |   39 --
 sw/source/core/access/acctable.hxx   |9 +-
 sw/source/core/access/acctextframe.cxx   |  105 
 sw/source/core/access/acctextframe.hxx   |2 
 sw/source/core/docnode/node.cxx  |   11 +-
 11 files changed, 154 insertions(+), 208 deletions(-)

New commits:
commit e412401edcf0a979f9f19c051990c0fb08987048
Author: Bjoern Michaelsen 
AuthorDate: Wed Sep 25 11:35:10 2019 +0200
Commit: Björn Michaelsen 
CommitDate: Thu Sep 26 12:47:29 2019 +0200

source/core/access: no more SwClient

- also, move BroadcastingModify up from TextNode to ContentNode

Change-Id: I4e6e8767aaecb9cce20d5ec3da789532686dfe2a
Reviewed-on: https://gerrit.libreoffice.org/79525
Tested-by: Jenkins
Reviewed-by: Björn Michaelsen 

diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 3c6a4ad10e49..125891a8cb50 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -79,7 +79,6 @@ typedef std::set< sal_Int32 > SwSoftPageBreakList;
 class SW_DLLPUBLIC SwTextNode
 : public SwContentNode
 , public ::sfx2::Metadatable
-, public sw::BroadcasterMixin
 {
 friend class SwContentNode;
 /// For creating the first TextNode.
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index 9ed3eb02579a..143213035881 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -349,7 +349,7 @@ private:
 
 // SwContentNode
 
-class SW_DLLPUBLIC SwContentNode: public SwModify, public SwNode, public 
SwIndexReg
+class SW_DLLPUBLIC SwContentNode: public sw::BroadcastingModify, public 
SwNode, public SwIndexReg
 {
 
 sw::WriterMultiListener m_aCondCollListener;
diff --git a/sw/source/core/access/accframebase.cxx 
b/sw/source/core/access/accframebase.cxx
index 2040f0c76e11..fba6ca85fcc6 100644
--- a/sw/source/core/access/accframebase.cxx
+++ b/sw/source/core/access/accframebase.cxx
@@ -126,8 +126,9 @@ SwAccessibleFrameBase::SwAccessibleFrameBase(
 SwAccessibleContext( pInitMap, nInitRole, pFlyFrame ),
 m_bIsSelected( false )
 {
-const SwFrameFormat *pFrameFormat = pFlyFrame->GetFormat();
-const_cast< SwFrameFormat * >( pFrameFormat )->Add( this );
+const SwFrameFormat* pFrameFormat = pFlyFrame->GetFormat();
+if(pFrameFormat)
+
StartListening(const_cast(pFrameFormat)->GetNotifier());
 
 SetName( pFrameFormat->GetName() );
 
@@ -206,54 +207,37 @@ SwAccessibleFrameBase::~SwAccessibleFrameBase()
 {
 }
 
-void SwAccessibleFrameBase::Modify( const SfxPoolItem* pOld, const SfxPoolItem 
*pNew)
+void SwAccessibleFrameBase::Notify(const SfxHint& rHint)
 {
-sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ;
-switch( nWhich )
+if(rHint.GetId() == SfxHintId::Dying)
+{
+EndListeningAll();
+}
+else if(auto pLegacyModifyHint = dynamic_cast())
 {
-case RES_NAME_CHANGED:
+sal_uInt16 nWhich = pLegacyModifyHint->m_pOld ? 
pLegacyModifyHint->m_pOld->Which() : pLegacyModifyHint->m_pNew ? 
pLegacyModifyHint->m_pNew->Which() : 0;
+const SwFlyFrame* pFlyFrame = static_cast(GetFrame());
+if(nWhich == RES_NAME_CHANGED && pFlyFrame)
 {
-const SwFlyFrame *pFlyFrame = static_cast< const SwFlyFrame * >( 
GetFrame() );
-if(  pFlyFrame )
-{
-const SwFrameFormat *pFrameFormat = pFlyFrame->GetFormat();
-assert(pFrameFormat == GetRegisteredIn() && "invalid frame");
+const SwFrameFormat* pFrameFormat = pFlyFrame->GetFormat();
 
-const OUString sOldName( GetName() );
-assert( !pOld ||
-static_cast(pOld)->GetString() == GetName());
+const OUString sOldName( GetName() );
+assert( !pLegacyModifyHint->m_pOld ||
+static_cast(pLegacyModifyHint->m_pOld)->GetString() == GetName());
 
-SetName( pFrameFormat->GetName() );
-assert( !pNew ||
-static_cast(pNew)->GetString() == GetName());
+SetName( pFrameFormat->GetName() );
+assert( !pLegacyModifyHint->m_pNew ||
+static_cast(pLegacyModifyHint->m_pNew)->GetString() == GetName());
 
-if( sOldName != GetName() )
-{
-AccessibleEventObject aEvent;
-aEvent.EventId = AccessibleEventId::NAME_CHANGED;
-aEvent.OldValue <<= sOldName;
-aEvent.NewValue <<= GetName();
-FireAccessibleEvent( aEvent );
-}
+if( sOldName != GetName() )

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2019-09-07 Thread Bjoern Michaelsen (via logerrit)
 sw/inc/unodraw.hxx  |   31 +++---
 sw/source/core/unocore/unodraw.cxx  |  106 ++--
 sw/source/core/unocore/unofield.cxx |1 
 sw/source/core/unocore/unoframe.cxx |1 
 sw/source/uibase/uno/unotxvw.cxx|3 -
 5 files changed, 78 insertions(+), 64 deletions(-)

New commits:
commit f2bc27972c13f54c4860a3ca995017bc5ad84e6e
Author: Bjoern Michaelsen 
AuthorDate: Fri Sep 6 23:36:23 2019 +0200
Commit: Björn Michaelsen 
CommitDate: Sat Sep 7 08:23:17 2019 +0200

kill SwXShape SwClient

this completely removes calbck.hxx from sw/source/core/unocore -- may it
never return.

Change-Id: Ie4c8b3a29fd4038a19c34116d47672b504ee9f2c
Reviewed-on: https://gerrit.libreoffice.org/78735
Tested-by: Jenkins
Reviewed-by: Björn Michaelsen 

diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx
index 6bfa4839eba7..2938e7a79114 100644
--- a/sw/inc/unodraw.hxx
+++ b/sw/inc/unodraw.hxx
@@ -20,6 +20,7 @@
 #define INCLUDED_SW_INC_UNODRAW_HXX
 
 #include 
+#include 
 #include 
 #include "calbck.hxx"
 #include "frmfmt.hxx"
@@ -130,12 +131,13 @@ cppu::WeakAggImplHelper6
 css::drawing::XShape
 >
 SwXShapeBaseClass;
-class SwXShape : public SwXShapeBaseClass, public SwClient
+class SwXShape : public SwXShapeBaseClass, public SvtListener
 {
 friend class SwXGroupShape;
 friend class SwXDrawPage;
 friend class SwFmDrawPage;
 const SwFmDrawPage* m_pPage;
+SwFrameFormat* m_pFormat;
 
 css::uno::Reference< css::uno::XAggregation > xShapeAgg;
 // reference to , determined in the
@@ -197,13 +199,19 @@ class SwXShape : public SwXShapeBaseClass, public SwClient
 @throws css::uno::RuntimeException
 */
 css::uno::Any _getPropAtAggrObj( const OUString& _rPropertyName );
+void SetFrameFormat(SwFrameFormat* pFormat)
+{
+EndListeningAll();
+StartListening(pFormat->GetNotifier());
+m_pFormat = pFormat;
+}
 
 protected:
 virtual ~SwXShape() override;
-void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) override;
 public:
 SwXShape(css::uno::Reference & xShape, SwDoc 
const*const pDoc);
 
+virtual void Notify(const SfxHint&) override;
 static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType 
) override;
 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(  ) 
override;
@@ -248,7 +256,7 @@ public:
 virtual OUString SAL_CALL getShapeType(  ) override;
 
 SwShapeDescriptor_Impl* GetDescImpl() {return pImpl.get();}
-SwFrameFormat*   GetFrameFormat() const { return 
const_cast(static_cast(GetRegisteredIn())); }
+SwFrameFormat* GetFrameFormat() const { return m_pFormat; }
 const css::uno::Reference< css::uno::XAggregation >& 
GetAggregationInterface() {return xShapeAgg;}
 
 // helper
diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index e91e4168c7fb..be29668a6b40 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -72,7 +72,6 @@
 #include 
 #include 
 #include 
-#include 
 
 using namespace ::com::sun::star;
 
@@ -575,7 +574,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape 
> & xShape)
 static_cast< cppu::OWeakObject * > ( this 
) );
 
 // we're already registered in the model / SwXDrawPage::add() already 
called
-if(pShape->m_pPage || pShape->GetRegisteredIn() || !pShape->m_bDescriptor )
+if(pShape->m_pPage || pShape->m_pFormat || !pShape->m_bDescriptor )
 return;
 
 // we're inserted elsewhere already
@@ -711,7 +710,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape 
> & xShape)
 pDoc->getIDocumentContentOperations().InsertDrawObj( *pTemp, *pObj, aSet );
 SwFrameFormat* pFormat = ::FindFrameFormat( pObj );
 if(pFormat)
-pFormat->Add(pShape);
+pShape->SetFrameFormat(pFormat);
 pShape->m_bDescriptor = false;
 
 pPam.reset();
@@ -871,6 +870,7 @@ SwXShape::SwXShape(
 uno::Reference & xShape,
 SwDoc const*const pDoc)
 : m_pPage(nullptr)
+, m_pFormat(nullptr)
 , m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_SHAPE))
 , 
m_pPropertyMapEntries(aSwMapProvider.GetPropertyMapEntries(PROPERTY_MAP_TEXT_SHAPE))
 , pImpl(new SwShapeDescriptor_Impl(pDoc))
@@ -907,9 +907,9 @@ SwXShape::SwXShape(
 SdrObject* pObj = pShape ? pShape->GetSdrObject() : nullptr;
 if(pObj)
 {
-SwFrameFormat* pFormat = ::FindFrameFormat( pObj );
+auto pFormat = ::FindFrameFormat( pObj );
 if(pFormat)
-pFormat->Add(this);
+SetFrameFormat(pFormat);
 
 lcl_addShapePropertyEventFactories( *pObj, *this );
 pImpl->bInitializedPropertyNotifier = true;
@@ -936,9 +936,9 @@ void SwXShape::AddExistingShapeToFormat( SdrObject const & 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2019-05-26 Thread Noel Grandin (via logerrit)
 sw/inc/IMark.hxx |4 
 sw/source/core/doc/docbm.cxx |8 
 2 files changed, 4 insertions(+), 8 deletions(-)

New commits:
commit 796676e0a3010ab64f43a799d3fe7e7d1a64867e
Author: Noel Grandin 
AuthorDate: Sun May 26 15:42:59 2019 +0200
Commit: Noel Grandin 
CommitDate: Sun May 26 22:14:13 2019 +0200

inline IMark::StartsAfter

Change-Id: I2b7e2df1ad3bfddb3182691720fa3aa1cdf21721
Reviewed-on: https://gerrit.libreoffice.org/72984
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/IMark.hxx b/sw/inc/IMark.hxx
index ac033d72c61f..7c0a51f8427d 100644
--- a/sw/inc/IMark.hxx
+++ b/sw/inc/IMark.hxx
@@ -64,8 +64,6 @@ namespace sw { namespace mark
 { return GetMarkStart() < rOther.GetMarkStart(); }
 bool operator==(const IMark& rOther) const
 { return GetMarkStart() == rOther.GetMarkStart(); }
-bool StartsAfter(const SwPosition& rPos) const
-{ return GetMarkStart() > rPos; }
 bool EndsBefore(const SwPosition& rPos) const
 { return GetMarkEnd() < rPos; }
 
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index e242b32d74ea..7c27f481232e 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -175,7 +175,7 @@ namespace
 bool operator()(SwPosition const& rPos,
 std::shared_ptr const& pMark)
 {
-return pMark->StartsAfter(rPos);
+return pMark->GetMarkStart() > rPos;
 }
 };
 
@@ -291,7 +291,7 @@ namespace
 {
 // Once we reach a mark starting after the target pos
 // we do not need to continue
-if(ppCurrentMark->get()->StartsAfter(rPos))
+if(ppCurrentMark->get()->GetMarkStart() > rPos)
 break;
 if(IDocumentMarkAccess::GetType(**ppCurrentMark) == eType)
 {
commit 18775b18917ff666260434a19326ab482219ba89
Author: Noel Grandin 
AuthorDate: Sun May 26 15:32:29 2019 +0200
Commit: Noel Grandin 
CommitDate: Sun May 26 22:14:02 2019 +0200

inline IMark::StartsBefore

Change-Id: Ia4f4d57899821cf735a3babadd73bbd90e84afb0
Reviewed-on: https://gerrit.libreoffice.org/72983
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/IMark.hxx b/sw/inc/IMark.hxx
index d4ac261ba5e0..ac033d72c61f 100644
--- a/sw/inc/IMark.hxx
+++ b/sw/inc/IMark.hxx
@@ -64,8 +64,6 @@ namespace sw { namespace mark
 { return GetMarkStart() < rOther.GetMarkStart(); }
 bool operator==(const IMark& rOther) const
 { return GetMarkStart() == rOther.GetMarkStart(); }
-bool StartsBefore(const SwPosition& rPos) const
-{ return GetMarkStart() < rPos; }
 bool StartsAfter(const SwPosition& rPos) const
 { return GetMarkStart() > rPos; }
 bool EndsBefore(const SwPosition& rPos) const
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 5f856cf4de0c..e242b32d74ea 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -164,7 +164,7 @@ namespace
 bool operator()(std::shared_ptr const& pMark,
 SwPosition const& rPos)
 {
-return pMark->StartsBefore(rPos);
+return pMark->GetMarkStart() < rPos;
 }
 };
 
@@ -1045,7 +1045,7 @@ namespace sw { namespace mark
 pMark->GetMarkStart(),
 CompareIMarkStartsBefore());
 for ( ; it != m_vAllMarks.end(); ++it)
-if (pMark->StartsBefore((*it)->GetMarkStart()))
+if (pMark->GetMarkStart() < (*it)->GetMarkStart())
 break;
 else if (it->get() == pMark)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2019-04-26 Thread Michael Stahl (via logerrit)
 sw/inc/undobj.hxx  |7 +-
 sw/source/core/doc/doc.cxx |2 
 sw/source/core/doc/doctxm.cxx  |  118 +
 sw/source/core/inc/UndoSection.hxx |   22 ++
 sw/source/core/undo/undobj.cxx |   20 +++---
 sw/source/core/undo/unsect.cxx |   89 +++
 sw/source/uibase/index/toxmgr.cxx  |1 
 sw/source/uibase/wrtsh/wrtsh2.cxx  |9 --
 8 files changed, 196 insertions(+), 72 deletions(-)

New commits:
commit 4f0b568ef35353b276ae560fb43502b6f6b2bfdb
Author: Michael Stahl 
AuthorDate: Thu Apr 25 18:31:08 2019 +0200
Commit: Michael Stahl 
CommitDate: Fri Apr 26 15:55:29 2019 +0200

tdf#38703 i#42807 sw: stop clearing Undo stack on ToX Update

Reverts the "fix" for i#42807 from CWS swqcore08 since there's
now SwUndoUpdateIndex.

Change-Id: I6e71513c4a6da57bafcbc3d57b8fa113153d6c2d
Reviewed-on: https://gerrit.libreoffice.org/71324
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index de810a488f33..cee2e7745278 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1733,8 +1733,6 @@ void SwDoc::ChangeTOX(SwTOXBase & rTOX, const SwTOXBase & 
rNew,
 {
 if (GetIDocumentUndoRedo().DoesUndo())
 {
-GetIDocumentUndoRedo().DelAllUndoObj();
-
 GetIDocumentUndoRedo().AppendUndo(
 std::make_unique(this, , rNew));
 }
diff --git a/sw/source/uibase/index/toxmgr.cxx 
b/sw/source/uibase/index/toxmgr.cxx
index afae269713fb..d2ed262f00b2 100644
--- a/sw/source/uibase/index/toxmgr.cxx
+++ b/sw/source/uibase/index/toxmgr.cxx
@@ -436,7 +436,6 @@ bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& 
rDesc,
 
 if (pDoc->GetIDocumentUndoRedo().DoesUndo())
 {
-pDoc->GetIDocumentUndoRedo().DelAllUndoObj();
 pDoc->GetIDocumentUndoRedo().StartUndo(SwUndoId::TOXCHANGE, 
nullptr);
 }
 
diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx 
b/sw/source/uibase/wrtsh/wrtsh2.cxx
index 6fbd3d6203d9..9298ffb95494 100644
--- a/sw/source/uibase/wrtsh/wrtsh2.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh2.cxx
@@ -324,15 +324,6 @@ void SwWrtShell::UpdateTableOf(const SwTOXBase& rTOX, 
const SfxItemSet* pSet)
 if(CanInsert())
 {
 SwEditShell::UpdateTableOf(rTOX, pSet);
-
-if (pSet == nullptr)
-{
-SwDoc *const pDoc_ = GetDoc();
-if (pDoc_)
-{
-pDoc_->GetIDocumentUndoRedo().DelAllUndoObj();
-}
-}
 }
 }
 
commit 41df42a8dc758571dd7635c358a09bf412051649
Author: Michael Stahl 
AuthorDate: Thu Apr 25 18:17:29 2019 +0200
Commit: Michael Stahl 
CommitDate: Fri Apr 26 15:55:23 2019 +0200

tdf#38703 i#42807 tdf#123313 sw: add Undo of ToX Update

* SwTOXBaseSection::Update(): refactor this to *first* collect the info
  from the document (creating CrossRefHeadingBookmark as a side effect)
  and *then* do the node deletion/insertion of the ToX itself

* add new SwUndoUpdateIndex class for the update itself; it does 3 of
  the 4 required steps, the last one is done by a SwUndoDelSection that
  is already created when the original title section is deleted

* SwUndoInsSection::RedoImpl() for a ToX should not Update the ToX
  because that's the job of SwUndoUpdateIndex

* SwUndoSaveSection::RestoreSection()/MoveFromUndoNds() need to create
  frames for the moved nodes; not sure why other users of
  RestoreSection() don't do this currently so add a flag

* SwUndoSaveContent::MoveToUndoNds() should *always* delete frames;
  seriously, why would leaving frames alive ever be a good idea?

* SwUndoSaveSection::SaveSection() should not delete the surrounding
  section node of the ToX, so add a flag to prevent it

This fixes tdf#123313, the SwUndoInsBookmark are now appended at the
right time.

This should fix the crash in i#42807 properly.

In order to fix these bugs, implementing the feature requested in
tdf#38703 was necessary.

Change-Id: Ia976a118eb81ca37b0c48678825a1f5cd4031789
Reviewed-on: https://gerrit.libreoffice.org/71323
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index 8610ab3d38a6..38cab61b0b58 100644
--- a/sw/inc/undobj.hxx
+++ b/sw/inc/undobj.hxx
@@ -163,7 +163,8 @@ protected:
 sal_uLong* pEndNdIdx = nullptr );
 static void MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx,
   SwPosition& rInsPos,
-  const sal_uLong* pEndNdIdx = nullptr );
+  const sal_uLong* pEndNdIdx = nullptr,
+  bool bForceCreateFrames = false);
 
 // These two methods move the SPoint back/forth from PaM. With it
 // a range can be spanned for Undo/Redo. 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2019-03-28 Thread Noel Grandin (via logerrit)
 sw/inc/swabstdlg.hxx   |2 +-
 sw/source/ui/dbui/dbinsdlg.cxx |2 +-
 sw/source/ui/dialog/swdlgfact.cxx  |2 +-
 sw/source/ui/dialog/swdlgfact.hxx  |2 +-
 sw/source/ui/misc/outline.cxx  |2 +-
 sw/source/ui/table/convert.cxx |2 +-
 sw/source/ui/table/tautofmt.cxx|4 ++--
 sw/source/uibase/config/uinums.cxx |4 ++--
 sw/source/uibase/inc/tautofmt.hxx  |2 +-
 sw/source/uibase/inc/uinums.hxx|2 +-
 10 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 6b46aaafb8aa65987e4e441d3523c52283664a58
Author: Noel Grandin 
AuthorDate: Wed Mar 27 10:03:09 2019 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 28 07:39:43 2019 +0100

return unique_ptr from MakeNumRule

Change-Id: Ic606aa8f349946661b4a5fb017d1a1fd4ba993ae
Reviewed-on: https://gerrit.libreoffice.org/69852
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index 06f3b29e32bc..e87933b44228 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -278,7 +278,7 @@ IMPL_LINK(SwOutlineTabDialog, MenuSelectHdl, const 
OString&, rIdent, void)
 const SwNumRulesWithName *pRules = pChapterNumRules->GetRules( 
nLevelNo );
 if( pRules )
 {
-xNumRule.reset(pRules->MakeNumRule(rWrtSh));
+xNumRule = pRules->MakeNumRule(rWrtSh);
 xNumRule->SetRuleType( OUTLINE_RULE );
 SfxTabPage* pOutlinePage = GetTabPage("numbering");
 assert(pOutlinePage);
diff --git a/sw/source/uibase/config/uinums.cxx 
b/sw/source/uibase/config/uinums.cxx
index 3b7f3e35e10c..700e0f86c28e 100644
--- a/sw/source/uibase/config/uinums.cxx
+++ b/sw/source/uibase/config/uinums.cxx
@@ -153,10 +153,10 @@ SwNumRulesWithName& SwNumRulesWithName::operator=(const 
SwNumRulesWithName 
 return *this;
 }
 
-SwNumRule* SwNumRulesWithName::MakeNumRule(SwWrtShell& rSh) const
+std::unique_ptr SwNumRulesWithName::MakeNumRule(SwWrtShell& rSh) 
const
 {
 // #i89178#
-SwNumRule* pChg = new SwNumRule(maName, 
numfunc::GetDefaultPositionAndSpaceMode());
+std::unique_ptr pChg(new SwNumRule(maName, 
numfunc::GetDefaultPositionAndSpaceMode()));
 pChg->SetAutoRule( false );
 for (sal_uInt16 n = 0; n < MAXLEVEL; ++n)
 {
diff --git a/sw/source/uibase/inc/uinums.hxx b/sw/source/uibase/inc/uinums.hxx
index 3e5767c4d87a..9b822742083e 100644
--- a/sw/source/uibase/inc/uinums.hxx
+++ b/sw/source/uibase/inc/uinums.hxx
@@ -72,7 +72,7 @@ public:
 SwNumRulesWithName =(const SwNumRulesWithName &);
 
 const OUString& GetName() const   { return maName; }
-SwNumRule* MakeNumRule(SwWrtShell& rSh) const;
+std::unique_ptr MakeNumRule(SwWrtShell& rSh) const;
 
 void GetNumFormat(size_t, SwNumFormat const*&, OUString const*&) const;
 };
commit b4a208d1d38fb1eb71070e24cb2d146558b214a2
Author: Noel Grandin 
AuthorDate: Wed Mar 27 10:01:19 2019 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 28 07:39:31 2019 +0100

return unique_ptr from FillAutoFormatOfIndex

Change-Id: If41981a2136ab1a9d06a1b7a3b044ade302ba1d4
Reviewed-on: https://gerrit.libreoffice.org/69795
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 647c5c903925..c92ab77686e9 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -297,7 +297,7 @@ class AbstractSwAutoFormatDlg : public VclAbstractDialog
 protected:
 virtual ~AbstractSwAutoFormatDlg() override = default;
 public:
-virtual SwTableAutoFormat* FillAutoFormatOfIndex() const = 0;
+virtual std::unique_ptr FillAutoFormatOfIndex() const = 
0;
 };
 
 class AbstractSwFieldDlg : public SfxAbstractTabDialog
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index dd3abe56a7ee..51d02dcd5026 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -740,7 +740,7 @@ IMPL_LINK_NOARG(SwInsertDBColAutoPilot, AutoFormatHdl, 
weld::Button&, void)
 
 ScopedVclPtr 
pDlg(rFact.CreateSwAutoFormatDlg(m_xDialog.get(), pView->GetWrtShellPtr(), 
false, m_xTAutoFormat.get()));
 if( RET_OK == pDlg->Execute())
-m_xTAutoFormat.reset(pDlg->FillAutoFormatOfIndex());
+m_xTAutoFormat = pDlg->FillAutoFormatOfIndex();
 }
 
 IMPL_LINK(SwInsertDBColAutoPilot, TVSelectHdl, weld::TreeView&, rBox, void)
diff --git a/sw/source/ui/dialog/swdlgfact.cxx 
b/sw/source/ui/dialog/swdlgfact.cxx
index 7d36a5e527e1..687f70bd90cf 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -437,7 +437,7 @@ void 
AbstractSwSelGlossaryDlg_Impl::SelectEntryPos(sal_Int32 nIdx)
 m_xDlg->SelectEntryPos( nIdx );
 }
 
-SwTableAutoFormat* AbstractSwAutoFormatDlg_Impl::FillAutoFormatOfIndex() const
+std::unique_ptr 
AbstractSwAutoFormatDlg_Impl::FillAutoFormatOfIndex() const
 {
 return m_xDlg->FillAutoFormatOfIndex();
 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2019-03-16 Thread Libreoffice Gerrit user
 sw/inc/unoredline.hxx |2 +-
 sw/inc/unotbl.hxx |   28 ++--
 sw/source/core/unocore/unotbl.cxx |   23 ++-
 3 files changed, 29 insertions(+), 24 deletions(-)

New commits:
commit 65fde448d391195e5fcf942f8dd541ab6023ff9a
Author: Bjoern Michaelsen 
AuthorDate: Wed Feb 27 20:55:26 2019 +0100
Commit: Björn Michaelsen 
CommitDate: Sat Mar 16 13:51:20 2019 +0100

UNO SwXTableTextCursor: uso SvtListener instead of SwClient

Change-Id: Ie026909a1822c0e928f022e61b14e785224f5d17
Reviewed-on: https://gerrit.libreoffice.org/68472
Tested-by: Jenkins
Reviewed-by: Björn Michaelsen 

diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx
index d96a969f333e..f3061f309faf 100644
--- a/sw/inc/unotbl.hxx
+++ b/sw/inc/unotbl.hxx
@@ -184,20 +184,20 @@ public:
 };
 
 typedef cppu::WeakImplHelper<
-css::text::XTextTableCursor,
-css::lang::XServiceInfo,
-css::beans::XPropertySet
-> SwXTextTableCursor_Base;
-class SW_DLLPUBLIC SwXTextTableCursor : public SwXTextTableCursor_Base
-,public SwClient
-,public OTextCursorHelper
+css::text::XTextTableCursor,
+css::lang::XServiceInfo,
+css::beans::XPropertySet> SwXTextTableCursor_Base;
+class SW_DLLPUBLIC SwXTextTableCursor
+: public SwXTextTableCursor_Base
+, public SvtListener
+, public OTextCursorHelper
 {
-const SfxItemPropertySet*   m_pPropSet;
+SwFrameFormat* m_pFrameFormat;
+const SfxItemPropertySet* m_pPropSet;
 
 public:
-SwXTextTableCursor(SwFrameFormat* pFormat, SwTableBox const * pBox);
-SwXTextTableCursor(SwFrameFormat& rTableFormat,
-const SwTableCursor* pTableSelection);
+SwXTextTableCursor(SwFrameFormat* pFormat, SwTableBox const* pBox);
+SwXTextTableCursor(SwFrameFormat& rTableFormat, const SwTableCursor* 
pTableSelection);
 DECLARE_XINTERFACE()
 
 //XTextTableCursor
@@ -226,8 +226,6 @@ public:
 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) 
override;
 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() 
override;
 
-//SwClient
-virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) 
override;
 
 // ITextCursorHelper
 virtual const SwPaM*GetPaM() const override;
@@ -235,10 +233,12 @@ public:
 virtual const SwDoc*GetDoc() const override;
 virtual SwDoc*  GetDoc() override;
 
+virtual void Notify( const SfxHint& ) override;
+
 const SwUnoCursor&GetCursor() const;
 SwUnoCursor&  GetCursor();
 sw::UnoCursorPointer m_pUnoCursor;
-SwFrameFormat*   GetFrameFormat() const { return 
const_cast(static_cast(GetRegisteredIn())); }
+SwFrameFormat* GetFrameFormat() const { return m_pFrameFormat; }
 };
 
 struct SwRangeDescriptor
diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index 2db210758520..8badc4d54978 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -1479,11 +1479,12 @@ SwUnoCursor&  SwXTextTableCursor::GetCursor()   
{ return *m_pUnoCurs
 uno::Sequence SwXTextTableCursor::getSupportedServiceNames()
 { return {"com.sun.star.text.TextTableCursor"}; }
 
-SwXTextTableCursor::SwXTextTableCursor(SwFrameFormat* pFormat, SwTableBox 
const * pBox) :
-SwClient(pFormat),
-m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_TABLE_CURSOR))
+SwXTextTableCursor::SwXTextTableCursor(SwFrameFormat* pFrameFormat, SwTableBox 
const* pBox)
+: m_pFrameFormat(pFrameFormat)
+, m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_TABLE_CURSOR))
 {
-SwDoc* pDoc = pFormat->GetDoc();
+StartListening(m_pFrameFormat->GetNotifier());
+SwDoc* pDoc = m_pFrameFormat->GetDoc();
 const SwStartNode* pSttNd = pBox->GetSttNd();
 SwPosition aPos(*pSttNd);
 m_pUnoCursor = pDoc->CreateUnoCursor(aPos, true);
@@ -1492,10 +1493,11 @@ SwXTextTableCursor::SwXTextTableCursor(SwFrameFormat* 
pFormat, SwTableBox const
 rTableCursor.MakeBoxSels();
 }
 
-SwXTextTableCursor::SwXTextTableCursor(SwFrameFormat& rTableFormat, const 
SwTableCursor* pTableSelection) :
-SwClient(),
-m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_TABLE_CURSOR))
+SwXTextTableCursor::SwXTextTableCursor(SwFrameFormat& rTableFormat, const 
SwTableCursor* pTableSelection)
+: m_pFrameFormat()
+, m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_TABLE_CURSOR))
 {
+StartListening(m_pFrameFormat->GetNotifier());
 m_pUnoCursor = 
pTableSelection->GetDoc()->CreateUnoCursor(*pTableSelection->GetPoint(), true);
 if(pTableSelection->HasMark())
 {
@@ -1768,8 +1770,11 @@ void SwXTextTableCursor::addVetoableChangeListener(const 
OUString& /*rPropertyNa
 void 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2019-01-14 Thread Libreoffice Gerrit user
 sw/inc/swabstdlg.hxx   |2 +-
 sw/source/ui/dialog/swdlgfact.cxx  |2 +-
 sw/source/ui/dialog/swdlgfact.hxx  |6 +++---
 sw/source/ui/table/instable.cxx|4 ++--
 sw/source/uibase/app/docsh.cxx |9 -
 sw/source/uibase/app/docsh2.cxx|5 ++---
 sw/source/uibase/app/docstyle.cxx  |   12 ++--
 sw/source/uibase/inc/instable.hxx  |2 +-
 sw/source/uibase/lingu/hhcwrp.cxx  |   12 ++--
 sw/source/uibase/shells/basesh.cxx |7 +++
 10 files changed, 29 insertions(+), 32 deletions(-)

New commits:
commit 6018adfabc30ee68939c2d974aa612757bbca938
Author: Noel Grandin 
AuthorDate: Mon Jan 14 10:07:09 2019 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 15 06:57:09 2019 +0100

use unique_ptr for SwTableAutoFormat

Change-Id: Ib83be524b5c15e4639a834494726501ac7aa6755
Reviewed-on: https://gerrit.libreoffice.org/66314
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 2e97df323db9..075d41e873c0 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -120,7 +120,7 @@ protected:
 public:
 virtual voidGetValues( OUString& rName, sal_uInt16& rRow, 
sal_uInt16& rCol,
 SwInsertTableOptions& rInsTableFlags, 
OUString& rTableAutoFormatName,
-SwTableAutoFormat *& prTAFormat ) = 0;
+std::unique_ptr& prTAFormat 
) = 0;
 };
 
 class AbstractJavaEditDialog : public VclAbstractDialog
diff --git a/sw/source/ui/dialog/swdlgfact.cxx 
b/sw/source/ui/dialog/swdlgfact.cxx
index c40f17d9cf4a..d928f116fd90 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -550,7 +550,7 @@ void AbstractInsFootNoteDlg_Impl::SetText( const OUString& 
rStr )
 
 void AbstractInsTableDlg_Impl::GetValues( OUString& rName, sal_uInt16& rRow, 
sal_uInt16& rCol,
 SwInsertTableOptions& rInsTableFlags, 
OUString& rTableAutoFormatName,
-SwTableAutoFormat *& prTAFormat )
+std::unique_ptr& prTAFormat 
)
 {
 m_xDlg->GetValues(rName, rRow, rCol, rInsTableFlags, rTableAutoFormatName, 
prTAFormat);
 }
diff --git a/sw/source/ui/dialog/swdlgfact.hxx 
b/sw/source/ui/dialog/swdlgfact.hxx
index 2d9251ce3095..067097fcd3aa 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -444,9 +444,9 @@ public:
 {
 }
 virtual short Execute() override;
-virtual voidGetValues( OUString& rName, sal_uInt16& rRow, 
sal_uInt16& rCol,
-SwInsertTableOptions& rInsTableFlags, 
OUString& rTableAutoFormatName,
-SwTableAutoFormat *& prTAFormat ) override;
+virtual void  GetValues( OUString& rName, sal_uInt16& rRow, sal_uInt16& 
rCol,
+ SwInsertTableOptions& rInsTableFlags, OUString& 
rTableAutoFormatName,
+ std::unique_ptr& prTAFormat ) 
override;
 };
 
 class SwJavaEditDialog;
diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx
index b960dcb4f168..f2d7f6f3c305 100644
--- a/sw/source/ui/table/instable.cxx
+++ b/sw/source/ui/table/instable.cxx
@@ -29,7 +29,7 @@
 
 void SwInsTableDlg::GetValues( OUString& rName, sal_uInt16& rRow, sal_uInt16& 
rCol,
 SwInsertTableOptions& rInsTableOpts, OUString& 
rAutoName,
-SwTableAutoFormat *& prTAFormat )
+std::unique_ptr& prTAFormat 
)
 {
 SwInsertTableFlags nInsMode = SwInsertTableFlags::NONE;
 rName = m_xNameEdit->get_text();
@@ -46,7 +46,7 @@ void SwInsTableDlg::GetValues( OUString& rName, sal_uInt16& 
rRow, sal_uInt16& rC
 nInsMode |= SwInsertTableFlags::SplitLayout;
 if( pTAutoFormat )
 {
-prTAFormat = new SwTableAutoFormat( *pTAutoFormat );
+prTAFormat.reset(new SwTableAutoFormat( *pTAutoFormat ));
 rAutoName = prTAFormat->GetName();
 }
 
diff --git a/sw/source/uibase/inc/instable.hxx 
b/sw/source/uibase/inc/instable.hxx
index c0194403ab98..7c12ce1f3434 100644
--- a/sw/source/uibase/inc/instable.hxx
+++ b/sw/source/uibase/inc/instable.hxx
@@ -82,7 +82,7 @@ public:
 
 void GetValues( OUString& rName, sal_uInt16& rRow, sal_uInt16& rCol,
 SwInsertTableOptions& rInsTableOpts, OUString& 
rTableAutoFormatName,
-SwTableAutoFormat *& prTAFormat );
+std::unique_ptr& prTAFormat );
 };
 
 #endif
diff --git a/sw/source/uibase/lingu/hhcwrp.cxx 
b/sw/source/uibase/lingu/hhcwrp.cxx
index 4a6c2a61f650..8fce3fae3a3a 100644
--- a/sw/source/uibase/lingu/hhcwrp.cxx
+++ b/sw/source/uibase/lingu/hhcwrp.cxx
@@ -374,7 +374,7 @@ void SwHHCWrapper::ReplaceUnit(
 OUString aOrigText( m_rWrtShell.GetSelText() );
 OUString aNewText( rReplaceWith );
 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2019-01-14 Thread Libreoffice Gerrit user
 sw/inc/swunohelper.hxx |3 +--
 sw/source/core/unocore/swunohelper.cxx |6 +++---
 sw/source/uibase/utlui/gloslst.cxx |   14 +-
 3 files changed, 9 insertions(+), 14 deletions(-)

New commits:
commit 1c4acfdcb10b2cdeac8efb331fc9db8d01de9c66
Author: Noel Grandin 
AuthorDate: Mon Jan 14 10:15:18 2019 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 15 06:57:30 2019 +0100

fix unnecessary delete

the erase on the preceding line will delete it,

ever since
commit a846c7106d4e4e1b8cc61e237cc2e158d037e816
Date:   Wed Jul 25 12:26:15 2018 +0200
loplugin:useuniqueptr in SwGlossaryList

Change-Id: I8f71bca8eebf762aeea3225d3a3b52ec2ac60e19
Reviewed-on: https://gerrit.libreoffice.org/66316
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/uibase/utlui/gloslst.cxx 
b/sw/source/uibase/utlui/gloslst.cxx
index 2c92c4a5acbb..d7e97deff15b 100644
--- a/sw/source/uibase/utlui/gloslst.cxx
+++ b/sw/source/uibase/utlui/gloslst.cxx
@@ -318,7 +318,6 @@ void SwGlossaryList::Update()
 if(!bFound)
 {
 aGroupArr.erase(aGroupArr.begin() + i);
-delete pGroup;
 }
 }
 }
commit f7214c70676b35baff427d986ffb85b8c79c0ca8
Author: Noel Grandin 
AuthorDate: Mon Jan 14 10:11:45 2019 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 15 06:57:19 2019 +0100

simplify UCB_GetFileListOfFolder

no need to use heap objects here

Change-Id: Iadc35b019da7b9446ede79c96a9d8ce8c6db81ef
Reviewed-on: https://gerrit.libreoffice.org/66315
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/swunohelper.hxx b/sw/inc/swunohelper.hxx
index 35459bdcfa31..b87d7dda833e 100644
--- a/sw/inc/swunohelper.hxx
+++ b/sw/inc/swunohelper.hxx
@@ -56,11 +56,10 @@ SW_DLLPUBLIC bool UCB_IsReadOnlyFileName( const OUString& 
rURL );
 // options: pExtension = 0 -> all, else this specific extension
 //  pDateTime != 0 -> returns also the modified date/time of
 //   the files in a vector -->
-//   !! objects must be deleted from the caller!!
 bool UCB_GetFileListOfFolder( const OUString& rURL,
 std::vector& rList,
 const OUString* pExtension,
-std::vector* pDateTimeList = 
nullptr );
+std::vector* pDateTimeList = nullptr 
);
 
 // is the URL an existing file?
 SW_DLLPUBLIC bool UCB_IsFile( const OUString& rURL );
diff --git a/sw/source/core/unocore/swunohelper.cxx 
b/sw/source/core/unocore/swunohelper.cxx
index e2fcdcf0724f..29e76e9bd554 100644
--- a/sw/source/core/unocore/swunohelper.cxx
+++ b/sw/source/core/unocore/swunohelper.cxx
@@ -184,7 +184,7 @@ bool UCB_IsDirectory( const OUString& rURL )
 bool UCB_GetFileListOfFolder( const OUString& rURL,
 std::vector& rList,
 const OUString* pExtension,
-std::vector< ::DateTime* >* pDateTimeList )
+std::vector< ::DateTime >* pDateTimeList )
 {
 bool bOk = false;
 try
@@ -227,7 +227,7 @@ bool UCB_GetFileListOfFolder( const OUString& rURL,
 if( pDateTimeList )
 {
 css::util::DateTime aStamp = 
xRow->getTimestamp(2);
-::DateTime* pDateTime = new ::DateTime(
+::DateTime aDateTime(
 ::Date( aStamp.Day,
 aStamp.Month,
 aStamp.Year ),
@@ -235,7 +235,7 @@ bool UCB_GetFileListOfFolder( const OUString& rURL,
 aStamp.Minutes,
 aStamp.Seconds,
 aStamp.NanoSeconds ));
-pDateTimeList->push_back( pDateTime );
+pDateTimeList->push_back( aDateTime );
 }
 }
 
diff --git a/sw/source/uibase/utlui/gloslst.cxx 
b/sw/source/uibase/utlui/gloslst.cxx
index 0a05aa8acaf3..2c92c4a5acbb 100644
--- a/sw/source/uibase/utlui/gloslst.cxx
+++ b/sw/source/uibase/utlui/gloslst.cxx
@@ -270,14 +270,14 @@ void SwGlossaryList::Update()
 {
 std::vector aFoundGroupNames;
 std::vector aFiles;
-std::vector aDateTimeArr;
+std::vector aDateTimeArr;
 
 SWUnoHelper::UCB_GetFileListOfFolder( rPathArr[nPath], aFiles,
 ,  );
 for( size_t nFiles = 0; nFiles < aFiles.size(); ++nFiles )
  

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2019-01-10 Thread Libreoffice Gerrit user
 sw/inc/ndarr.hxx   |2 -
 sw/source/core/docnode/ndtbl.cxx   |7 ++---
 sw/source/core/unocore/unosett.cxx |   44 ++---
 sw/source/core/unocore/unotext.cxx |6 ++---
 4 files changed, 24 insertions(+), 35 deletions(-)

New commits:
commit a41b1d18ad26703f6a5b622f10e1126570bfd419
Author: Noel Grandin 
AuthorDate: Thu Jan 10 16:58:45 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Jan 11 08:44:23 2019 +0100

use unique_ptr in SwNodes::ExpandRangeForTableBox

Change-Id: I31cc9d6b962c116c64789d886b82ea476f4e5144
Reviewed-on: https://gerrit.libreoffice.org/66124
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index 598397c43cf6..6153af0ad012 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -258,7 +258,7 @@ public:
 SwTextFormatColl* pTextColl,
 SwUndoTextToTable* pUndo );
 
-SwNodeRange * ExpandRangeForTableBox(const SwNodeRange & rRange);
+std::unique_ptr ExpandRangeForTableBox(const SwNodeRange & 
rRange);
 
 /// create a table from a vector of NodeRanges - API support
 SwTableNode* TextToTable( const TableRanges_t& rTableNodes,
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 47246bd18a69..6a173ffab31d 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1279,9 +1279,8 @@ const SwTable* SwDoc::TextToTable( const std::vector< 
std::vector >
 return 
 }
 
-SwNodeRange * SwNodes::ExpandRangeForTableBox(const SwNodeRange & rRange)
+std::unique_ptr SwNodes::ExpandRangeForTableBox(const SwNodeRange 
& rRange)
 {
-SwNodeRange * pResult = nullptr;
 bool bChanged = false;
 
 SwNodeIndex aNewStart = rRange.aStart;
@@ -1335,9 +1334,9 @@ SwNodeRange * SwNodes::ExpandRangeForTableBox(const 
SwNodeRange & rRange)
 pNode = ();
 }
 
+std::unique_ptr pResult;
 if (bChanged)
-pResult = new SwNodeRange(aNewStart, aNewEnd);
-
+pResult.reset(new SwNodeRange(aNewStart, aNewEnd));
 return pResult;
 }
 
diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index 68d78213fb48..944851a47f2d 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1835,10 +1835,10 @@ void SwXText::Impl::ConvertCell(
 
 SwNodeRange aTmpRange(aStartCellPam.Start()->nNode,
   aEndCellPam.End()->nNode);
-SwNodeRange * pCorrectedRange =
+std::unique_ptr pCorrectedRange =
 m_pDoc->GetNodes().ExpandRangeForTableBox(aTmpRange);
 
-if (pCorrectedRange != nullptr)
+if (pCorrectedRange)
 {
 SwPaM aNewStartPaM(pCorrectedRange->aStart, 0);
 aStartCellPam = aNewStartPaM;
@@ -1851,7 +1851,7 @@ void SwXText::Impl::ConvertCell(
 SwPaM aNewEndPaM(pCorrectedRange->aEnd, nEndLen);
 aEndCellPam = aNewEndPaM;
 
-delete pCorrectedRange;
+pCorrectedRange.reset();
 }
 
 /** check the nodes between start and end
commit c7d5ad9dbfc7ada52a3ec8c38fa8420a08b126c3
Author: Noel Grandin 
AuthorDate: Thu Jan 10 16:52:25 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Jan 11 08:44:15 2019 +0100

use unique_ptr in SwXNumberingRules

Change-Id: I7daa1fbd11c62d712b2ff70714b5e5bda63d54d8
Reviewed-on: https://gerrit.libreoffice.org/66123
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/core/unocore/unosett.cxx 
b/sw/source/core/unocore/unosett.cxx
index 4a82db8bd944..d3b949b2a973 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1610,9 +1610,9 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
 
 bool bWrongArg = false;
 if(!bExcept)
-   {
-SvxBrushItem* pSetBrush = nullptr;
-Size* pSetSize = nullptr;
+{
+std::unique_ptr pSetBrush;
+std::unique_ptr pSetSize;
 std::unique_ptr pSetVOrient;
 bool bCharStyleNameSet = false;
 
@@ -1922,11 +1922,9 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
 {
 const SvxBrushItem* pOrigBrush = 
aFormat.GetBrush();
 if(pOrigBrush)
-{
-pSetBrush = new SvxBrushItem(*pOrigBrush);
-}
+pSetBrush.reset(new SvxBrushItem(*pOrigBrush));
 else
-pSetBrush = new SvxBrushItem(OUString(), 
OUString(), GPOS_AREA, RES_BACKGROUND);
+pSetBrush.reset(new SvxBrushItem(OUString(), 
OUString(), GPOS_AREA, RES_BACKGROUND));
 }
 Graphic aGraphic(xGraphic);
 pSetBrush->SetGraphic(aGraphic);
@@ -1945,11 +1943,9 @@ void 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2019-01-09 Thread Libreoffice Gerrit user
 sw/inc/ndtxt.hxx   |4 ++--
 sw/source/core/doc/docedt.cxx  |   13 ++---
 sw/source/core/doc/list.cxx|   12 ++--
 sw/source/core/docnode/ndtbl.cxx   |8 
 sw/source/core/fields/authfld.cxx  |7 +++
 sw/source/core/frmedt/fecopy.cxx   |9 -
 sw/source/core/frmedt/fefly1.cxx   |   23 ++-
 sw/source/core/frmedt/feshview.cxx |7 +++
 sw/source/core/layout/flyincnt.cxx |6 +++---
 sw/source/core/layout/ftnfrm.cxx   |9 -
 sw/source/core/txtnode/ndtxt.cxx   |   19 +++
 11 files changed, 52 insertions(+), 65 deletions(-)

New commits:
commit a3f409262db9a9939d40e8f009f3e2396c78c020
Author: Noel Grandin 
AuthorDate: Wed Jan 9 16:13:21 2019 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 10 08:28:49 2019 +0100

use unique_ptr in SwTextNode

Change-Id: I3f263a617e0ca48cbbe894a061910f1af767bb11
Reviewed-on: https://gerrit.libreoffice.org/66037
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 4c0e6468fb9b..e10fd669eddc 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -91,8 +91,8 @@ class SW_DLLPUBLIC SwTextNode
Therefore: never access directly! */
 std::unique_ptr m_pSwpHints;
 
-mutable SwNodeNum* mpNodeNum;  ///< Numbering for this paragraph.
-mutable SwNodeNum* mpNodeNumRLHidden; ///< Numbering for this paragraph 
(hidden redlines)
+mutable std::unique_ptr mpNodeNum;  ///< Numbering for this 
paragraph.
+mutable std::unique_ptr mpNodeNumRLHidden; ///< Numbering for 
this paragraph (hidden redlines)
 
 OUString m_Text;
 
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 07a69d87b0e7..7a2a4cdf0ee1 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -200,8 +200,6 @@ SwTextNode *SwNodes::MakeTextNode( const SwNodeIndex & 
rWhere,
 
 SwTextNode::SwTextNode( const SwNodeIndex , SwTextFormatColl 
*pTextColl, const SfxItemSet* pAutoAttr )
 :   SwContentNode( rWhere, SwNodeType::Text, pTextColl ),
-mpNodeNum( nullptr ),
-mpNodeNumRLHidden(nullptr),
 m_Text(),
 m_pParaIdleData_Impl(nullptr),
 m_bContainsHiddenChars(false),
@@ -3976,20 +3974,19 @@ const SwNodeNum* SwTextNode::GetNum(SwRootFrame 
const*const pLayout) const
 {
 // invariant: it's only in list in Hide mode if it's in list in normal mode
 assert(mpNodeNum || !mpNodeNumRLHidden);
-return pLayout && pLayout->IsHideRedlines() ? mpNodeNumRLHidden : 
mpNodeNum;
+return pLayout && pLayout->IsHideRedlines() ? mpNodeNumRLHidden.get() : 
mpNodeNum.get();
 }
 
 void SwTextNode::DoNum(std::function const& rFunc)
 {
 // temp. clear because GetActualListLevel() may be called and the assert
 // there triggered during update, which is unhelpful
-SwNodeNum * pBackup(mpNodeNumRLHidden);
-mpNodeNumRLHidden = nullptr;
+std::unique_ptr pBackup = std::move(mpNodeNumRLHidden);
 assert(mpNodeNum);
 rFunc(*mpNodeNum);
 if (pBackup)
 {
-mpNodeNumRLHidden = pBackup;
+mpNodeNumRLHidden = std::move(pBackup);
 rFunc(*mpNodeNumRLHidden);
 }
 }
@@ -4289,7 +4286,7 @@ void SwTextNode::AddToList()
 if (pList && GetNodes().IsDocNodes()) // not for undo nodes
 {
 assert(!mpNodeNum);
-mpNodeNum = new SwNodeNum(this, false);
+mpNodeNum.reset(new SwNodeNum(this, false));
 pList->InsertListItem(*mpNodeNum, false, GetAttrListLevel());
 // iterate all frames & if there's one with hidden layout...
 SwIterator 
iter(*this);
@@ -4320,7 +4317,7 @@ void SwTextNode::AddToListRLHidden()
 if (pList)
 {
 assert(!mpNodeNumRLHidden);
-mpNodeNumRLHidden = new SwNodeNum(this, true);
+mpNodeNumRLHidden.reset(new SwNodeNum(this, true));
 pList->InsertListItem(*mpNodeNumRLHidden, true, GetAttrListLevel());
 }
 }
@@ -4332,8 +4329,7 @@ void SwTextNode::RemoveFromList()
 if ( IsInList() )
 {
 SwList::RemoveListItem( *mpNodeNum );
-delete mpNodeNum;
-mpNodeNum = nullptr;
+mpNodeNum.reset();
 
 SetWordCountDirty( true );
 }
@@ -4345,8 +4341,7 @@ void SwTextNode::RemoveFromListRLHidden()
 {
 assert(mpNodeNumRLHidden->GetParent() || !GetNodes().IsDocNodes());
 SwList::RemoveListItem(*mpNodeNumRLHidden);
-delete mpNodeNumRLHidden;
-mpNodeNumRLHidden = nullptr;
+mpNodeNumRLHidden.reset();
 
 SetWordCountDirty( true );
 }
commit 6cd5d350db92b78f1d4b8a552e0b8972d48c16a0
Author: Noel Grandin 
AuthorDate: Wed Jan 9 15:20:06 2019 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 10 08:28:39 2019 +0100

use unique_ptr in sw

Change-Id: I13ab934932a24f49a0e37257d397de7ed88f66bf
Reviewed-on: https://gerrit.libreoffice.org/66034
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2018-12-02 Thread Libreoffice Gerrit user
 sw/inc/editsh.hxx|5 ++
 sw/source/core/edit/edfcol.cxx   |   68 ++-
 sw/source/core/txtnode/ndtxt.cxx |2 -
 3 files changed, 44 insertions(+), 31 deletions(-)

New commits:
commit 83a72f46d34fde7a119b00fcc0a7bf58dbe0076a
Author: Ashod Nakashian 
AuthorDate: Tue Oct 2 06:02:39 2018 -0400
Commit: Ashod Nakashian 
CommitDate: Mon Dec 3 08:12:39 2018 +0100

sw: paragraph-sign: formatting

Change-Id: I9bf1b58aa6e18202a5f7eba010cc5b914e1d33d4
Reviewed-on: https://gerrit.libreoffice.org/63005
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian 

diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index f2be581ff73f..083ad320fbec 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -359,14 +359,16 @@ SignatureDescr lcl_getSignatureDescr(const 
uno::Reference& xModel
 SignatureDescr aDescr;
 aDescr.msId = sFieldId;
 
+const OUString prefix = ParagraphSignatureRDFNamespace + sFieldId;
 const std::map aStatements = 
lcl_getRDFStatements(xModel, xParagraph);
-const auto itSig = aStatements.find(ParagraphSignatureRDFNamespace + 
sFieldId + ParagraphSignatureDigestRDFName);
+
+const auto itSig = aStatements.find(prefix + 
ParagraphSignatureDigestRDFName);
 aDescr.msSignature = (itSig != aStatements.end() ? itSig->second : 
OUString());
 
-const auto itDate = aStatements.find(ParagraphSignatureRDFNamespace + 
sFieldId + ParagraphSignatureDateRDFName);
+const auto itDate = aStatements.find(prefix + 
ParagraphSignatureDateRDFName);
 aDescr.msDate = (itDate != aStatements.end() ? itDate->second : 
OUString());
 
-const auto itUsage = aStatements.find(ParagraphSignatureRDFNamespace + 
sFieldId + ParagraphSignatureUsageRDFName);
+const auto itUsage = aStatements.find(prefix + 
ParagraphSignatureUsageRDFName);
 aDescr.msUsage = (itUsage != aStatements.end() ? itUsage->second : 
OUString());
 
 return aDescr;
@@ -376,14 +378,16 @@ SignatureDescr lcl_getSignatureDescr(const 
uno::Reference& xModel
  const 
uno::Reference& xParagraph,
  const 
uno::Reference& xField)
 {
-const std::pair pair = lcl_getRDF(xModel, xField, 
ParagraphSignatureIdRDFName);
-return (!pair.second.isEmpty() ? lcl_getSignatureDescr(xModel, xParagraph, 
pair.second) : SignatureDescr());
+const OUString sFieldId = lcl_getRDF(xModel, xField, 
ParagraphSignatureIdRDFName).second;
+if (!sFieldId.isEmpty())
+return lcl_getSignatureDescr(xModel, xParagraph, sFieldId);
+
+return SignatureDescr();
 }
 
 /// Validate and create the signature field display text from the fields.
-std::pair
-lcl_MakeParagraphSignatureFieldText(const SignatureDescr& aDescr,
-const OString& utf8Text)
+std::pair lcl_MakeParagraphSignatureFieldText(const 
SignatureDescr& aDescr,
+  const OString& 
utf8Text)
 {
 OUString msg = SwResId(STR_INVALID_SIGNATURE);
 bool valid = false;
@@ -399,7 +403,8 @@ lcl_MakeParagraphSignatureFieldText(const SignatureDescr& 
aDescr,
 const std::vector 
sig(svl::crypto::DecodeHexString(encSignature));
 SignatureInformation aInfo(0);
 valid = svl::crypto::Signing::Verify(data, false, sig, aInfo);
-valid = valid && aInfo.nStatus == 
css::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED;
+valid = valid
+&& aInfo.nStatus == 
xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED;
 
 msg = SwResId(STR_SIGNED_BY) + ": " + aInfo.ouSubject + ", ";
 msg += aDescr.msDate;
@@ -411,7 +416,6 @@ lcl_MakeParagraphSignatureFieldText(const SignatureDescr& 
aDescr,
 return std::make_pair(valid, msg);
 }
 
-
 /// Validate and return validation result and signature field display text.
 std::pair
 lcl_MakeParagraphSignatureFieldText(const uno::Reference& 
xModel,
@@ -427,11 +431,10 @@ lcl_MakeParagraphSignatureFieldText(const 
uno::Reference& xModel,
 OUString lcl_getNextSignatureId(const uno::Reference& xModel,
 const uno::Reference& 
xParagraph)
 {
-const std::pair pair = lcl_getRDF(xModel, xParagraph, 
ParagraphSignatureLastIdRDFName);
-return OUString::number(!pair.second.isEmpty() ? pair.second.toInt32() + 1 
: 1);
+const OUString sFieldId = lcl_getRDF(xModel, xParagraph, 
ParagraphSignatureLastIdRDFName).second;
+return OUString::number(!sFieldId.isEmpty() ? sFieldId.toInt32() + 1 : 1);
 }
 
-
 /// Creates and inserts Paragraph Signature Metadata field and creates the RDF 
entry
 uno::Reference lcl_InsertParagraphSignature(const 
uno::Reference& xModel,
   const 
uno::Reference& xParagraph,
@@ -465,10 +468,11 @@ uno::Reference 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2018-09-18 Thread Libreoffice Gerrit user
 sw/inc/unotxdoc.hxx   |2 +-
 sw/source/filter/ww8/ww8par4.cxx  |   18 --
 sw/source/uibase/uno/unotxdoc.cxx |   11 ---
 3 files changed, 13 insertions(+), 18 deletions(-)

New commits:
commit 83b840e6a08d7d990a4703b6ef67c3829c75aad4
Author: Noel Grandin 
AuthorDate: Sat Sep 15 17:16:42 2018 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 18 09:07:45 2018 +0200

loplugin:useuniqueptr in SwXTextDocument

Change-Id: I095e0b35d62fa0c82e7e171b2923431e06175558
Reviewed-on: https://gerrit.libreoffice.org/60614
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index d0ead1913fc1..0636dbfd5007 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -133,7 +133,7 @@ private:
 class Impl;
 ::sw::UnoImplPtr m_pImpl;
 
-std::deque aActionArr;
+std::deque> maActionArr;
 
 const SfxItemPropertySet* pPropSet;
 
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 369df2b014ed..0446bf4bac7c 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -545,25 +545,22 @@ void SwXTextDocument::lockControllers()
 if(!IsValid())
 throw DisposedException("", static_cast< XTextDocument* >(this));
 
-UnoActionContext* pContext = new UnoActionContext(pDocShell->GetDoc());
-aActionArr.push_front(pContext);
+maActionArr.emplace_front(new UnoActionContext(pDocShell->GetDoc()));
 }
 
 void SwXTextDocument::unlockControllers()
 {
 SolarMutexGuard aGuard;
-if(aActionArr.empty())
+if(maActionArr.empty())
 throw RuntimeException("Nothing to unlock");
 
-UnoActionContext* pContext = aActionArr.front();
-aActionArr.pop_front();
-delete pContext;
+maActionArr.pop_front();
 }
 
 sal_Bool SwXTextDocument::hasControllersLocked()
 {
 SolarMutexGuard aGuard;
-return !aActionArr.empty();
+return !maActionArr.empty();
 }
 
 Reference< frame::XController >  SwXTextDocument::getCurrentController()
commit 7e4e715ea3a05bbcbba78c8deaa0b339dfa42926
Author: Noel Grandin 
AuthorDate: Sat Sep 15 17:08:36 2018 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 18 09:07:34 2018 +0200

loplugin:useuniqueptr in SwWW8ImplReader::InsertOle

Change-Id: Ibf84535dd24292e7c6f67b813224bfd4e02945cd
Reviewed-on: https://gerrit.libreoffice.org/60612
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx
index 1a7370f03da9..4732c0c16081 100644
--- a/sw/source/filter/ww8/ww8par4.cxx
+++ b/sw/source/filter/ww8/ww8par4.cxx
@@ -208,7 +208,7 @@ SwFlyFrameFormat* SwWW8ImplReader::InsertOle(SdrOle2Obj 
,
 
 SwFlyFrameFormat *pRet = nullptr;
 
-SfxItemSet *pMathFlySet = nullptr;
+std::unique_ptr pMathFlySet;
 uno::Reference < embed::XClassifiedObject > xClass( rObject.GetObjRef(), 
uno::UNO_QUERY );
 if( xClass.is() )
 {
@@ -216,8 +216,8 @@ SwFlyFrameFormat* SwWW8ImplReader::InsertOle(SdrOle2Obj 
,
 if (SotExchange::IsMath(aClassName))
 {
 // StarMath sets it own fixed size, so its counter productive to 
use
-// the size word says it is. i.e. Don't attempt to override its 
size.
-pMathFlySet = new SfxItemSet(rFlySet);
+// the size Word says it is. i.e. Don't attempt to override its 
size.
+pMathFlySet.reset(new SfxItemSet(rFlySet));
 pMathFlySet->ClearItem(RES_FRM_SIZE);
 }
 }
@@ -236,10 +236,9 @@ SwFlyFrameFormat* SwWW8ImplReader::InsertOle(SdrOle2Obj 
,
 OSL_ENSURE(bSuccess, "Insert OLE failed");
 if (bSuccess)
 {
-const SfxItemSet *pFlySet = pMathFlySet ? pMathFlySet : 
+const SfxItemSet *pFlySet = pMathFlySet ? pMathFlySet.get() : 
 pRet = m_rDoc.getIDocumentContentOperations().InsertOLE(*m_pPaM, 
sNewName, rObject.GetAspect(), pFlySet, rGrfSet);
 }
-delete pMathFlySet;
 return pRet;
 }
 
@@ -255,13 +254,13 @@ SwFrameFormat* SwWW8ImplReader::ImportOle(const Graphic* 
pGrf,
 SdrObject* pRet = ImportOleBase(aGraph, pGrf, pFlySet, aVisArea );
 
 // create flyset
-SfxItemSet* pTempSet = nullptr;
+std::unique_ptr pTempSet;
 if( !pFlySet )
 {
-pTempSet = new SfxItemSet( m_rDoc.GetAttrPool(), 
svl::Items{});
+pTempSet.reset( new SfxItemSet( m_rDoc.GetAttrPool(), 
svl::Items{}) );
 
-pFlySet = pTempSet;
+pFlySet = pTempSet.get();
 
 // Remove distance/borders
 if (!m_bNewDoc)
@@ -305,7 +304,6 @@ SwFrameFormat* SwWW8ImplReader::ImportOle(const Graphic* 
pGrf,
 *m_pPaM, OUString(), OUString(), , pFlySet,
 pGrfSet, nullptr);
 }
-delete pTempSet;
 return pFormat;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source vcl/win

2018-08-20 Thread Libreoffice Gerrit user
 sw/inc/IDocumentTimerAccess.hxx |   40 ++-
 sw/source/core/doc/DocumentTimerManager.cxx |   24 
 sw/source/core/inc/DocumentTimerManager.hxx |2 -
 sw/source/core/inc/docfld.hxx   |2 -
 sw/source/core/inc/rootfrm.hxx  |4 +-
 vcl/win/app/salinst.cxx |   41 +---
 vcl/win/window/salframe.cxx |9 +-
 7 files changed, 71 insertions(+), 51 deletions(-)

New commits:
commit 401cba4c20fbc930f034168872642428d7459218
Author: Jan-Marek Glogowski 
AuthorDate: Fri Aug 17 23:10:00 2018 +0200
Commit: Jan-Marek Glogowski 
CommitDate: Mon Aug 20 09:35:59 2018 +0200

tdf#116370 cleanup Writer idle job handing

This prevents the start of the idle job, while processing itself,
so the fixed WinSalInstance::AnyInput of commit 3bf6c97029d2
("tdf#112975 WIN correctly handle VclInputFlags::OTHER") won't
report the timer events of the re-started idle job to process.

Fixes the early abort of the background job, which resulted in
the busy loop of the reported bug and this strange printing
behaviour.

P.S. I'm not sure, why this was just broken on Windows.

Change-Id: I6503dcd925c9a0ed843e794a31eea32a4a4b2889
Reviewed-on: https://gerrit.libreoffice.org/59279
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/sw/inc/IDocumentTimerAccess.hxx b/sw/inc/IDocumentTimerAccess.hxx
index 6efe1a114963..1ed8679c00ac 100644
--- a/sw/inc/IDocumentTimerAccess.hxx
+++ b/sw/inc/IDocumentTimerAccess.hxx
@@ -20,42 +20,44 @@
 #ifndef INCLUDED_SW_INC_IDOCUMENTTIMERACCESS_HXX
 #define INCLUDED_SW_INC_IDOCUMENTTIMERACCESS_HXX
 
-/** Manipulate background jobs of the document. It starts with a mode of
- 'started' and a block count of 0.
+/**
+ * Handle the background job of the Writer document.
+ *
+ * Initially it's disabled and unblocked.
+ *
+ * Jobs include:
+ *  * grammar checking
+ *  * field updating
+ *  * document layouting
  */
 class IDocumentTimerAccess
 {
 public:
 /**
-Set mode to 'start'.
-*/
+ * Start the idle job depending on the block count.
+ */
 virtual void StartIdling() = 0;
 
 /**
-Set mode to 'stopped'.
-*/
+ * Stop idle processing.
+ */
 virtual void StopIdling() = 0;
 
 /**
-Increment block count.
-*/
+ * Increment block count.
+ *
+ * Prevents further background idle processing.
+ */
 virtual void BlockIdling() = 0;
 
 /**
-Decrement block count.
-*/
+ * Decrement block count.
+ *
+ * May start the idle job.
+ */
 virtual void UnblockIdling() = 0;
 
 /**
-Do these jobs asynchronously: do grammar checking,
-do layout, and update fields.
-They will be delayed until mode is start AND block count == 0.
-The implementation might delay them further, for example
-it might wait until the application is idle.
-*/
-virtual void StartBackgroundJobs() = 0;
-
-/**
  * Is the document ready to be processed?
  */
 virtual bool IsDocIdle() const = 0;
diff --git a/sw/source/core/doc/DocumentTimerManager.cxx 
b/sw/source/core/doc/DocumentTimerManager.cxx
index 5429c6edbda6..35f2eb94dcbd 100644
--- a/sw/source/core/doc/DocumentTimerManager.cxx
+++ b/sw/source/core/doc/DocumentTimerManager.cxx
@@ -49,9 +49,13 @@ DocumentTimerManager::DocumentTimerManager( SwDoc& i_rSwdoc 
) : m_rDoc( i_rSwdoc
 
 void DocumentTimerManager::StartIdling()
 {
-mbStartIdleTimer = true;
-if( !mIdleBlockCount )
+if( !mIdleBlockCount && !maDocIdle.IsActive() )
+{
+mbStartIdleTimer = false;
 maDocIdle.Start();
+}
+else
+mbStartIdleTimer = true;
 }
 
 void DocumentTimerManager::StopIdling()
@@ -70,14 +74,10 @@ void DocumentTimerManager::UnblockIdling()
 {
 --mIdleBlockCount;
 if( !mIdleBlockCount && mbStartIdleTimer && !maDocIdle.IsActive() )
+{
+mbStartIdleTimer = false;
 maDocIdle.Start();
-}
-
-void DocumentTimerManager::StartBackgroundJobs()
-{
-// Trigger DoIdleJobs(), asynchronously.
-if (!maDocIdle.IsActive()) //fdo#73165 if the timer is already running 
don't restart from 0
-maDocIdle.Start();
+}
 }
 
 DocumentTimerManager::IdleJob DocumentTimerManager::GetNextIdleJob() const
@@ -123,13 +123,14 @@ DocumentTimerManager::IdleJob 
DocumentTimerManager::GetNextIdleJob() const
 return IdleJob::None;
 }
 
-IMPL_LINK( DocumentTimerManager, DoIdleJobs, Timer*, pIdle, void )
+IMPL_LINK_NOARG( DocumentTimerManager, DoIdleJobs, Timer*, void )
 {
 #ifdef TIMELOG
 static ::rtl::Logfile* pModLogFile = 0;
 if( !pModLogFile )
 pModLogFile = new ::rtl::Logfile( "First DoIdleJobs" );
 #endif
+BlockIdling();
 
 IdleJob eJob = GetNextIdleJob();
 
@@ -183,7 +184,8 @@ IMPL_LINK( DocumentTimerManager, DoIdleJobs, Timer*, pIdle, 
void )
 }
 
 if ( IdleJob::None 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2018-07-26 Thread Libreoffice Gerrit user
 sw/inc/unotxdoc.hxx|4 ++--
 sw/source/uibase/inc/gloslst.hxx   |2 +-
 sw/source/uibase/uno/unotxdoc.cxx  |   19 ++-
 sw/source/uibase/utlui/gloslst.cxx |   32 ++--
 4 files changed, 27 insertions(+), 30 deletions(-)

New commits:
commit 1a0494b2dd3c2eaef8a5e83753dfc037d8fa56ae
Author: Noel Grandin 
AuthorDate: Wed Jul 25 12:31:55 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 26 08:33:55 2018 +0200

loplugin:useuniqueptr in SwXTextDocument

Change-Id: Iafe979a9a6c6f92226a25dc52b510682c5e5924f
Reviewed-on: https://gerrit.libreoffice.org/58014
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index f9fda4d3f216..d0ead1913fc1 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -174,8 +174,8 @@ private:
 SfxViewFrame*   m_pHiddenViewFrame;
 rtl::Reference   mxPropertyHelper;
 
-SwPrintUIOptions *  m_pPrintUIOptions;
-SwRenderData *  m_pRenderData;
+std::unique_ptr   m_pPrintUIOptions;
+std::unique_ptr   m_pRenderData;
 
 voidGetNumberFormatter();
 
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 73e69275a698..e2a33df53430 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -192,7 +193,7 @@ using namespace ::com::sun::star::container;
 using namespace ::com::sun::star::document;
 using ::osl::FileBase;
 
-static SwPrintUIOptions * lcl_GetPrintUIOptions(
+static std::unique_ptr lcl_GetPrintUIOptions(
 SwDocShell * pDocShell,
 const SfxViewShell * pView )
 {
@@ -241,7 +242,7 @@ static SwPrintUIOptions * lcl_GetPrintUIOptions(
 pPage = static_cast(pPage->GetNext());
 }
 }
-return new SwPrintUIOptions( nCurrentPage, bWebDoc, bSwSrcView, 
bHasSelection, bHasPostIts, rPrintData );
+return o3tl::make_unique( nCurrentPage, bWebDoc, 
bSwSrcView, bHasSelection, bHasPostIts, rPrintData );
 }
 
 static SwTextFormatColl *lcl_GetParaStyle(const OUString& rCollName, SwDoc* 
pDoc)
@@ -465,7 +466,7 @@ SwXTextDocument::~SwXTextDocument()
 xNumFormatAgg->setDelegator(x0);
 xNumFormatAgg = nullptr;
 }
-delete m_pPrintUIOptions;
+m_pPrintUIOptions.reset();
 if (m_pRenderData && m_pRenderData->IsViewOptionAdjust())
 {   // rhbz#827695: this can happen if the last page is not printed
 // the SwViewShell has been deleted already by SwView::~SwView
@@ -473,7 +474,7 @@ SwXTextDocument::~SwXTextDocument()
 // something less insane that has its own view
 m_pRenderData->ViewOptionAdjustCrashPreventionKludge();
 }
-delete m_pRenderData;
+m_pRenderData.reset();
 }
 
 SwXDocumentPropertyHelper * SwXTextDocument::GetPropertyHelper ()
@@ -2519,7 +2520,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
 SfxViewShell *pView = GetRenderView( bIsSwSrcView, rxOptions, bIsPDFExport 
);
 
 if (!bIsSwSrcView && !m_pRenderData)
-m_pRenderData = new SwRenderData;
+m_pRenderData.reset(new SwRenderData);
 if (!m_pPrintUIOptions)
 m_pPrintUIOptions = lcl_GetPrintUIOptions( pDocShell, pView );
 bool bFormat = m_pPrintUIOptions->processPropertiesAndCheckFormat( 
rxOptions );
@@ -2599,7 +2600,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
 }
 
 m_pRenderData->MakeSwPrtOptions( pRenderDocShell,
-m_pPrintUIOptions, bIsPDFExport );
+m_pPrintUIOptions.get(), bIsPDFExport );
 
 if (pSwView)
 {
@@ -2979,7 +2980,7 @@ void SAL_CALL SwXTextDocument::render(
 OSL_ENSURE( m_pRenderData, "data should have been created already in 
getRendererCount..." );
 OSL_ENSURE( m_pPrintUIOptions, "data should have been created already in 
getRendererCount..." );
 if (!bIsSwSrcView && !m_pRenderData)
-m_pRenderData = new SwRenderData;
+m_pRenderData.reset(new SwRenderData);
 if (!m_pPrintUIOptions)
 m_pPrintUIOptions = lcl_GetPrintUIOptions( pDocShell, pView );
 m_pPrintUIOptions->processProperties( rxOptions );
@@ -3107,8 +3108,8 @@ void SAL_CALL SwXTextDocument::render(
 }
 if( bLastPage )
 {
-delete m_pRenderData;   m_pRenderData = nullptr;
-delete m_pPrintUIOptions;   m_pPrintUIOptions = nullptr;
+m_pRenderData.reset();
+m_pPrintUIOptions.reset();
 }
 }
 
commit a846c7106d4e4e1b8cc61e237cc2e158d037e816
Author: Noel Grandin 
AuthorDate: Wed Jul 25 12:26:15 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 26 08:33:42 2018 +0200

loplugin:useuniqueptr in SwGlossaryList

Change-Id: 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2018-07-24 Thread Libreoffice Gerrit user
 sw/inc/swmodule.hxx   |2 +-
 sw/source/uibase/app/docstyle.cxx |6 +++---
 sw/source/uibase/app/swmodule.cxx |6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 232d0f4f6620bf21f382d38fd98f48ad57525ff0
Author: Noel Grandin 
AuthorDate: Mon Jul 23 12:07:19 2018 +0200
Commit: Noel Grandin 
CommitDate: Tue Jul 24 08:34:10 2018 +0200

loplugin:useuniqueptr in SwModule

Change-Id: I37f4df7d309e83b3232dab8268c3b7557b259ae8
Reviewed-on: https://gerrit.libreoffice.org/57869
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index cdb88dbf3569..8e23f8856d7b 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -91,7 +91,7 @@ class SW_DLLPUBLIC SwModule final : public SfxModule, public 
SfxListener, public
 SvtCTLOptions*  m_pCTLOptions;
 SvtUserOptions* m_pUserOptions;
 
-SfxErrorHandler*m_pErrorHandler;
+std::unique_ptr m_pErrorHandler;
 
 SwAttrPool  *m_pAttrPool;
 
diff --git a/sw/source/uibase/app/swmodule.cxx 
b/sw/source/uibase/app/swmodule.cxx
index 3d2744ddd2c6..14b800abfbe5 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -171,10 +171,10 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
 {
 SetName( "StarWriter" );
 SvxErrorHandler::ensure();
-m_pErrorHandler = new SfxErrorHandler( RID_SW_ERRHDL,
+m_pErrorHandler.reset( new SfxErrorHandler( RID_SW_ERRHDL,
  ErrCodeArea::Sw,
  ErrCodeArea::Sw,
- GetResLocale() );
+ GetResLocale() ) );
 
 m_pModuleConfig = new SwModuleOptions;
 
@@ -225,7 +225,7 @@ SwModule::~SwModule()
 {
 css::uno::Sequence< css::uno::Any > aArgs;
 CallAutomationApplicationEventSinks( "Quit", aArgs );
-delete m_pErrorHandler;
+m_pErrorHandler.reset();
 EndListening( *SfxGetpApp() );
 }
 
commit 07d0c305187abeaa7661b0275725b29fe2e3623f
Author: Noel Grandin 
AuthorDate: Mon Jul 23 11:18:43 2018 +0200
Commit: Noel Grandin 
CommitDate: Tue Jul 24 08:33:57 2018 +0200

loplugin:useuniqueptr in SwImplShellAction

Change-Id: Iab0844b8ad5bbe57c4f1fb5a706bc742abf4cdb5
Reviewed-on: https://gerrit.libreoffice.org/57868
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/uibase/app/docstyle.cxx 
b/sw/source/uibase/app/docstyle.cxx
index 0abb4e461d3e..260ad592eaa8 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -92,7 +92,7 @@ using namespace com::sun::star;
 class SwImplShellAction
 {
 SwWrtShell* pSh;
-CurrShell* pCurrSh;
+std::unique_ptr pCurrSh;
 public:
 explicit SwImplShellAction( SwDoc& rDoc );
 ~SwImplShellAction() COVERITY_NOEXCEPT_FALSE;
@@ -110,7 +110,7 @@ SwImplShellAction::SwImplShellAction( SwDoc& rDoc )
 
 if( pSh )
 {
-pCurrSh = new CurrShell( pSh );
+pCurrSh.reset( new CurrShell( pSh ) );
 pSh->StartAllAction();
 }
 }
@@ -120,7 +120,7 @@ SwImplShellAction::~SwImplShellAction() 
COVERITY_NOEXCEPT_FALSE
 if( pCurrSh )
 {
 pSh->EndAllAction();
-delete pCurrSh;
+pCurrSh.reset();
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2018-07-24 Thread Libreoffice Gerrit user
 sw/inc/docsh.hxx  |4 ++--
 sw/source/filter/xml/xmlimp.cxx   |9 +
 sw/source/filter/xml/xmlimp.hxx   |   10 +-
 sw/source/filter/xml/xmlitemi.cxx |   10 +-
 sw/source/filter/xml/xmltbli.cxx  |4 ++--
 sw/source/uibase/app/docsh.cxx|6 +++---
 sw/source/uibase/app/docshini.cxx |9 -
 7 files changed, 26 insertions(+), 26 deletions(-)

New commits:
commit c92d89b4e481d7f1777592d9f55a250e2d1a9869
Author: Noel Grandin 
AuthorDate: Mon Jul 23 11:16:34 2018 +0200
Commit: Noel Grandin 
CommitDate: Tue Jul 24 08:33:29 2018 +0200

loplugin:useuniqueptr inSwDocShell

Change-Id: I9b834406b391695a18c9fdcdad9a6dd13be34c9e
Reviewed-on: https://gerrit.libreoffice.org/57867
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index d61cd712a51a..9a88de3abeb6 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -67,7 +67,7 @@ class SW_DLLPUBLIC SwDocShell
 {
 rtl::Reference< SwDoc > m_xDoc;  ///< Document.
 rtl::Reference< SfxStyleSheetBasePool > m_xBasePool; ///< Passing through 
for formats.
-FontList*   m_pFontList;  ///< Current Fontlist.
+std::unique_ptr m_pFontList;  ///< Current Fontlist.
 boolm_IsInUpdateFontList; ///< prevent nested calls of 
UpdateFontList
 
 std::unique_ptr m_pStyleManager;
@@ -80,7 +80,7 @@ class SW_DLLPUBLIC SwDocShell
 SwView* m_pView;
 SwWrtShell* m_pWrtShell;
 
-comphelper::EmbeddedObjectContainer* m_pOLEChildList;
+std::unique_ptr m_pOLEChildList;
 sal_Int16   m_nUpdateDocMode;   ///< contains the 
css::document::UpdateDocMode
 boolm_IsATemplate;  ///< prevent nested calls of UpdateFontList
 
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index 1692517501c5..2a40bc1d12da 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -827,7 +827,7 @@ bool SwDocShell::SaveCompleted( const uno::Reference < 
embed::XStorage >& xStor
 }
 }
 
-DELETEZ(m_pOLEChildList);
+m_pOLEChildList.reset();
 if( bResetModified )
 EnableSetModified();
 }
@@ -1080,7 +1080,7 @@ void SwDocShell::GetState(SfxItemSet& rSet)
 break;
 case SID_ATTR_CHAR_FONTLIST:
 {
-rSet.Put( SvxFontListItem(m_pFontList, SID_ATTR_CHAR_FONTLIST) );
+rSet.Put( SvxFontListItem(m_pFontList.get(), 
SID_ATTR_CHAR_FONTLIST) );
 }
 break;
 case SID_MAIL_PREPAREEXPORT:
@@ -1235,7 +1235,7 @@ void SwDocShell::RemoveOLEObjects()
 pOLENd->IsInGlobalDocSection() ) )
 {
 if (!m_pOLEChildList)
-m_pOLEChildList = new comphelper::EmbeddedObjectContainer;
+m_pOLEChildList.reset( new comphelper::EmbeddedObjectContainer 
);
 
 OUString aObjName = pOLENd->GetOLEObj().GetCurrentPersistName();
 GetEmbeddedObjectContainer().MoveEmbeddedObject( aObjName, 
*m_pOLEChildList );
diff --git a/sw/source/uibase/app/docshini.cxx 
b/sw/source/uibase/app/docshini.cxx
index cb9241609f77..0a402d2466af 100644
--- a/sw/source/uibase/app/docshini.cxx
+++ b/sw/source/uibase/app/docshini.cxx
@@ -391,13 +391,13 @@ SwDocShell::~SwDocShell()
 }
 
 RemoveLink();
-delete m_pFontList;
+m_pFontList.reset();
 
 // we, as BroadCaster also become our own Listener
 // (for DocInfo/FileNames/)
 EndListening( *this );
 
-delete m_pOLEChildList;
+m_pOLEChildList.reset();
 }
 
 void  SwDocShell::Init_Impl()
@@ -441,9 +441,8 @@ void SwDocShell::UpdateFontList()
 OSL_ENSURE(m_xDoc.get(), "No Doc no FontList");
 if (m_xDoc.get())
 {
-delete m_pFontList;
-m_pFontList = new FontList( 
m_xDoc->getIDocumentDeviceAccess().getReferenceDevice(true) );
-PutItem( SvxFontListItem( m_pFontList, SID_ATTR_CHAR_FONTLIST ) );
+m_pFontList.reset( new FontList( 
m_xDoc->getIDocumentDeviceAccess().getReferenceDevice(true) ) );
+PutItem( SvxFontListItem( m_pFontList.get(), 
SID_ATTR_CHAR_FONTLIST ) );
 }
 m_IsInUpdateFontList = false;
 }
commit 14377b33bd35a34d5be2d015c9a8d3d108153292
Author: Noel Grandin 
AuthorDate: Mon Jul 23 09:53:08 2018 +0200
Commit: Noel Grandin 
CommitDate: Tue Jul 24 08:33:19 2018 +0200

loplugin:useuniqueptr in SwXMLImport

Change-Id: I0c90d39c87bbd4a6edaa70b2413a64a41585a944
Reviewed-on: https://gerrit.libreoffice.org/57865
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index e88f90e2c621..7370eba1f353 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -59,6 +59,7 @@
 #include 
 #include 
 #include "xmlimp.hxx"
+#include "xmlimpit.hxx"
 #include "xmltexti.hxx"
 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source vcl/inc vcl/unx

2018-07-17 Thread Libreoffice Gerrit user
 sw/inc/unodraw.hxx  |4 ++--
 sw/source/core/unocore/unodraw.cxx  |2 +-
 vcl/inc/unx/fontmanager.hxx |7 +++
 vcl/unx/generic/fontmanager/fontconfig.cxx  |2 +-
 vcl/unx/generic/fontmanager/fontmanager.cxx |   14 +-
 5 files changed, 12 insertions(+), 17 deletions(-)

New commits:
commit e77428ae3143166cfd96a6df1262e358c17f4695
Author: Noel Grandin 
AuthorDate: Mon Jul 16 12:18:35 2018 +0200
Commit: Noel Grandin 
CommitDate: Tue Jul 17 08:39:14 2018 +0200

loplugin:useuniqueptr in SwXShape

Change-Id: I7081485c63e17078cfbae7211d20809b0aec6fc3
Reviewed-on: https://gerrit.libreoffice.org/57517
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx
index b10ab9b1ac01..c6cbed24f270 100644
--- a/sw/inc/unodraw.hxx
+++ b/sw/inc/unodraw.hxx
@@ -134,7 +134,7 @@ class SwXShape : public SwXShapeBaseClass,
 const SfxItemPropertySet*   m_pPropSet;
 const SfxItemPropertyMapEntry*  m_pPropertyMapEntries;
 
-SwShapeDescriptor_Impl* pImpl;
+std::unique_ptr  pImpl;
 
 boolm_bDescriptor;
 
@@ -238,7 +238,7 @@ public:
 virtual void SAL_CALL setSize( const css::awt::Size& aSize ) override;
 virtual OUString SAL_CALL getShapeType(  ) override;
 
-SwShapeDescriptor_Impl* GetDescImpl() {return pImpl;}
+SwShapeDescriptor_Impl* GetDescImpl() {return pImpl.get();}
 SwFrameFormat*   GetFrameFormat() const { return 
const_cast(static_cast(GetRegisteredIn())); }
 const css::uno::Reference< css::uno::XAggregation >& 
GetAggregationInterface() {return xShapeAgg;}
 
diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index a9f376f62d67..3919fc2af1ef 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -984,7 +984,7 @@ SwXShape::~SwXShape()
 uno::Reference< uno::XInterface >  xRef;
 xShapeAgg->setDelegator(xRef);
 }
-delete pImpl;
+pImpl.reset();
 EndListeningAll();
 }
 
commit ecd0ce5529ad6a577260bacaeff58a8bdf9c379f
Author: Noel Grandin 
AuthorDate: Mon Jul 16 08:42:50 2018 +0200
Commit: Noel Grandin 
CommitDate: Tue Jul 17 08:39:00 2018 +0200

loplugin:useuniqueptr in PrintFontManager

Change-Id: I539e167b0b9d3523d50cbebc13227867c5f05bd5
Reviewed-on: https://gerrit.libreoffice.org/57515
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/unx/fontmanager.hxx b/vcl/inc/unx/fontmanager.hxx
index 8b2c70c25000..fcaf801018c4 100644
--- a/vcl/inc/unx/fontmanager.hxx
+++ b/vcl/inc/unx/fontmanager.hxx
@@ -136,7 +136,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
 };
 
 fontID  m_nNextFontID;
-std::unordered_map< fontID, PrintFont* >m_aFonts;
+std::unordered_map< fontID, std::unique_ptr >m_aFonts;
 // for speeding up findFontFileID
 std::unordered_map< OString, std::set< fontID > >
 m_aFontFileToFontID;
@@ -163,9 +163,8 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
 
 PrintFont* getFont( fontID nID ) const
 {
-std::unordered_map< fontID, PrintFont* >::const_iterator it;
-it = m_aFonts.find( nID );
-return it == m_aFonts.end() ? nullptr : it->second;
+auto it = m_aFonts.find( nID );
+return it == m_aFonts.end() ? nullptr : it->second.get();
 }
 static void fillPrintFontInfo(PrintFont* pFont, FastPrintFontInfo& rInfo);
 void fillPrintFontInfo( PrintFont* pFont, PrintFontInfo& rInfo ) const;
diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx 
b/vcl/unx/generic/fontmanager/fontconfig.cxx
index 17629c09173a..a746061b8ebb 100644
--- a/vcl/unx/generic/fontmanager/fontconfig.cxx
+++ b/vcl/unx/generic/fontmanager/fontconfig.cxx
@@ -619,7 +619,7 @@ void PrintFontManager::countFontconfigFonts( 
std::unordered_map& o
 
 // sort into known fonts
 fontID aFont = m_nNextFontID++;
-m_aFonts[ aFont ] = xUpdate.release();
+m_aFonts[ aFont ] = std::move(xUpdate);
 m_aFontFileToFontID[ aBase ].insert( aFont );
 nFonts++;
 SAL_INFO("vcl.fonts.detail", "inserted font " << family << " 
as fontID " << aFont);
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx 
b/vcl/unx/generic/fontmanager/fontmanager.cxx
index 150bec13a75b..a71fb7da6457 100644
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
@@ -152,8 +152,6 @@ PrintFontManager::~PrintFontManager()
 {
 m_aFontInstallerTimer.Stop();
 deinitFontconfig();
-for (auto const& font : m_aFonts)
-delete font.second;
 }
 
 OString PrintFontManager::getDirectory( int nAtom ) const
@@ -196,7 +194,7 @@ std::vector PrintFontManager::addFontFile( const 
OString& 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2018-06-29 Thread Noel Grandin
 sw/inc/ndgrf.hxx  |2 +-
 sw/source/core/graphic/ndgrf.cxx  |   15 ++-
 sw/source/core/inc/dbg_lay.hxx|   20 
 sw/source/core/layout/dbg_lay.cxx |   25 +++--
 4 files changed, 22 insertions(+), 40 deletions(-)

New commits:
commit 99147c8303016498f4bfcef3d5c1fe126ad43076
Author: Noel Grandin 
Date:   Thu Jun 28 14:01:29 2018 +0200

loplugin:useuniqueptr in SwGrfNode

Change-Id: I9f0993f7fbbdaf7552fe0b0c19d3fca691471fa8
Reviewed-on: https://gerrit.libreoffice.org/56626
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index e44c72e69309..a5e4e0cc2969 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -37,7 +37,7 @@ class SW_DLLPUBLIC SwGrfNode: public SwNoTextNode
 friend class SwNodes;
 
 GraphicObject maGrfObj;
-GraphicObject *mpReplacementGraphic;
+std::unique_ptr mpReplacementGraphic;
 tools::SvRef refLink;   ///< If graphics only as 
link then pointer is set.
 Size nGrfSize;
 bool bInSwapIn  :1;
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 00e63f64a918..63a0c43d946c 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -138,8 +138,7 @@ bool SwGrfNode::ReRead(
 {
 bool bReadGrf = false;
 bool bSetTwipSize = true;
-delete mpReplacementGraphic;
-mpReplacementGraphic = nullptr;
+mpReplacementGraphic.reset();
 
 OSL_ENSURE( pGraphic || !rGrfName.isEmpty(),
 "GraphicNode without a name, Graphic or GraphicObject" );
@@ -281,8 +280,7 @@ bool SwGrfNode::ReRead(
 
 SwGrfNode::~SwGrfNode()
 {
-delete mpReplacementGraphic;
-mpReplacementGraphic = nullptr;
+mpReplacementGraphic.reset();
 
 // #i73788#
 mpThreadConsumer.reset();
@@ -390,17 +388,17 @@ const GraphicObject* SwGrfNode::GetReplacementGrfObj() 
const
 
 if(rVectorGraphicDataPtr.get())
 {
-const_cast< SwGrfNode* >(this)->mpReplacementGraphic = new 
GraphicObject(rVectorGraphicDataPtr->getReplacement());
+const_cast< SwGrfNode* >(this)->mpReplacementGraphic.reset( new 
GraphicObject(rVectorGraphicDataPtr->getReplacement()) );
 }
 else if (GetGrfObj().GetGraphic().hasPdfData() ||
  GetGrfObj().GetGraphic().GetType() == 
GraphicType::GdiMetafile)
 {
 // Replacement graphic for PDF and metafiles is just the bitmap.
-const_cast(this)->mpReplacementGraphic = new 
GraphicObject(GetGrfObj().GetGraphic().GetBitmapEx());
+const_cast(this)->mpReplacementGraphic.reset( new 
GraphicObject(GetGrfObj().GetGraphic().GetBitmapEx()) );
 }
 }
 
-return mpReplacementGraphic;
+return mpReplacementGraphic.get();
 }
 
 SwContentNode *SwGrfNode::SplitContentNode( const SwPosition & )
@@ -470,8 +468,7 @@ bool SwGrfNode::SwapIn(bool bWaitForData)
 else if( GraphicType::Default == maGrfObj.GetType() )
 {
 // no default bitmap anymore, thus re-paint
-delete mpReplacementGraphic;
-mpReplacementGraphic = nullptr;
+mpReplacementGraphic.reset();
 
 maGrfObj.SetGraphic( Graphic() );
 onGraphicChanged();
commit 95486bac7090d163d19fe8d35521ac0ef4473a93
Author: Noel Grandin 
Date:   Thu Jun 28 13:57:43 2018 +0200

loplugin:useuniqueptr in SwEnterLeave

Change-Id: I948c146f675675c1902c158be4d97b6d19679a51
Reviewed-on: https://gerrit.libreoffice.org/56625
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sw/source/core/inc/dbg_lay.hxx b/sw/source/core/inc/dbg_lay.hxx
index 95e491782ff6..5c46809f88ae 100644
--- a/sw/source/core/inc/dbg_lay.hxx
+++ b/sw/source/core/inc/dbg_lay.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SW_SOURCE_CORE_INC_DBG_LAY_HXX
 
 #include 
+#include 
 
 enum class PROT {
 FileInit   = 0x,
@@ -84,23 +85,10 @@ public:
 
 class SwEnterLeave
 {
-SwImplEnterLeave* pImpl;
-void Ctor( const SwFrame* pFrame, PROT nFunc, DbgAction nAct, void* pPar );
-void Dtor();
-
+std::unique_ptr pImpl;
 public:
-SwEnterLeave( const SwFrame* pFrame, PROT nFunc, DbgAction nAct, void* 
pPar )
-{
-if( SwProtocol::Record( nFunc ) )
-Ctor( pFrame, nFunc, nAct, pPar );
-else
-pImpl = nullptr;
-}
-~SwEnterLeave()
-{
-if( pImpl )
-Dtor();
-}
+SwEnterLeave( const SwFrame* pFrame, PROT nFunc, DbgAction nAct, void* 
pPar );
+~SwEnterLeave();
 };
 
 #define PROTOCOL( pFrame, nFunc, nAct, pPar ) {   if( SwProtocol::Record( 
nFunc ) )\
diff --git a/sw/source/core/layout/dbg_lay.cxx 
b/sw/source/core/layout/dbg_lay.cxx
index 203f07893296..8db7a0d79a22 100644
--- a/sw/source/core/layout/dbg_lay.cxx
+++ b/sw/source/core/layout/dbg_lay.cxx
@@ -860,37 +860,34 @@ void 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2018-05-28 Thread Bjoern Michaelsen
 sw/inc/fmtmeta.hxx  |1 
 sw/inc/unochart.hxx |7 ---
 sw/source/core/txtnode/fmtatr2.cxx  |6 +--
 sw/source/core/unocore/unochart.cxx |6 ---
 sw/source/core/unocore/unorefmk.cxx |   70 
 5 files changed, 38 insertions(+), 52 deletions(-)

New commits:
commit 538c6219a2a347f9f601288a2dd345bf7d3c3209
Author: Bjoern Michaelsen 
Date:   Thu May 10 10:51:42 2018 +0200

dont use SwClient/SwModify in unocore: Meta

Change-Id: Icde1f5b9af599ca8b1ef52863c2772670659a39b
Reviewed-on: https://gerrit.libreoffice.org/54648
Tested-by: Jenkins 
Reviewed-by: Björn Michaelsen 

diff --git a/sw/inc/fmtmeta.hxx b/sw/inc/fmtmeta.hxx
index 9fe0fce07656..bcc93b107e77 100644
--- a/sw/inc/fmtmeta.hxx
+++ b/sw/inc/fmtmeta.hxx
@@ -127,6 +127,7 @@ namespace sw {
 class Meta
 : public ::sfx2::Metadatable
 , public SwModify
+, public sw::BroadcasterMixin
 {
 protected:
 friend class ::SwFormatMeta; ///< SetFormatMeta, NotifyChangeTextNode
diff --git a/sw/source/core/txtnode/fmtatr2.cxx 
b/sw/source/core/txtnode/fmtatr2.cxx
index 374326f40eb6..f74696687558 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -664,9 +664,7 @@ void Meta::NotifyChangeTextNode(SwTextNode *const pTextNode)
 }
 if (!pTextNode) // text node gone? invalidate UNO object!
 {
-SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT,
-_cast(*this) ); // cast to base class!
-Modify(, );
+GetNotifier().Broadcast(SfxHint(SfxHintId::Deinitializing));
 }
 }
 
@@ -674,9 +672,11 @@ void Meta::NotifyChangeTextNode(SwTextNode *const 
pTextNode)
 void Meta::Modify( const SfxPoolItem *pOld, const SfxPoolItem *pNew )
 {
 NotifyClients(pOld, pNew);
+GetNotifier().Broadcast(SfxHint(SfxHintId::DataChanged));
 if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which()))
 {   // invalidate cached uno object
 SetXMeta(uno::Reference(nullptr));
+GetNotifier().Broadcast(SfxHint(SfxHintId::Deinitializing));
 }
 }
 
diff --git a/sw/source/core/unocore/unorefmk.cxx 
b/sw/source/core/unocore/unorefmk.cxx
index b989ad8a28fe..41793c482bbe 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -607,8 +607,7 @@ SwXMetaText::createTextCursorByRange(
 // the Meta has a cached list of text portions for its contents
 // this list is created by SwXTextPortionEnumeration
 // the Meta listens at the SwTextNode and throws away the cache when it changes
-class SwXMeta::Impl
-: public SwClient
+class SwXMeta::Impl : public SvtListener
 {
 private:
 ::osl::Mutex m_Mutex; // just for OInterfaceContainerHelper2
@@ -622,56 +621,53 @@ public:
 bool m_bIsDescriptor;
 uno::Reference m_xParentText;
 rtl::Reference m_xText;
+sw::Meta* m_pMeta;
 
-Impl(   SwXMeta & rThis, SwDoc & rDoc,
-::sw::Meta * const pMeta,
+Impl(SwXMeta& rThis, SwDoc& rDoc,
+::sw::Meta* const pMeta,
 uno::Reference const& xParentText,
 TextRangeList_t const * const pPortions)
-: SwClient(pMeta)
-, m_EventListeners(m_Mutex)
-, m_pTextPortions( pPortions )
-, m_bIsDisposed( false )
+: m_EventListeners(m_Mutex)
+, m_pTextPortions(pPortions)
+, m_bIsDisposed(false)
 , m_bIsDescriptor(nullptr == pMeta)
 , m_xParentText(xParentText)
 , m_xText(new SwXMetaText(rDoc, rThis))
+, m_pMeta(pMeta)
 {
+!m_bIsDescriptor && StartListening(m_pMeta->GetNotifier());
 }
 
-inline const ::sw::Meta * GetMeta() const;
+inline const ::sw::Meta* GetMeta() const;
 // only for SwXMetaField!
-inline const ::sw::MetaField * GetMetaField() const;
+inline const ::sw::MetaField* GetMetaField() const;
 protected:
-// SwClient
-virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) 
override;
+virtual void Notify(const SfxHint& rHint) override;
 
 };
 
-inline const ::sw::Meta * SwXMeta::Impl::GetMeta() const
+inline const ::sw::Meta* SwXMeta::Impl::GetMeta() const
 {
-return static_cast< const ::sw::Meta * >(GetRegisteredIn());
+return m_pMeta;
 }
 
 // SwModify
-void SwXMeta::Impl::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
+void SwXMeta::Impl::Notify(const SfxHint& rHint)
 {
 m_pTextPortions.reset(); // throw away cache (SwTextNode changed)
-
-ClientModify(this, pOld, pNew);
-
-if (GetRegisteredIn())
+if(rHint.GetId() == SfxHintId::Dying || rHint.GetId() == 
SfxHintId::Deinitializing)
 {
-return; // core object still alive
-}
-
-m_bIsDisposed = true;
-m_xText->Invalidate();
-uno::Reference const xThis(m_wThis);
-if (!xThis.is())
-{   // fdo#72695: if UNO object is already dead, don't revive it 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source sw/uiconfig

2018-04-17 Thread Caolán McNamara
 sw/inc/swabstdlg.hxx|4 
 sw/source/ui/dialog/swdlgfact.cxx   |   30 ++-
 sw/source/ui/dialog/swdlgfact.hxx   |   26 ++-
 sw/source/ui/dialog/swuiexp.cxx |1 
 sw/source/ui/fldui/javaedit.cxx |  225 
 sw/source/ui/index/multmrk.cxx  |   50 ++
 sw/source/uibase/inc/javaedit.hxx   |   73 -
 sw/source/uibase/inc/multmrk.hxx|   29 +--
 sw/source/uibase/shells/textfld.cxx |4 
 sw/source/uibase/shells/textidx.cxx |2 
 sw/uiconfig/swriter/ui/insertscript.ui  |  212 ++
 sw/uiconfig/swriter/ui/selectindexdialog.ui |   49 +-
 12 files changed, 371 insertions(+), 334 deletions(-)

New commits:
commit 8a35cafb58c38e84541a44f8534c0511d2400e75
Author: Caolán McNamara 
Date:   Mon Apr 16 20:52:37 2018 +0100

weld SwMultiTOXMarkDlg

Change-Id: Idff6120f0a04bd94ec8402ae02daa9599f133698
Reviewed-on: https://gerrit.libreoffice.org/53004
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 862f8bb94751..2c24fc1bfbe1 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -477,7 +477,7 @@ public:
 const css::uno::Reference< 
css::sdbc::XConnection>& xConnection ) = 0;
 virtual VclPtr   
CreateMailMergeCreateFromDlg(vcl::Window* pParent) = 0;
 virtual VclPtr 
CreateMailMergeFieldConnectionsDlg(vcl::Window* pParent) = 0;
-virtual VclPtr  
CreateMultiTOXMarkDlg(vcl::Window* pParent, SwTOXMgr ) = 0;
+virtual VclPtr  
CreateMultiTOXMarkDlg(weld::Window* pParent, SwTOXMgr ) = 0;
 virtual VclPtr   
CreateOutlineTabDialog(vcl::Window* pParent,
 const SfxItemSet* pSwItemSet,
 SwWrtShell &) = 0;
diff --git a/sw/source/ui/dialog/swdlgfact.cxx 
b/sw/source/ui/dialog/swdlgfact.cxx
index 6796a973c5dc..e3e9559a3331 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -123,6 +123,10 @@ short AbstractSwSortDlg_Impl::Execute()
 {
 return m_xDlg->execute();
 }
+short AbstractMultiTOXMarkDlg_Impl::Execute()
+{
+return m_xDlg->execute();
+}
 IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl);
 short AbstractSwConvertTableDlg_Impl::Execute()
 {
@@ -987,10 +991,9 @@ VclPtr 
SwAbstractDialogFactory_Impl::Creat
 return VclPtr::Create( pDlg );
 }
 
-VclPtr 
SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg(vcl::Window* pParent, 
SwTOXMgr )
+VclPtr 
SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg(weld::Window* pParent, 
SwTOXMgr )
 {
-VclPtr pDlg = VclPtr::Create(pParent, rTOXMgr);
-return VclPtr::Create(pDlg);
+return VclPtr::Create(new 
SwMultiTOXMarkDlg(pParent, rTOXMgr));
 }
 
 VclPtr 
SwAbstractDialogFactory_Impl::CreateSvxNumBulletTabDialog(vcl::Window* pParent,
diff --git a/sw/source/ui/dialog/swdlgfact.hxx 
b/sw/source/ui/dialog/swdlgfact.hxx
index 904e005276c4..d53aad217e3c 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -25,6 +25,7 @@ class SwInsertAbstractDlg;
 class SwAsciiFilterDlg;
 class Dialog;
 class SwBreakDlg;
+class SwMultiTOXMarkDlg;
 class SwSortDlg;
 class SwTableHeightDlg;
 class SwTableWidthDlg;
@@ -135,6 +136,18 @@ public:
 virtual short Execute() override;
 };
 
+class AbstractMultiTOXMarkDlg_Impl : public VclAbstractDialog
+{
+protected:
+std::unique_ptr m_xDlg;
+public:
+explicit AbstractMultiTOXMarkDlg_Impl(SwMultiTOXMarkDlg* p)
+: m_xDlg(p)
+{
+}
+virtual short Execute() override;
+};
+
 class AbstractSwBreakDlg_Impl : public AbstractSwBreakDlg
 {
 protected:
@@ -591,7 +604,7 @@ public:
 const css::uno::Reference< 
css::sdbc::XConnection>& xConnection ) override;
 virtual VclPtr 
CreateMailMergeCreateFromDlg(vcl::Window* pParent) override;
 virtual VclPtr 
CreateMailMergeFieldConnectionsDlg(vcl::Window* pParent) override;
-virtual VclPtr  
CreateMultiTOXMarkDlg(vcl::Window* pParent, SwTOXMgr ) override;
+virtual VclPtr  
CreateMultiTOXMarkDlg(weld::Window* pParent, SwTOXMgr ) override;
 virtual VclPtr   
CreateOutlineTabDialog(vcl::Window* pParent, const SfxItemSet* pSwItemSet,
 SwWrtShell &) override;
 virtual VclPtr   
CreateSvxNumBulletTabDialog(vcl::Window* pParent,
diff --git a/sw/source/ui/dialog/swuiexp.cxx b/sw/source/ui/dialog/swuiexp.cxx
index f541a4507909..ba351e57ced5 100644
--- a/sw/source/ui/dialog/swuiexp.cxx
+++ b/sw/source/ui/dialog/swuiexp.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2018-03-11 Thread Bjoern Michaelsen
 sw/inc/docufld.hxx |2 -
 sw/source/core/fields/docufld.cxx  |8 +--
 sw/source/core/inc/unoport.hxx |6 ++---
 sw/source/core/unocore/unoport.cxx |   41 +
 4 files changed, 25 insertions(+), 32 deletions(-)

New commits:
commit 82ff1317a3f4627d25399e93da0f9bc88fe89205
Author: Bjoern Michaelsen 
Date:   Wed Jan 31 23:12:14 2018 +0100

use sw::WriterMultiListener instead of SwDepend in SwXTextPortion

- also switch from old Modify() handler to new SwClientNotify()
- also simplify some sequence generation with C++11

Change-Id: I219f626ce51e07c581ddf49d0cf5dc66e2d6a997
Reviewed-on: https://gerrit.libreoffice.org/49567
Tested-by: Jenkins 
Reviewed-by: Björn Michaelsen 

diff --git a/sw/source/core/inc/unoport.hxx b/sw/source/core/inc/unoport.hxx
index d0cef52f7c70..2cb9ddb38402 100644
--- a/sw/source/core/inc/unoport.hxx
+++ b/sw/source/core/inc/unoport.hxx
@@ -115,8 +115,8 @@ private:
 std::unique_ptr< css::uno::Any > m_pRubyPosition;
 sw::UnoCursorPointer m_pUnoCursor;
 
-const SwDepend  m_FrameDepend;
-SwFrameFormat *  m_pFrameFormat;
+sw::WriterMultiListener m_aDepends;
+SwFrameFormat*  m_pFrameFormat;
 const SwTextPortionType m_ePortionType;
 
 boolm_bIsCollapsed;
@@ -148,7 +148,7 @@ protected:
 virtual ~SwXTextPortion() override;
 
 //SwClient
-virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) 
override;
+virtual void SwClientNotify(const SwModify&, const SfxHint& rHint) 
override;
 
 public:
 SwXTextPortion(const SwUnoCursor* pPortionCursor, css::uno::Reference< 
css::text::XText > const& rParent, SwTextPortionType   eType   );
diff --git a/sw/source/core/unocore/unoport.cxx 
b/sw/source/core/unocore/unoport.cxx
index 09092d1501d1..80f707ef2526 100644
--- a/sw/source/core/unocore/unoport.cxx
+++ b/sw/source/core/unocore/unoport.cxx
@@ -71,7 +71,7 @@ SwXTextPortion::SwXTextPortion(
 ?  PROPERTY_MAP_REDLINE_PORTION
 :  PROPERTY_MAP_TEXTPORTION_EXTENSIONS))
 , m_xParentText(rParent)
-, m_FrameDepend(this, nullptr)
+, m_aDepends(*this)
 , m_pFrameFormat(nullptr)
 , m_ePortionType(eType)
 , m_bIsCollapsed(false)
@@ -86,11 +86,12 @@ SwXTextPortion::SwXTextPortion(
 : m_pPropSet(aSwMapProvider.GetPropertySet(
 PROPERTY_MAP_TEXTPORTION_EXTENSIONS))
 , m_xParentText(rParent)
-, m_FrameDepend(this, )
+, m_aDepends(*this)
 , m_pFrameFormat()
 , m_ePortionType(PORTION_FRAME)
 , m_bIsCollapsed(false)
 {
+m_aDepends.StartListening();
 init( pPortionCursor);
 }
 
@@ -107,7 +108,7 @@ SwXTextPortion::SwXTextPortion(
 , m_pRubyAdjust ( bIsEnd ? nullptr : new uno::Any )
 , m_pRubyIsAbove( bIsEnd ? nullptr : new uno::Any )
 , m_pRubyPosition( bIsEnd ? nullptr : new uno::Any )
-, m_FrameDepend(this, nullptr)
+, m_aDepends(*this)
 , m_pFrameFormat(nullptr)
 , m_ePortionType( bIsEnd ? PORTION_RUBY_END : PORTION_RUBY_START )
 , m_bIsCollapsed(false)
@@ -129,7 +130,7 @@ SwXTextPortion::~SwXTextPortion()
 {
 SolarMutexGuard aGuard;
 m_pUnoCursor.reset(nullptr);
-const_cast(_FrameDepend)->EndListeningAll();
+m_aDepends.EndListeningAll();
 }
 
 uno::Reference< text::XText >  SwXTextPortion::getText()
@@ -798,14 +799,12 @@ sal_Int64 SwXTextPortion::getSomething( const 
uno::Sequence< sal_Int8 >& rId )
 
 uno::Sequence< OUString > SwXTextPortion::getAvailableServiceNames()
 {
-SolarMutexGuard aGuard;
-uno::Sequence aRet { "com.sun.star.text.TextContent" };
-return aRet;
+return { "com.sun.star.text.TextContent" };
 }
 
 OUString SwXTextPortion::getImplementationName()
 {
-return OUString("SwXTextPortion");
+return { "SwXTextPortion" };
 }
 
 sal_Bool SwXTextPortion::supportsService(const OUString& rServiceName)
@@ -815,24 +814,22 @@ sal_Bool SwXTextPortion::supportsService(const OUString& 
rServiceName)
 
 uno::Sequence< OUString > SwXTextPortion::getSupportedServiceNames()
 {
-uno::Sequence< OUString > aRet(7);
-OUString* pArray = aRet.getArray();
-pArray[0] = "com.sun.star.text.TextPortion";
-pArray[1] = "com.sun.star.style.CharacterProperties";
-pArray[2] = "com.sun.star.style.CharacterPropertiesAsian";
-pArray[3] = "com.sun.star.style.CharacterPropertiesComplex";
-pArray[4] = "com.sun.star.style.ParagraphProperties";
-pArray[5] = "com.sun.star.style.ParagraphPropertiesAsian";
-pArray[6] = "com.sun.star.style.ParagraphPropertiesComplex";
-return aRet;
+return { "com.sun.star.text.TextPortion",
+"com.sun.star.style.CharacterProperties",
+"com.sun.star.style.CharacterPropertiesAsian",
+

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2018-02-20 Thread Michael Stahl
 sw/inc/txtftn.hxx |4 ++--
 sw/source/core/doc/DocumentLinksAdministrationManager.cxx |   14 +++---
 sw/source/core/inc/DocumentLinksAdministrationManager.hxx |3 ++-
 sw/source/core/txtnode/atrftn.cxx |7 +++
 4 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 5f4366236537b7e44afd5b559c826db8ce35d404
Author: Michael Stahl 
Date:   Mon Feb 19 11:27:51 2018 +0100

sw: DELETEZ to unique_ptr in DocumentLinksAdministrationManager

Change-Id: I428848c48c2d265e82db9d3666492d50b01a221d

diff --git a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx 
b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
index a66b29ec3ab0..2d275359f57b 100644
--- a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
+++ b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
@@ -169,10 +169,11 @@ namespace
 namespace sw
 {
 
-DocumentLinksAdministrationManager::DocumentLinksAdministrationManager( SwDoc& 
i_rSwdoc ) : mbVisibleLinks(true),
-   
 mbLinksUpdated( false ), //#i38810#
-   
 mpLinkMgr( new sfx2::LinkManager( nullptr ) ),
-   
 m_rDoc( i_rSwdoc )
+DocumentLinksAdministrationManager::DocumentLinksAdministrationManager( SwDoc& 
i_rSwdoc )
+: mbVisibleLinks(true)
+, mbLinksUpdated( false ) //#i38810#
+, m_pLinkMgr( new sfx2::LinkManager(nullptr) )
+, m_rDoc( i_rSwdoc )
 {
 }
 
@@ -188,12 +189,12 @@ void 
DocumentLinksAdministrationManager::SetVisibleLinks(bool bFlag)
 
 sfx2::LinkManager& DocumentLinksAdministrationManager::GetLinkManager()
 {
-return *mpLinkMgr;
+return *m_pLinkMgr;
 }
 
 const sfx2::LinkManager& DocumentLinksAdministrationManager::GetLinkManager() 
const
 {
-return *mpLinkMgr;
+return *m_pLinkMgr;
 }
 
 // #i42634# Moved common code of SwReader::Read() and SwDocShell::UpdateLinks()
@@ -439,7 +440,6 @@ bool DocumentLinksAdministrationManager::LinksUpdated() 
const
 
 DocumentLinksAdministrationManager::~DocumentLinksAdministrationManager()
 {
-DELETEZ( mpLinkMgr );
 }
 
 bool DocumentLinksAdministrationManager::SelectServerObj( const OUString& 
rStr, SwPaM*& rpPam, SwNodeRange*& rpRange ) const
diff --git a/sw/source/core/inc/DocumentLinksAdministrationManager.hxx 
b/sw/source/core/inc/DocumentLinksAdministrationManager.hxx
index 43dc9a91c1a1..8294eaf86f4d 100644
--- a/sw/source/core/inc/DocumentLinksAdministrationManager.hxx
+++ b/sw/source/core/inc/DocumentLinksAdministrationManager.hxx
@@ -22,6 +22,7 @@
 
 #include 
 
+#include 
 
 namespace sfx2 { class LinkManager; }
 class SwDoc;
@@ -71,7 +72,7 @@ private:
 
 bool mbVisibleLinks; //< TRUE: Links are inserted visibly.
 bool mbLinksUpdated; //< #i38810# flag indicating, that the links have 
been updated.
-sfx2::LinkManager *mpLinkMgr; //< List of linked stuff (graphics/DDE/OLE).
+std::unique_ptr m_pLinkMgr; //< List of linked stuff 
(graphics/DDE/OLE).
 
 SwDoc& m_rDoc;
 };
commit bd9dfec21413fdd5df346e8dfecdffdd7bc30fc6
Author: Michael Stahl 
Date:   Fri Feb 16 23:43:31 2018 +0100

sw: DELETEZ to unique_ptr in SwTextFootnote

Change-Id: Ibd0a566dffca40da37727421c54b50e1d834ef3d

diff --git a/sw/inc/txtftn.hxx b/sw/inc/txtftn.hxx
index 1a7a678b0377..3c830e7ff273 100644
--- a/sw/inc/txtftn.hxx
+++ b/sw/inc/txtftn.hxx
@@ -31,7 +31,7 @@ class SwFrame;
 
 class SW_DLLPUBLIC SwTextFootnote : public SwTextAttr
 {
-SwNodeIndex * m_pStartNode;
+std::unique_ptr m_pStartNode;
 SwTextNode * m_pTextNode;
 sal_uInt16 m_nSeqNo;
 
@@ -39,7 +39,7 @@ public:
 SwTextFootnote( SwFormatFootnote& rAttr, sal_Int32 nStart );
 virtual ~SwTextFootnote() override;
 
-SwNodeIndex *GetStartNode() const { return m_pStartNode; }
+SwNodeIndex *GetStartNode() const { return m_pStartNode.get(); }
 void SetStartNode( const SwNodeIndex *pNode, bool bDelNodes = true );
 void SetNumber( const sal_uInt16 nNumber, const OUString  );
 void CopyFootnote(SwTextFootnote & rDest, SwTextNode & rDestNode) const;
diff --git a/sw/source/core/txtnode/atrftn.cxx 
b/sw/source/core/txtnode/atrftn.cxx
index 799526e60802..d7b3c122f666 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -247,7 +247,6 @@ OUString SwFormatFootnote::GetViewNumStr( const SwDoc& 
rDoc, bool bInclStrings )
 
 SwTextFootnote::SwTextFootnote( SwFormatFootnote& rAttr, sal_Int32 nStartPos )
 : SwTextAttr( rAttr, nStartPos )
-, m_pStartNode( nullptr )
 , m_pTextNode( nullptr )
 , m_nSeqNo( USHRT_MAX )
 {
@@ -266,7 +265,7 @@ void SwTextFootnote::SetStartNode( const SwNodeIndex 
*pNewNode, bool bDelNode )
 {
 if ( 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source xmloff/source

2018-02-15 Thread Miklos Vajna
 sw/inc/docsh.hxx |6 --
 sw/inc/docufld.hxx   |2 +-
 sw/inc/editsh.hxx|   15 ---
 sw/inc/fesh.hxx  |2 --
 sw/inc/finalthreadmanager.hxx|3 +--
 sw/inc/fldbas.hxx|1 -
 sw/inc/flddropdown.hxx   |2 +-
 sw/source/core/edit/autofmt.cxx  |1 +
 sw/source/core/edit/edtab.cxx|1 +
 sw/source/core/unocore/unotbl.cxx|1 +
 sw/source/uibase/dochdl/swdtflvr.cxx |1 +
 xmloff/source/core/xmlimp.cxx|7 +++
 12 files changed, 18 insertions(+), 24 deletions(-)

New commits:
commit 798a989937a4acf7830588637f8c3902b4d985d8
Author: Miklos Vajna 
Date:   Wed Feb 14 22:13:06 2018 +0100

Fix some IWYU warnings

Change-Id: I49b5e3a9e8b91baace9f3b3d4f0ac9d8531d5abe
Reviewed-on: https://gerrit.libreoffice.org/49782
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index e2c754f1ca32..cbee1542e559 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -29,8 +29,6 @@
 #include "shellid.hxx"
 
 #include 
-#include 
-#include 
 
 #include 
 
@@ -55,6 +53,10 @@ class IDocumentSettingAccess;
 class IDocumentChartDataProviderAccess;
 class SwDocShell;
 class SwDrawModel;
+namespace svt
+{
+class EmbeddedObjectRef;
+}
 
 // initialize DrawModel (in form of a SwDrawModel) and DocShell (in form of a 
SwDocShell)
 // as needed, one or both parameters may be zero
diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index 4d133ff26cb0..13af74471311 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -25,13 +25,13 @@
 #include 
 
 #include "fldbas.hxx"
-#include "numrule.hxx"
 
 class SetGetExpFields;
 class SwTextField;
 class SwFrame;
 class OutlinerParaObject;
 class SwTextAPIObject;
+class SwCharFormat;
 
 enum SwAuthorFormat
 {
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 2fd055f6c87c..99c970233810 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -21,27 +21,16 @@
 
 #include "crsrsh.hxx"
 
-#include "IMark.hxx"
 #include "charfmt.hxx"
 #include "fldupde.hxx"
 #include "frmfmt.hxx"
-#include "itabenum.hxx"
-#include "swdbdata.hxx"
 #include "swdllapi.h"
 #include "swundo.hxx"
 #include "tblenum.hxx"
 #include "tox.hxx"
-#include 
 
-#include 
-#include 
-
-#include 
-
-#include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -102,6 +91,9 @@ class SwAuthEntry;
 class SwRewriter;
 class SwView;
 struct SwConversionArgs;
+struct SvxSwAutoFormatFlags;
+struct SwInsertTableOptions;
+struct SwDBData;
 enum class SvtScriptType;
 enum class SfxClassificationPolicyType;
 enum class RedlineFlags;
@@ -114,6 +106,7 @@ namespace com { namespace sun { namespace star { namespace 
uno {
 namespace svx{
 struct SpellPortion;
 typedef std::vector SpellPortions;
+class ClassificationResult;
 }
 
 namespace sfx2{
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 9923aad5bff6..67be27486aea 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -20,7 +20,6 @@
 #define INCLUDED_SW_INC_FESH_HXX
 
 #include 
-#include 
 #include 
 
 #include 
@@ -31,7 +30,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
diff --git a/sw/inc/finalthreadmanager.hxx b/sw/inc/finalthreadmanager.hxx
index 982fd62cd12f..26c526178ff0 100644
--- a/sw/inc/finalthreadmanager.hxx
+++ b/sw/inc/finalthreadmanager.hxx
@@ -21,12 +21,11 @@
 #define INCLUDED_SW_SOURCE_CORE_INC_FINALTHREADMANAGER_HXX
 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index e3fed4461a70..44e06c2c34be 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -27,7 +27,6 @@
 #include 
 #include 
 #include 
-#include "toxe.hxx"
 
 class SwDoc;
 class SvNumberFormatter;
diff --git a/sw/inc/flddropdown.hxx b/sw/inc/flddropdown.hxx
index 81074d8fabca..36aa09fe0b3d 100644
--- a/sw/inc/flddropdown.hxx
+++ b/sw/inc/flddropdown.hxx
@@ -19,7 +19,7 @@
 #ifndef INCLUDED_SW_INC_FLDDROPDOWN_HXX
 #define INCLUDED_SW_INC_FLDDROPDOWN_HXX
 
-#include 
+#include 
 #include "swdllapi.h"
 #include "fldbas.hxx"
 
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index b1b276c97e4d..f201ac55f62f 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -65,6 +65,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx
index a7f20c31e757..4f69a04b713b 100644
--- a/sw/source/core/edit/edtab.cxx
+++ b/sw/source/core/edit/edtab.cxx
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index 210eb3881b19..2c4d45151cca 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source writerperfect/uiconfig

2017-12-04 Thread Miklos Vajna
 sw/inc/authratr.hxx |   10 ++---
 sw/source/core/access/accpara.cxx   |   16 
 sw/source/ui/config/optpage.cxx |   28 +++---
 sw/source/uibase/app/swmodul1.cxx   |   18 -
 sw/source/uibase/config/modcfg.cxx  |   62 
 sw/source/uibase/config/viewopt.cxx |6 +--
 writerperfect/uiconfig/ui/exportepub.ui |2 -
 7 files changed, 71 insertions(+), 71 deletions(-)

New commits:
commit b39b9b5822aa084cfa3ef85908c9cb504165277f
Author: Miklos Vajna 
Date:   Mon Dec 4 10:16:23 2017 +0100

EPUB export dialog: fix wrong string context

I forgot to update this after copy

Change-Id: I5f060a602a35ee83bc3f2ff4898039bf347fe1cd
Reviewed-on: https://gerrit.libreoffice.org/45784
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerperfect/uiconfig/ui/exportepub.ui 
b/writerperfect/uiconfig/ui/exportepub.ui
index da0124161652..86d82c64128e 100644
--- a/writerperfect/uiconfig/ui/exportepub.ui
+++ b/writerperfect/uiconfig/ui/exportepub.ui
@@ -422,7 +422,7 @@
 True
 False
 6
-Metadata
+Metadata
 True
 versionlb
 0
commit a36cab2b689b26bbf5374b4974e85c9f250b89e9
Author: Miklos Vajna 
Date:   Mon Dec 4 09:43:56 2017 +0100

sw: prefix members of AuthorCharAttr

Change-Id: I9439c900ef2ec567cde105a3e7b8fe222ac1ccb6
Reviewed-on: https://gerrit.libreoffice.org/45780
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/sw/inc/authratr.hxx b/sw/inc/authratr.hxx
index 814e914f3f9d..1507e088addf 100644
--- a/sw/inc/authratr.hxx
+++ b/sw/inc/authratr.hxx
@@ -27,16 +27,16 @@
 class SW_DLLPUBLIC AuthorCharAttr
 {
 public:
-sal_uInt16  nItemId;
-sal_uInt16  nAttr;
-ColorData nColor;
+sal_uInt16  m_nItemId;
+sal_uInt16  m_nAttr;
+ColorData m_nColor;
 
 AuthorCharAttr();
 
 bool operator == ( const AuthorCharAttr& rAttr ) const
 {
-return  nItemId == rAttr.nItemId && nAttr == rAttr.nAttr &&
-nColor == rAttr.nColor;
+return  m_nItemId == rAttr.m_nItemId && m_nAttr == rAttr.m_nAttr &&
+m_nColor == rAttr.m_nColor;
 }
 };
 
diff --git a/sw/source/core/access/accpara.cxx 
b/sw/source/core/access/accpara.cxx
index 6a9d33767e35..4fb50f858d8d 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -2092,7 +2092,7 @@ void SwAccessibleParagraph::_correctValues( const 
sal_Int32 nIndex,
 break;
 }
 }
-switch( aChangeAttr.nItemId )
+switch( aChangeAttr.m_nItemId )
 {
 case SID_ATTR_CHAR_WEIGHT:
 ChangeAttr.Name = UNO_NAME_CHAR_WEIGHT;
@@ -2108,26 +2108,26 @@ void SwAccessibleParagraph::_correctValues( const 
sal_Int32 nIndex,
 break;
 case SID_ATTR_CHAR_UNDERLINE:
 ChangeAttr.Name = UNO_NAME_CHAR_UNDERLINE;
-ChangeAttr.Value <<= aChangeAttr.nAttr; //underline line
+ChangeAttr.Value <<= aChangeAttr.m_nAttr; //underline line
 break;
 }
-if( aChangeAttr.nColor != COL_NONE_COLOR )
+if( aChangeAttr.m_nColor != COL_NONE_COLOR )
 {
-if( aChangeAttr.nItemId == SID_ATTR_BRUSH )
+if( aChangeAttr.m_nItemId == SID_ATTR_BRUSH )
 {
 ChangeAttrColor.Name = UNO_NAME_CHAR_BACK_COLOR;
-if( aChangeAttr.nColor == COL_TRANSPARENT )//char backcolor
+if( aChangeAttr.m_nColor == COL_TRANSPARENT )//char backcolor
 ChangeAttrColor.Value <<= COL_BLUE;
 else
-ChangeAttrColor.Value <<= aChangeAttr.nColor;
+ChangeAttrColor.Value <<= aChangeAttr.m_nColor;
 }
 else
 {
 ChangeAttrColor.Name = UNO_NAME_CHAR_COLOR;
-if( aChangeAttr.nColor == COL_TRANSPARENT )//char color
+if( aChangeAttr.m_nColor == COL_TRANSPARENT )//char color
 ChangeAttrColor.Value <<= COL_BLUE;
 else
-ChangeAttrColor.Value <<= aChangeAttr.nColor;
+ChangeAttrColor.Value <<= aChangeAttr.m_nColor;
 }
 }
 }
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 1ce7ae23e78d..ccbed1e2e6ac 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -1720,8 +1720,8 @@ namespace
 {
 CharAttr& rAttr(aRedlineAttr[pAttrMap[i]]);
 rLB.SetEntryData(i, );
-if (rAttr.nItemId == rAttrToSelect.nItemId &&
-

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2017-11-16 Thread Noel Grandin
 sw/inc/PostItMgr.hxx |3 +
 sw/source/uibase/dochdl/swdtflvr.cxx |   62 +++
 sw/source/uibase/docvw/PostItMgr.cxx |5 --
 sw/source/uibase/inc/swdtflvr.hxx|   11 +++---
 4 files changed, 38 insertions(+), 43 deletions(-)

New commits:
commit 49e1d1f0482969520f8ac64d5ff5fbba5f7c00bf
Author: Noel Grandin 
Date:   Thu Nov 16 11:05:11 2017 +0200

loplugin:useuniqueptr in SwPostItMgr

Change-Id: I567ec14112ee8d5224c19c7616fd8ed06619c228
Reviewed-on: https://gerrit.libreoffice.org/44822
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx
index 1bb0ff09bf23..8e60929ca4b7 100644
--- a/sw/inc/PostItMgr.hxx
+++ b/sw/inc/PostItMgr.hxx
@@ -25,6 +25,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -163,7 +164,7 @@ class SwPostItMgr: public SfxListener
 boolmbIsShowAnchor;
 
 // data structure to collect the  instances for 
certain  instances.
-sw::sidebarwindows::SwFrameSidebarWinContainer* 
mpFrameSidebarWinContainer;
+std::unique_ptr 
mpFrameSidebarWinContainer;
 
 voidAddPostIts(bool bCheckExistence = true,bool bFocus = 
true);
 voidRemoveSidebarWin();
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx 
b/sw/source/uibase/docvw/PostItMgr.cxx
index 8e39efa3726c..145659405482 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -238,9 +238,6 @@ SwPostItMgr::~SwPostItMgr()
 for (auto const& page : mPages)
 delete page;
 mPages.clear();
-
-delete mpFrameSidebarWinContainer;
-mpFrameSidebarWinContainer = nullptr;
 }
 
 void SwPostItMgr::CheckForRemovedPostIts()
@@ -2313,7 +2310,7 @@ void SwPostItMgr::ConnectSidebarWinToFrame( const 
SwFrame& rFrame,
 {
 if ( mpFrameSidebarWinContainer == nullptr )
 {
-mpFrameSidebarWinContainer = new SwFrameSidebarWinContainer();
+mpFrameSidebarWinContainer.reset(new SwFrameSidebarWinContainer());
 }
 
 const bool bInserted = mpFrameSidebarWinContainer->insert( rFrame, 
rFormatField, rSidebarWin );
commit a9f6478561a65b97f28de2ee3a428a3f99e87f16
Author: Noel Grandin 
Date:   Thu Nov 16 10:47:00 2017 +0200

loplugin:useuniqueptr in SwTransferable

Change-Id: I803eef7270f8f1a13b253d5ac9ba4d7e41b5adef
Reviewed-on: https://gerrit.libreoffice.org/44821
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index 0c5493e41331..00c42f143d4b 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -265,12 +265,6 @@ SwTransferable::~SwTransferable()
 pMod->m_pXSelection = nullptr;
 }
 
-delete m_pClpGraphic;
-delete m_pClpBitmap;
-delete m_pImageMap;
-delete m_pTargetURL;
-delete m_pBookmark;
-
 m_eBufferType = TransferBufferType::NONE;
 }
 
@@ -418,19 +412,19 @@ bool SwTransferable::GetData( const DataFlavor& rFlavor, 
const OUString& rDestDo
 // SEL_GRF is from ContentType of editsh
 if(bPending || ((SelectionType::Graphic | SelectionType::DbForm) & 
nSelectionType))
 {
-m_pClpGraphic = new Graphic;
+m_pClpGraphic.reset(new Graphic);
 if( !m_pWrtShell->GetDrawObjGraphic( 
SotClipboardFormatId::GDIMETAFILE, *m_pClpGraphic ))
-m_pOrigGraphic = m_pClpGraphic;
-m_pClpBitmap = new Graphic;
+m_pOrigGraphic = m_pClpGraphic.get();
+m_pClpBitmap.reset(new Graphic);
 if( !m_pWrtShell->GetDrawObjGraphic( SotClipboardFormatId::BITMAP, 
*m_pClpBitmap ))
-m_pOrigGraphic = m_pClpBitmap;
+m_pOrigGraphic = m_pClpBitmap.get();
 
 // is it an URL-Button ?
 OUString sURL;
 OUString sDesc;
 if( m_pWrtShell->GetURLFromButton( sURL, sDesc ) )
 {
-m_pBookmark = new INetBookmark( sURL, sDesc );
+m_pBookmark.reset(new INetBookmark( sURL, sDesc ));
 m_eBufferType = TransferBufferType::InetField;
 }
 }
@@ -458,9 +452,9 @@ bool SwTransferable::GetData( const DataFlavor& rFlavor, 
const OUString& rDestDo
 
!m_pWrtShell->GetView().GetDocShell()->IsReadOnly();
 if( m_pWrtShell->GetContentAtPos( aPos, aContentAtPos, bSelect ) )
 {
-m_pBookmark = new INetBookmark(
+m_pBookmark.reset(new INetBookmark(
 static_cast(aContentAtPos.aFnd.pAttr)->GetValue(),
-aContentAtPos.sStr );
+aContentAtPos.sStr 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2017-09-26 Thread Ashod Nakashian
 sw/inc/editsh.hxx  |4 +++
 sw/source/core/crsr/pam.cxx|   28 ++
 sw/source/core/edit/edfcol.cxx |   44 -
 3 files changed, 42 insertions(+), 34 deletions(-)

New commits:
commit 3823697d99b28592d8923e099b6aab577d5cd339
Author: Ashod Nakashian 
Date:   Sun Sep 24 21:51:13 2017 -0400

TSCP: refactor paragraph metadata field check

This moves the logic into SwEditShell next to
the exiting paragraph metadata infrastructure.

Change-Id: I6c12bfca3d2e1b2bc8697f03f4de1b7c3e14b95a
Reviewed-on: https://gerrit.libreoffice.org/42742
Tested-by: Jenkins 
Reviewed-by: Ashod Nakashian 

diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 50c5bf75e44e..7a8164c9ef70 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -380,6 +380,10 @@ public:
 /// Validate paragraph signatures, if any, at the cursor.
 void ValidateParagraphSignatures(bool updateDontRemove);
 
+/// Returns true iff the cursor is within a paragraph metadata field.
+/// Currently there are two variants: signature and classification.
+bool IsCursorInParagraphMetadataField() const;
+
 void Insert2(SwField const &, const bool bForceExpandHints);
 
 void UpdateFields( SwField & );   ///< One single field.
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index dc7314e4896e..2afae847e64b 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -43,9 +43,7 @@
 #include 
 #include 
 
-#include 
-#include 
-#include 
+#include 
 
 // for the dump "MSC-" compiler
 inline sal_Int32 GetSttOrEnd( bool bCondition, const SwContentNode& rNd )
@@ -715,30 +713,10 @@ bool SwPaM::HasReadonlySel( bool bFormView ) const
 bRet = !( pA == pB && pA != nullptr );
 }
 
-// Paragraph Signatures are read-only.
 if (!bRet)
 {
-SwTextNode* pNode = Start()->nNode.GetNode().GetTextNode();
-if (pNode != nullptr)
-{
-SwTextAttr* pAttr = 
pNode->GetTextAttrAt(Start()->nContent.GetIndex(), RES_TXTATR_METAFIELD);
-SwTextMeta* pTextMeta = static_txtattr_cast(pAttr);
-if (pTextMeta)
-{
-SwFormatMeta& 
rFormatMeta(static_cast(pTextMeta->GetAttr()));
-if (::sw::Meta* pMeta = rFormatMeta.GetMeta())
-{
-if (const SwDocShell* pDocSh = pDoc->GetDocShell())
-{
-static const OUString metaNS("urn:bails");
-const css::uno::Reference 
xSubject(pMeta->MakeUnoObject(), uno::UNO_QUERY);
-uno::Reference xModel = 
pDocSh->GetBaseModel();
-const std::map aStatements = 
SwRDFHelper::getStatements(xModel, metaNS, xSubject);
-bRet = (aStatements.find("loext:paragraph:signature") 
!= aStatements.end());
-}
-}
-}
-}
+// Paragraph Signatures and Classification fields are read-only.
+bRet = pDoc->GetEditShell()->IsCursorInParagraphMetadataField();
 }
 
 return bRet;
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 134682671242..d696fe02eaa3 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -79,6 +79,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1155,6 +1156,32 @@ void SwEditShell::ValidateParagraphSignatures(bool 
updateDontRemove)
 }
 }
 
+bool SwEditShell::IsCursorInParagraphMetadataField() const
+{
+SwTextNode* pNode = GetCursor()->Start()->nNode.GetNode().GetTextNode();
+if (pNode != nullptr)
+{
+SwTextAttr* pAttr = 
pNode->GetTextAttrAt(GetCursor()->Start()->nContent.GetIndex(), 
RES_TXTATR_METAFIELD);
+SwTextMeta* pTextMeta = static_txtattr_cast(pAttr);
+if (pTextMeta != nullptr)
+{
+SwFormatMeta& 
rFormatMeta(static_cast(pTextMeta->GetAttr()));
+if (::sw::Meta* pMeta = rFormatMeta.GetMeta())
+{
+if (const SwDocShell* pDocSh = GetDoc()->GetDocShell())
+{
+const css::uno::Reference 
xSubject(pMeta->MakeUnoObject(), uno::UNO_QUERY);
+uno::Reference xModel = 
pDocSh->GetBaseModel();
+const std::map aStatements = 
SwRDFHelper::getStatements(xModel, MetaNS, xSubject);
+return (aStatements.find(ParagraphSignatureRDFName) != 
aStatements.end());
+}
+}
+}
+}
+
+return false;
+}
+
 // #i62675#
 void SwEditShell::SetTextFormatColl(SwTextFormatColl *pFormat,
 const bool bResetListAttrs)
commit 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2017-09-26 Thread Ashod Nakashian
 sw/inc/editsh.hxx |2 +-
 sw/source/core/crsr/pam.cxx   |2 +-
 sw/source/core/edit/edfcol.cxx|   36 +++-
 sw/source/uibase/app/docsh2.cxx   |2 +-
 sw/source/uibase/fldui/fldmgr.cxx |2 +-
 5 files changed, 19 insertions(+), 25 deletions(-)

New commits:
commit ebc378519cc66b2d55ae421fd362456e9b041766
Author: Ashod Nakashian 
Date:   Sun Sep 24 21:05:34 2017 -0400

TSCP: cleanup constant strings

Change-Id: I5c307db7ef1c5980c9ae7706ae95970b5705ab58
Reviewed-on: https://gerrit.libreoffice.org/42740
Tested-by: Jenkins 
Reviewed-by: Ashod Nakashian 

diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 488572415a2b..dc7314e4896e 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -734,7 +734,7 @@ bool SwPaM::HasReadonlySel( bool bFormView ) const
 const css::uno::Reference 
xSubject(pMeta->MakeUnoObject(), uno::UNO_QUERY);
 uno::Reference xModel = 
pDocSh->GetBaseModel();
 const std::map aStatements = 
SwRDFHelper::getStatements(xModel, metaNS, xSubject);
-bRet = (aStatements.find("loext:signature:signature") 
!= aStatements.end());
+bRet = (aStatements.find("loext:paragraph:signature") 
!= aStatements.end());
 }
 }
 }
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 9b96fd2bd7c6..9ab83df7e36f 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -87,6 +87,10 @@
 
 namespace
 {
+static const OUString MetaFilename("bails.rdf");
+static const OUString MetaNS("urn:bails");
+static const OUString ParagraphSignatureRDFName = "loext:paragraph:signature";
+static const OUString MetadataFieldServiceName = 
"com.sun.star.text.textfield.MetadataField";
 
 /// Find all page styles which are currently used in the document.
 std::vector lcl_getUsedPageStyles(SwViewShell const * pShell)
@@ -226,14 +230,12 @@ lcl_MakeParagraphSignatureFieldText(const 
uno::Reference& xModel,
 const 
uno::Reference& xField,
 const OString& utf8Text)
 {
-static const OUString metaNS("urn:bails");
-
 OUString msg = SwResId(STR_INVALID_SIGNATURE);
 bool valid = false;
 
 const css::uno::Reference xSubject(xField, 
uno::UNO_QUERY);
-std::map aStatements = 
SwRDFHelper::getStatements(xModel, metaNS, xSubject);
-const auto it = aStatements.find("loext:signature:signature");
+std::map aStatements = 
SwRDFHelper::getStatements(xModel, MetaNS, xSubject);
+const auto it = aStatements.find(ParagraphSignatureRDFName);
 if (it != aStatements.end())
 {
 const sal_Char* pData = utf8Text.getStr();
@@ -263,13 +265,8 @@ uno::Reference 
lcl_InsertParagraphSignature(const uno::Referen
   const 
uno::Reference& xParent,
   const OUString& 
signature)
 {
-static const OUString MetaFilename("bails.rdf");
-static const OUString MetaNS("urn:bails");
-static const OUString RDFName = "loext:signature:signature";
-static const OUString ServiceName = 
"com.sun.star.text.textfield.MetadataField";
-
 uno::Reference xMultiServiceFactory(xModel, 
uno::UNO_QUERY);
-auto xField = 
uno::Reference(xMultiServiceFactory->createInstance(ServiceName),
 uno::UNO_QUERY);
+auto xField = 
uno::Reference(xMultiServiceFactory->createInstance(MetadataFieldServiceName),
 uno::UNO_QUERY);
 
 // Add the signature at the end.
 // uno::Reference xContent(xField, uno::UNO_QUERY);
@@ -277,7 +274,7 @@ uno::Reference 
lcl_InsertParagraphSignature(const uno::Referen
 xField->attach(xParent->getAnchor()->getEnd());
 
 const css::uno::Reference xSubject(xField, 
uno::UNO_QUERY);
-SwRDFHelper::addStatement(xModel, MetaNS, MetaFilename, xSubject, RDFName, 
signature);
+SwRDFHelper::addStatement(xModel, MetaNS, MetaFilename, xSubject, 
ParagraphSignatureRDFName, signature);
 
 return xField;
 }
@@ -307,7 +304,7 @@ bool lcl_UpdateParagraphSignatureField(SwDoc* pDoc,
 return false;
 }
 
-void lcl_RemoveParagraphSignatureField(const 
uno::Reference& xField)
+void lcl_RemoveParagraphMetadataField(const 
uno::Reference& xField)
 {
 uno::Reference xFieldTextContent(xField, 
uno::UNO_QUERY);
 uno::Reference 
xParagraph(xFieldTextContent->getAnchor());
@@ -969,11 +966,10 @@ SwUndoParagraphSigning::SwUndoParagraphSigning(const 
SwPosition& rPos,
 m_bRemove(bRemove)
 {
 // Save the metadata and field content to undo/redo.
-static const OUString metaNS("urn:bails");
 uno::Reference xModel = 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2017-08-25 Thread Michael Stahl
 sw/inc/IDocumentRedlineAccess.hxx |   12 ++--
 sw/source/core/doc/DocumentRedlineManager.cxx |   17 -
 sw/source/core/doc/doccomp.cxx|9 ++---
 sw/source/core/inc/DocumentRedlineManager.hxx |2 +-
 sw/source/core/undo/undobj.cxx|6 +++---
 sw/source/core/unocore/unocrsrhelper.cxx  |4 ++--
 6 files changed, 34 insertions(+), 16 deletions(-)

New commits:
commit 9cabd72ef14e19897f4d6f078758ac8b1aa6c02f
Author: Michael Stahl 
Date:   Fri Aug 25 22:55:22 2017 +0200

tdf#109267 sw: fix confusing return value of AppendRedline()

AppendRedline() has a boolen return value which is rather
unclear and confusing: most callers don't even check it, but
SaveMergeRedline::InsertRedline() expects "true" to mean that
its redline hasn't been deleted, whereas makeRedline()
expects "true" to mean that the redline was somehow "valid",
even if it has been deleted and merged with an existing one.

The "bMerged" variable in AppendRedline(), which is the source
of the confusion, was introduced with commit
81286906d0b76a3b6c4443378877828290c3e5f0 "docx import fixes
for: redlines".

Split these differing expectations into different return
values of a new enum type.

Change-Id: If81631bde49ee52a249f5ba1dd64ab8e92fffaf7

diff --git a/sw/inc/IDocumentRedlineAccess.hxx 
b/sw/inc/IDocumentRedlineAccess.hxx
index ac5d017eda4c..3f42f32d98ea 100644
--- a/sw/inc/IDocumentRedlineAccess.hxx
+++ b/sw/inc/IDocumentRedlineAccess.hxx
@@ -159,15 +159,23 @@ public:
 
 virtual bool IsInRedlines(const SwNode& rNode) const = 0;
 
+enum class AppendResult { IGNORED, MERGED, APPENDED };
 /** Append a new redline
 
-@param pPtr
+@param pNewRedl redline to insert
 
 @param bCallDelete
+if set, then for a new DELETE redline that is inserted so that it
+overlaps an existing INSERT redline with the same author, the
+overlapping range is deleted, i.e. the new DELETE removes
+existing INSERT for that range
 
 @returns
+APPENDED if pNewRedl is still alive and was appended
+MERGED if pNewRedl was deleted but has been merged with existing 
one
+IGNORED if pNewRedl was deleted and ignored/invalid
 */
-virtual bool AppendRedline(/*[in]*/SwRangeRedline* pPtr, /*[in]*/bool 
bCallDelete) = 0;
+virtual AppendResult AppendRedline(/*[in]*/SwRangeRedline* pNewRedl, 
/*[in]*/bool bCallDelete) = 0;
 
 virtual bool AppendTableRowRedline(/*[in]*/SwTableRowRedline* pPtr, 
/*[in]*/bool bCallDelete) = 0;
 virtual bool AppendTableCellRedline(/*[in]*/SwTableCellRedline* pPtr, 
/*[in]*/bool bCallDelete) = 0;
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index 1a62a0b04c64..1d9a24be3153 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -1,4 +1,3 @@
-
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
  * This file is part of the LibreOffice project.
@@ -730,7 +729,8 @@ Behaviour of Delete-Redline:
   other Insert is overlapped by
   the Delete
 */
-bool DocumentRedlineManager::AppendRedline( SwRangeRedline* pNewRedl, bool 
bCallDelete )
+IDocumentRedlineAccess::AppendResult
+DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const 
bCallDelete)
 {
 bool bMerged = false;
 CHECK_REDLINE( *this )
@@ -792,7 +792,7 @@ bool DocumentRedlineManager::AppendRedline( SwRangeRedline* 
pNewRedl, bool bCall
 ( pNewRedl->GetContentIdx() == nullptr ) )
 {   // Do not insert empty redlines
 delete pNewRedl;
-return false;
+return AppendResult::IGNORED;
 }
 bool bCompress = false;
 SwRedlineTable::size_type n = 0;
@@ -1706,7 +1706,9 @@ bool DocumentRedlineManager::AppendRedline( 
SwRangeRedline* pNewRedl, bool bCall
 }
 CHECK_REDLINE( *this )
 
-return ( nullptr != pNewRedl ) || bMerged;
+return (nullptr != pNewRedl)
+? AppendResult::APPENDED
+: ((bMerged) ? AppendResult::MERGED : AppendResult::IGNORED);
 }
 
 bool DocumentRedlineManager::AppendTableRowRedline( SwTableRowRedline* 
pNewRedl, bool )
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 6dc6fb18db2d..1acbe7a9f306 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1751,7 +1751,9 @@ void CompareData::SetRedlinesToDoc( bool bUseDocInfo )
 }
 
 do {
-if( rDoc.getIDocumentRedlineAccess().AppendRedline( new 
SwRangeRedline( aRedlnData, *pTmp ), true) &&
+if (IDocumentRedlineAccess::AppendResult::APPENDED ==
+

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2017-07-23 Thread Caolán McNamara
 sw/inc/strings.hrc  |6 +++---
 sw/source/core/doc/DocumentStylePoolManager.cxx |   16 +++-
 2 files changed, 10 insertions(+), 12 deletions(-)

New commits:
commit f7c4e8cbf840193acb7c188163f51c8a3a14e083
Author: Caolán McNamara 
Date:   Sun Jul 23 19:55:54 2017 +0100

coverity#1415614 Out-of-bounds read

Change-Id: I73d18dd6613be063002878fb4906a49863707856

diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx 
b/sw/source/core/doc/DocumentStylePoolManager.cxx
index d94d336d44a1..68675402 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -1380,18 +1380,16 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( 
sal_uInt16 nId )
 pDeriveFormat = m_rDoc.GetDfltCharFormat();
 pWhichRange = aCharFormatSetRange;
 
-// Fault: unknown Format, but a CharFormat
-// -> return the first one
-if( RES_POOLCHR_BEGIN > nId || nId >= RES_POOLCHR_END )
+if (nId >= RES_POOLCHR_HTML_BEGIN && nId < RES_POOLCHR_HTML_END)
+pRCId = STR_POOLCHR_HTML_ARY[nId - RES_POOLCHR_HTML_BEGIN];
+else if (nId >= RES_POOLCHR_NORMAL_BEGIN && nId < 
RES_POOLCHR_NORMAL_END)
+pRCId = STR_POOLCHR_ARY[nId - RES_POOLCHR_BEGIN];
+else
 {
+// Fault: unknown Format, but a CharFormat -> return the first 
one
 OSL_ENSURE( false, "invalid Id" );
-nId = RES_POOLCHR_BEGIN;
+pRCId = STR_POOLCHR_ARY[0];
 }
-
-if (nId > RES_POOLCHR_NORMAL_END)
-pRCId = STR_POOLCHR_HTML_ARY[nId - RES_POOLCHR_HTML_BEGIN];
-else
-pRCId = STR_POOLCHR_ARY[nId - RES_POOLCHR_BEGIN];
 }
 break;
 case POOLGRP_FRAMEFMT:
commit 1d663165fc35ce41610e9a73e168ac2adc0153e2
Author: Caolán McNamara 
Date:   Sun Jul 23 19:48:30 2017 +0100

more related strings together

Change-Id: I0055000d1c92096c320ad52d553a7bdc19fcc025

diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index cfa4496e96c6..2ecbf8eeb119 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -34,11 +34,12 @@
 #define STR_POOLCHR_JUMPEDITNC_("STR_POOLCHR_JUMPEDIT", 
"Placeholder")
 #define STR_POOLCHR_TOXJUMP NC_("STR_POOLCHR_TOXJUMP", 
"Index Link")
 #define STR_POOLCHR_ENDNOTE NC_("STR_POOLCHR_ENDNOTE", 
"Endnote Characters")
-#define STR_POOLPAGE_LANDSCAPE  NC_("STR_POOLPAGE_LANDSCAPE", 
"Landscape")
 #define STR_POOLCHR_LINENUM NC_("STR_POOLCHR_LINENUM", 
"Line Numbering")
 #define STR_POOLCHR_IDX_MAIN_ENTRY  
NC_("STR_POOLCHR_IDX_MAIN_ENTRY", "Main Index Entry")
 #define STR_POOLCHR_FOOTNOTE_ANCHOR 
NC_("STR_POOLCHR_FOOTNOTE_ANCHOR", "Footnote Anchor")
 #define STR_POOLCHR_ENDNOTE_ANCHOR  
NC_("STR_POOLCHR_ENDNOTE_ANCHOR", "Endnote Anchor")
+#define STR_POOLCHR_RUBYTEXTNC_("STR_POOLCHR_RUBYTEXT", 
"Rubies")
+#define STR_POOLCHR_VERT_NUMNC_("STR_POOLCHR_VERT_NUM", 
"Vertical Numbering Symbols")
 // Drawing templates for HTML
 #define STR_POOLCHR_HTML_EMPHASIS   
NC_("STR_POOLCHR_HTML_EMPHASIS", "Emphasis")
 #define STR_POOLCHR_HTML_CITIATION  
NC_("STR_POOLCHR_HTML_CITIATION", "Quotation")
@@ -193,6 +194,7 @@
 #define STR_POOLPAGE_HTML   NC_("STR_POOLPAGE_HTML", 
"HTML")
 #define STR_POOLPAGE_FOOTNOTE   NC_("STR_POOLPAGE_FOOTNOTE", 
"Footnote")
 #define STR_POOLPAGE_ENDNOTENC_("STR_POOLPAGE_ENDNOTE", 
"Endnote")
+#define STR_POOLPAGE_LANDSCAPE  NC_("STR_POOLPAGE_LANDSCAPE", 
"Landscape")
 // Numbering rules
 #define STR_POOLNUMRULE_NUM1NC_("STR_POOLNUMRULE_NUM1", 
"Numbering 1")
 #define STR_POOLNUMRULE_NUM2NC_("STR_POOLNUMRULE_NUM2", 
"Numbering 2")
@@ -204,13 +206,11 @@
 #define STR_POOLNUMRULE_BUL3NC_("STR_POOLNUMRULE_BUL3", 
"List 3")
 #define STR_POOLNUMRULE_BUL4NC_("STR_POOLNUMRULE_BUL4", 
"List 4")
 #define STR_POOLNUMRULE_BUL5NC_("STR_POOLNUMRULE_BUL5", 
"List 5")
-#define STR_POOLCHR_RUBYTEXTNC_("STR_POOLCHR_RUBYTEXT", 
"Rubies")
 #define STR_COLUMN_VALUESET_ITEM0   
NC_("STR_COLUMN_VALUESET_ITEM0", "1 column")
 #define STR_COLUMN_VALUESET_ITEM1   
NC_("STR_COLUMN_VALUESET_ITEM1", "2 columns with equal size")
 #define STR_COLUMN_VALUESET_ITEM2   
NC_("STR_COLUMN_VALUESET_ITEM2", "3 columns with equal size")
 #define STR_COLUMN_VALUESET_ITEM3   
NC_("STR_COLUMN_VALUESET_ITEM3", "2 columns with different size (left > right)")
 #define STR_COLUMN_VALUESET_ITEM4   

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source xmloff/source

2017-07-21 Thread Michael Stahl
 sw/inc/frmfmt.hxx   |1 +
 sw/source/core/undo/undobj1.cxx |   18 ++
 xmloff/source/core/xmlimp.cxx   |2 +-
 3 files changed, 20 insertions(+), 1 deletion(-)

New commits:
commit 2e486daff35ab16e810bfdafb24b19bcbf2fe8cd
Author: Michael Stahl 
Date:   Fri Jul 21 12:01:01 2017 +0200

tdf#108867 sw: fix dangling text box frame format pointers in Undo

If the text box is removed, the SwFrameFormat of the drawing shape still
retains a pointer to the frame SwFrameFormat, and the latter is owned by
the SwUndoFlyBase.  This is pretty bad, so try to clear & reset the
connection between them in SwUndoFlyBase::InsFly() and DelFly().

Hopefully nothing will actually delete the drawing shape SwFrameFormat
while the Undo object is alive.

Note that when the SwUndoInsLayFormat is created when the text box is
added, the GetOtherTextBoxFormat() returns null as it's set later,
that's why the constructor can't do anything.

Change-Id: Iae562b6f8f272e47b2b5cf8ee80778db15d29ce0

diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index 2dd3c81a52f8..6c2de6c35e20 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -61,6 +61,7 @@ class SW_DLLPUBLIC SwFrameFormat: public SwFormat
 friend class ::sw::DocumentLayoutManager; ///< Is allowed to call 
protected CTor.
 friend class SwFrameFormats; ///< Is allowed to update the list 
backref.
 friend class SwTextBoxHelper;
+friend class SwUndoFlyBase; ///< calls SetOtherTextBoxFormat
 
 css::uno::WeakReference m_wXObject;
 
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index d35f7730cf9e..8011e77dd031 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -52,7 +52,13 @@ SwUndoFlyBase::SwUndoFlyBase( SwFrameFormat* pFormat, 
SwUndoId nUndoId )
 SwUndoFlyBase::~SwUndoFlyBase()
 {
 if( bDelFormat )   // delete during an Undo?
+{
+if (pFrameFormat->GetOtherTextBoxFormat())
+{   // clear that before delete
+pFrameFormat->SetOtherTextBoxFormat(nullptr);
+}
 delete pFrameFormat;
+}
 }
 
 void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool 
bShowSelFrame)
@@ -107,6 +113,13 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & 
rContext, bool bShowSelFrame)
 pCNd->GetTextNode()->InsertItem(aFormat, nCntPos, nCntPos, 
SetAttrMode::NOHINTEXPAND);
 }
 
+if (pFrameFormat->GetOtherTextBoxFormat())
+{
+// recklessly assume that this thing will live longer than the
+// SwUndoFlyBase - not sure what could be done if that isn't the 
case...
+
pFrameFormat->GetOtherTextBoxFormat()->SetOtherTextBoxFormat(pFrameFormat);
+}
+
 pFrameFormat->MakeFrames();
 
 if( bShowSelFrame )
@@ -146,6 +159,11 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
 bDelFormat = true; // delete Format in DTOR
 pFrameFormat->DelFrames(); // destroy Frames
 
+if (pFrameFormat->GetOtherTextBoxFormat())
+{   // tdf#108867 clear that pointer
+pFrameFormat->GetOtherTextBoxFormat()->SetOtherTextBoxFormat(nullptr);
+}
+
 // all Uno objects should now log themselves off
 {
 SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFrameFormat );
commit d7ba631598061f68c1f0dca54b6e227b82d7c73a
Author: Michael Stahl 
Date:   Thu Jul 20 11:01:31 2017 +0200

xmloff: don't warn on future LO versions, SAL_INFO is enough

Change-Id: I43d28a0957556900102cf87f024174d5c451a01d

diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 464d397d29b6..891c116098c0 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -185,7 +185,7 @@ public:
 }
 else
 {
-SAL_WARN("xmloff.core", "unknown LO version: " << 
loVersion);
+SAL_INFO("xmloff.core", "unknown LO version: " << 
loVersion);
 }
 return; // ignore buildIds
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2017-07-21 Thread Caolán McNamara
 sw/inc/cnttab.hrc  |   22 -
 sw/source/core/undo/undobj.cxx |  558 +
 sw/source/ui/index/cnttab.cxx  |2 
 3 files changed, 405 insertions(+), 177 deletions(-)

New commits:
commit 6145d95bb85aa9c12915551a31a2e21a283f56f4
Author: Caolán McNamara 
Date:   Fri Jul 21 10:13:13 2017 +0100

make sure the strings for each undo match

Change-Id: I6d380dde0214b41535e99798c24b19fe21e30772

diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 26463a387ddf..c3e33da510e8 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -264,170 +264,404 @@ void SwUndo::RepeatImpl( ::sw::RepeatContext & )
 
 OUString GetUndoComment(SwUndoId eId)
 {
-// Undo
-const char* STR_UNDO_ARY[] =
+const char *pId = nullptr;
+switch (eId)
 {
-STR_CANT_UNDO,
-STR_DELETE_UNDO,
-STR_INSERT_UNDO,
-STR_OVR_UNDO,
-STR_SPLITNODE_UNDO,
-STR_MOVE_UNDO,
-STR_INSATTR_UNDO,
-STR_SETFMTCOLL_UNDO,
-STR_RESET_ATTR_UNDO,
-STR_INSFMT_ATTR_UNDO,
-STR_INSERT_DOC_UNDO,
-STR_INSERT_GLOSSARY,
-STR_DELBOOKMARK,
-STR_INSBOOKMARK,
-STR_SORT_TBL,
-STR_SORT_TXT,
-STR_INSTABLE_UNDO,
-STR_TEXTTOTABLE_UNDO,
-STR_TABLETOTEXT_UNDO,
-STR_COPY_UNDO,
-STR_REPLACE_UNDO,
-STR_INSERT_PAGE_BREAK_UNDO,
-STR_INSERT_COLUMN_BREAK_UNDO,
-STR_PLAY_MACRO_UNDO,
-STR_INSERT_ENV_UNDO,
-STR_DRAG_AND_COPY,
-STR_DRAG_AND_MOVE,
-STR_INSERT_CHART,
-STR_INSERTFLY,
-STR_DELETEFLY,
-STR_AUTOFORMAT,
-STR_TABLEHEADLINE,
-STR_REPLACE,
-STR_INSERTSECTION,
-STR_DELETESECTION,
-STR_CHANGESECTION,
-STR_CHANGESECTPASSWD,
-STR_CHANGEDEFATTR,
-STR_REPLACE_STYLE,
-STR_DELETE_PAGE_BREAK,
-STR_TEXT_CORRECTION,
-STR_OUTLINE_LR,
-STR_OUTLINE_UD,
-STR_INSNUM,
-STR_NUMUP,
-STR_NUMDOWN,
-STR_MOVENUM,
-STR_INSERTDRAW,
-STR_NUMORNONUM,
-STR_INC_LEFTMARGIN,
-STR_DEC_LEFTMARGIN,
-STR_INSERTLABEL,
-STR_SETNUMRULESTART,
-STR_CHANGEFTN,
-nullptr, /* !! sollte NIE gebraucht/uebersetzt werden !! */
-STR_ACCEPT_REDLINE,
-STR_REJECT_REDLINE,
-STR_SPLIT_TABLE,
-STR_DONTEXPAND,
-STR_AUTOCORRECT,
-STR_MERGE_TABLE,
-STR_TRANSLITERATE,
-STR_DELNUM,
-STR_DRAWUNDO,
-STR_DRAWGROUP,
-STR_DRAWUNGROUP,
-STR_DRAWDELETE,
-STR_REREAD,
-STR_DELGRF,
-STR_DELOLE,
-STR_TABLE_ATTR,
-STR_UNDO_TABLE_AUTOFMT,
-STR_UNDO_TABLE_INSCOL,
-STR_UNDO_TABLE_INSROW,
-STR_UNDO_TABLE_DELBOX,
-STR_UNDO_COL_DELETE,
-STR_UNDO_ROW_DELETE,
-STR_UNDO_TABLE_SPLIT,
-STR_UNDO_TABLE_MERGE,
-STR_TABLE_NUMFORMAT,
-STR_INSERT_TOX,
-STR_CLEAR_TOX_RANGE,
-STR_TABLE_TBLCPYTBL,
-STR_TABLE_CPYTBL,
-STR_INS_FROM_SHADOWCRSR,
-STR_UNDO_CHAIN,
-STR_UNDO_UNCHAIN,
-STR_UNDO_FTNINFO,
-STR_UNDO_ENDNOTEINFO,
-STR_UNDO_COMPAREDOC,
-STR_UNDO_SETFLYFRMFMT,
-STR_UNDO_SETRUBYATTR,
-STR_UNDO_TMPAUTOCORR,
-STR_INSERT_FOOTNOTE,
-STR_INSERT_URLBTN,
-STR_INSERT_URLTXT,
-STR_DELETE_INVISIBLECNTNT,
-STR_TOXCHANGE,
-STR_START_QUOTE,
-STR_END_QUOTE,
-STR_LDOTS,
-STR_MULTISEL,
-STR_TYPING_UNDO,
-STR_PASTE_CLIPBOARD_UNDO,
-STR_YIELDS,
-STR_OCCURRENCES_OF,
-STR_UNDO_TABS,
-STR_UNDO_NLS,
-STR_UNDO_PAGEBREAKS,
-STR_UNDO_COLBRKS,
-STR_UNDO_REDLINE_INSERT,
-STR_UNDO_REDLINE_DELETE,
-STR_UNDO_REDLINE_FORMAT,
-STR_UNDO_REDLINE_TABLE,
-STR_UNDO_REDLINE_FMTCOLL,
-STR_N_REDLINES,
-STR_UNDO_PAGEDESC,
-STR_UNDO_PAGEDESC_CREATE,
-STR_UNDO_PAGEDESC_DELETE,
-STR_UNDO_PAGEDESC_RENAME,
-STR_UNDO_HEADER_FOOTER,
-STR_UNDO_FIELD,
-STR_UNDO_TXTFMTCOL_CREATE,
-STR_UNDO_TXTFMTCOL_DELETE,
-STR_UNDO_TXTFMTCOL_RENAME,
-STR_UNDO_CHARFMT_CREATE,
-STR_UNDO_CHARFMT_DELETE,
-STR_UNDO_CHARFMT_RENAME,
-STR_UNDO_FRMFMT_CREATE,
-STR_UNDO_FRMFMT_DELETE,
-STR_UNDO_FRMFMT_RENAME,
-STR_UNDO_NUMRULE_CREATE,
-STR_UNDO_NUMRULE_DELETE,
-STR_UNDO_NUMRULE_RENAME,
-STR_UNDO_BOOKMARK_RENAME,
-STR_UNDO_INDEX_ENTRY_INSERT,
-STR_UNDO_INDEX_ENTRY_DELETE,
-STR_FIELD,
-STR_PARAGRAPHS,
-STR_FRAME,
-STR_OLE,
-STR_MATH_FORMULA,
-STR_CHART,
-STR_NOTE,
-

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2017-04-19 Thread Michael Stahl
 sw/inc/crsrsh.hxx|7 --
 sw/source/core/crsr/crsrsh.cxx   |   95 ---
 sw/source/uibase/dochdl/swdtflvr.cxx |2 
 sw/source/uibase/uiview/view.cxx |4 -
 sw/source/uibase/wrtsh/wrtsh1.cxx|7 +-
 5 files changed, 42 insertions(+), 73 deletions(-)

New commits:
commit 31aac86f14d088628979c7809588f14bef643feb
Author: Michael Stahl 
Date:   Wed Apr 19 12:35:30 2017 +0200

sw: replace rudimentary SwCursorShell::m_nBasicActionCnt

The functions to modify the counter were removed in 2004-2006 and there
is no evidence in the git repo of these functions ever being called, so
the BasicActionPend() condition is effectively equivalent to
ActionPend().

Change-Id: Ic8b9c8c6039c318943c96e90f2370cb5a1046ff9

diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 122cda1406a8..7c5a8dff88dc 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -203,7 +203,6 @@ private:
  * (via Find()) can be realised.
  */
 sal_uInt16 m_nCursorMove;
-sal_uInt16 m_nBasicActionCnt; ///< Actions which are parenthesized by 
Basic
 CursorMoveState m_eMvState; ///< Status for Cursor-Travelling - 
GetCursorOfst
 
 OUString m_sMarkedListId;
@@ -747,8 +746,6 @@ public:
 // is the whole document protected/hidden (for UI...)
 bool IsAllProtect() const { return m_bAllProtect; }
 
-bool BasicActionPend() const{ return m_nBasicActionCnt != 
mnStartAction; }
-
 bool GotoRegion( const OUString& rName );
 
 // show the current selection
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index eca8374a9cda..e22be8f4a772 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -264,29 +264,6 @@ void SwCursorShell::EndAction( const bool bIdleEnd, const 
bool DoSetPosX )
 if( bVis )// display SV-Cursor again
 m_pVisibleCursor->Show();
 
-// If there is still a ChgCall and just the "basic
-// parenthising(?)" exists, call it. This
-// decouples the internal with the Basic-parenthising, the
-// Shells are switched.
-if( !BasicActionPend() )
-{
-// Within a Basic action, one needs to update the cursor,
-// to e.g. create the table cursor. This is being done in
-// UpdateCursor.
-UpdateCursor( eFlags, bIdleEnd );
-
-{
-// watch Cursor-Moves, call Link if needed, the DTOR is key 
here!
-SwCallLink aLk( *this, m_nAktNode, m_nAktContent, m_nAktNdTyp,
-m_nLeftFramePos, m_bAktSelection );
-
-}
-if( m_bCallChgLnk && m_bChgCallFlag && m_aChgLnk.IsSet() )
-{
-m_aChgLnk.Call( this );
-m_bChgCallFlag = false; // reset flag
-}
-}
 return;
 }
 
@@ -1434,9 +1411,7 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool 
bIdleEnd )
 SET_CURR_SHELL( this );
 ClearUpCursors();
 
-// In a BasicAction the cursor must be updated, e.g. to create the
-// TableCursor. EndAction now calls UpdateCursor!
-if( ActionPend() && BasicActionPend() )
+if (ActionPend())
 {
 if ( eFlags & SwCursorShell::READONLY )
 m_bIgnoreReadonly = true;
@@ -2275,9 +2250,9 @@ bool SwCursorShell::HasSelection() const
 
 void SwCursorShell::CallChgLnk()
 {
-// Do not make any call in start/end action but just remember the change.
-// This will be taken care of in the end action.
-if( BasicActionPend() )
+// Do not make any call in StartAction/EndAction but just set the flag.
+// This will be handled in EndAction.
+if (ActionPend())
 m_bChgCallFlag = true; // remember change
 else if( m_aChgLnk.IsSet() )
 {
@@ -2662,7 +2637,6 @@ SwCursorShell::SwCursorShell( SwCursorShell& rShell, 
vcl::Window *pInitWin )
 , m_nAktNdTyp(SwNodeType::NONE)
 , m_bAktSelection(false)
 , m_nCursorMove( 0 )
-, m_nBasicActionCnt( 0 )
 , m_eMvState( MV_NONE )
 , m_sMarkedListId()
 , m_nMarkedListLevel( 0 )
@@ -2700,7 +2674,6 @@ SwCursorShell::SwCursorShell( SwDoc& rDoc, vcl::Window 
*pInitWin,
 , m_nAktNdTyp(SwNodeType::NONE)
 , m_bAktSelection(false)
 , m_nCursorMove( 0 )
-, m_nBasicActionCnt( 0 )
 , m_eMvState( MV_NONE ) // state for crsr-travelling - GetCursorOfst
 , m_sMarkedListId()
 , m_nMarkedListLevel( 0 )
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index 1562752f40a5..27171bf0e836 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -415,7 +415,7 @@ bool SwTransferable::GetData( const DataFlavor& rFlavor, 
const OUString& rDestDo
 // when pending we will not get the correct type, but 
SelectionType::Text
 // as fallback. This *happens* during D, so 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source sw/uiconfig sw/UIConfig_swriter.mk vcl/source

2017-04-18 Thread Caolán McNamara
 sw/UIConfig_swriter.mk |1 
 sw/inc/helpid.h|   11 -
 sw/source/uibase/docvw/docvw.hrc   |   26 ---
 sw/source/uibase/docvw/docvw.src   |  166 --
 sw/source/uibase/docvw/romenu.cxx  |  225 --
 sw/source/uibase/docvw/romenu.hxx  |   25 +++
 sw/uiconfig/swriter/ui/readonlymenu.ui |  247 +
 vcl/source/window/mouse.cxx|9 -
 8 files changed, 401 insertions(+), 309 deletions(-)

New commits:
commit 45d57a0dba8bb5a92150cc07bdff0b37b3041007
Author: Caolán McNamara 
Date:   Tue Apr 18 13:13:27 2017 +0100

convert readonly menu to .ui

Change-Id: Ia9400b3c4b410dbf70633e55286a4af77f0d651a

diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index d6e4dd787eb2..86fe9b7e503d 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -229,6 +229,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/printmonitordialog \
sw/uiconfig/swriter/ui/printoptionspage \
sw/uiconfig/swriter/ui/privateuserpage \
+   sw/uiconfig/swriter/ui/readonlymenu \
sw/uiconfig/swriter/ui/renameautotextdialog \
sw/uiconfig/swriter/ui/renameentrydialog \
sw/uiconfig/swriter/ui/renameobjectdialog \
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index 5bea9367c9df..0d18cd66e88d 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -88,17 +88,6 @@
 #define HID_MN_SUB_SPELLING 
"SW_HID_MN_SUB_SPELLING"
 #define HID_MN_SUB_MIRROR   
"SW_HID_MN_SUB_MIRROR"
 
-#define HID_MN_READONLY_SAVEGRAPHIC 
"SW_HID_MN_READONLY_SAVEGRAPHIC"
-#define HID_MN_READONLY_GRAPHICTOGALLERY
"SW_HID_MN_READONLY_GRAPHICTOGALLERY"
-#define HID_MN_READONLY_TOGALLERYLINK   
"SW_HID_MN_READONLY_TOGALLERYLINK"
-#define HID_MN_READONLY_TOGALLERYCOPY   
"SW_HID_MN_READONLY_TOGALLERYCOPY"
-#define HID_MN_READONLY_SAVEBACKGROUND  
"SW_HID_MN_READONLY_SAVEBACKGROUND"
-#define HID_MN_READONLY_BACKGROUNDTOGALLERY 
"SW_HID_MN_READONLY_BACKGROUNDTOGALLERY"
-#define HID_MN_READONLY_COPYLINK
"SW_HID_MN_READONLY_COPYLINK"
-#define HID_MN_READONLY_COPYGRAPHIC 
"SW_HID_MN_READONLY_COPYGRAPHIC"
-#define HID_MN_READONLY_LOADGRAPHIC 
"SW_HID_MN_READONLY_LOADGRAPHIC"
-#define HID_MN_READONLY_GRAPHICOFF  
"SW_HID_MN_READONLY_GRAPHICOFF"
-
 #define HID_LINGU_AUTOCORR  
"SW_HID_LINGU_AUTOCORR"
 #define HID_LINGU_REPLACE   
"SW_HID_LINGU_REPLACE"
 #define HID_SMARTTAG_MAIN   
"SW_HID_SMARTTAG_MAIN"// SMARTTAGS
diff --git a/sw/source/uibase/docvw/docvw.hrc b/sw/source/uibase/docvw/docvw.hrc
index ca60529fbe07..799efce72c69 100644
--- a/sw/source/uibase/docvw/docvw.hrc
+++ b/sw/source/uibase/docvw/docvw.hrc
@@ -22,32 +22,6 @@
 
 #include "rcid.hrc"
 
-#define MN_READONLY_POPUP   (RC_DOCVW_BEGIN + 1)
-#define MN_READONLY_OPENURL (RC_DOCVW_BEGIN + 2)
-#define MN_READONLY_OPENURLNEW  (RC_DOCVW_BEGIN + 3)
-#define MN_READONLY_EDITDOC (RC_DOCVW_BEGIN + 4)
-// free (5)
-#define MN_READONLY_BROWSE_BACKWARD (RC_DOCVW_BEGIN + 6)
-#define MN_READONLY_BROWSE_FORWARD  (RC_DOCVW_BEGIN + 7)
-#define MN_READONLY_SELECTION_MODE  (RC_DOCVW_BEGIN + 8)
-#define MN_READONLY_SAVEGRAPHIC (RC_DOCVW_BEGIN + 11)
-#define MN_READONLY_SAVEBACKGROUND  (RC_DOCVW_BEGIN + 12)
-#define MN_READONLY_COPYLINK(RC_DOCVW_BEGIN + 13)
-#define MN_READONLY_COPYGRAPHIC (RC_DOCVW_BEGIN + 14)
-#define MN_READONLY_LOADGRAPHIC (RC_DOCVW_BEGIN + 15)
-#define MN_READONLY_GRAPHICOFF  (RC_DOCVW_BEGIN + 16)
-// free (RC_DOCVW_BEGIN + 17)
-#define MN_READONLY_TOGALLERYLINK   (RC_DOCVW_BEGIN + 18)
-#define MN_READONLY_TOGALLERYCOPY   (RC_DOCVW_BEGIN + 19)
-#define MN_READONLY_SOURCEVIEW  (RC_DOCVW_BEGIN + 20)
-#define MN_READONLY_RELOAD_FRAME(RC_DOCVW_BEGIN + 21)
-#define MN_READONLY_RELOAD  (RC_DOCVW_BEGIN + 22)
-#define MN_READONLY_COPY(RC_DOCVW_BEGIN + 23)
-
-//For the following we need space for the gallery-themes
-#define MN_READONLY_GRAPHICTOGALLERY(RC_DOCVW_BEGIN + 24)
-#define MN_READONLY_BACKGROUNDTOGALLERY (RC_DOCVW_BEGIN + 60)
-
 #define STR_REDLINE_INSERT  (RC_DOCVW_BEGIN + 9)
 #define STR_REDLINE_DELETE  (RC_DOCVW_BEGIN + 10)
 #define STR_REDLINE_FORMAT  (RC_DOCVW_BEGIN + 11)
diff --git a/sw/source/uibase/docvw/docvw.src b/sw/source/uibase/docvw/docvw.src
index a589c11ae11f..22e47e6a8709 100644
--- 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source vcl/source vcl/workben

2017-04-02 Thread Caolán McNamara
 sw/inc/shellio.hxx   |4 +--
 sw/source/filter/ww8/ww8par.cxx  |   22 ++
 sw/source/filter/ww8/ww8scan.cxx |2 -
 vcl/source/gdi/gfxlink.cxx   |4 +--
 vcl/workben/fftester.cxx |   47 ---
 5 files changed, 57 insertions(+), 22 deletions(-)

New commits:
commit 74917d23782413aa0f129bcf9e6bf5a1c496d23b
Author: Caolán McNamara 
Date:   Sun Apr 2 21:05:48 2017 +0100

split up doc testing for three major variants

Change-Id: Iac1b5cb1c209ba27d185c8a7ba1e59c663553d77

diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index 283422710fc2..298f4c465647 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -177,13 +177,13 @@ protected:
 #define SW_STREAM_READER1
 #define SW_STORAGE_READER   2
 
-extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportDOC(const OUString 
, const OUString );
+extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportDOC(SvStream , 
const OUString );
 extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportRTF(SvStream );
 
 class SW_DLLPUBLIC Reader
 {
 friend class SwReader;
-friend bool TestImportDOC(const OUString , const OUString );
+friend bool TestImportDOC(SvStream , const OUString );
 friend bool TestImportRTF(SvStream );
 rtl::Reference mxTemplate;
 OUString aTemplateNm;
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 108bf115eee5..f86a2c263a2d 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -6190,16 +6190,15 @@ extern "C" SAL_DLLPUBLIC_EXPORT Reader* SAL_CALL 
ImportDOC()
 return new WW8Reader;
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportDOC(const OUString 
, const OUString )
+bool SAL_CALL TestImportDOC(SvStream , const OUString )
 {
 Reader *pReader = ImportDOC();
 
-SvFileStream aFileStream(rURL, StreamMode::READ);
 tools::SvRef xStorage;
-pReader->pStrm = 
+pReader->pStrm = 
 if (rFltName != "WW6")
 {
-xStorage = tools::SvRef(new SotStorage(aFileStream));
+xStorage = tools::SvRef(new SotStorage(rStream));
 pReader->pStg = xStorage.get();
 }
 pReader->SetFltName(rFltName);
@@ -6223,6 +6222,21 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL 
TestImportDOC(const OUString 
 return bRet;
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportWW8(SvStream )
+{
+return TestImportDOC(rStream, "CWW8");
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportWW6(SvStream )
+{
+return TestImportDOC(rStream, "CWW6");
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportWW2(SvStream )
+{
+return TestImportDOC(rStream, "WW6");
+}
+
 sal_uLong WW8Reader::OpenMainStream( tools::SvRef& rRef, 
sal_uInt16& rBuffSize )
 {
 sal_uLong nRet = ERR_SWG_READ_ERROR;
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 3364acdf3f58..fc441fdee489 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -87,7 +87,7 @@ namespace
 const wwSprmSearcher *wwSprmParser::GetWW2SprmSearcher()
 {
 //double lock me
-// WW7- Sprms
+// WW2 Sprms
 static const SprmInfoRow aSprms[] =
 {
 {  0, { 0, L_FIX} }, // "Default-sprm", will be skipped
diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx
index 63e33e14b735..636970f6ee48 100644
--- a/vcl/workben/fftester.cxx
+++ b/vcl/workben/fftester.cxx
@@ -323,26 +323,47 @@ try_again:
 SvFileStream aFileStream(out, StreamMode::READ);
 ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
 }
-else if ( (strcmp(argv[2], "doc") == 0) ||
-  (strcmp(argv[2], "ww8") == 0) ||
-  (strcmp(argv[2], "ww6") == 0) ||
-  (strcmp(argv[2], "ww2") == 0) )
+else if ((strcmp(argv[2], "doc") == 0) || (strcmp(argv[2], "ww8") 
== 0))
 {
-static WFilterCall pfnImport(nullptr);
+static FFilterCall pfnImport(nullptr);
 if (!pfnImport)
 {
 osl::Module aLibrary;
 aLibrary.loadRelative(, "libmswordlo.so", 
SAL_LOADMODULE_LAZY);
-pfnImport = reinterpret_cast(
-aLibrary.getFunctionSymbol("TestImportDOC"));
+pfnImport = reinterpret_cast(
+aLibrary.getFunctionSymbol("TestImportWW8"));
+aLibrary.release();
+}
+SvFileStream aFileStream(out, StreamMode::READ);
+ret = (int) (*pfnImport)(aFileStream);
+}
+else if (strcmp(argv[2], "ww6") == 0)
+{
+static FFilterCall pfnImport(nullptr);
+if (!pfnImport)
+{
+osl::Module aLibrary;
+

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2017-03-24 Thread Caolán McNamara
 sw/inc/viewsh.hxx   |2 -
 sw/source/core/view/vprint.cxx  |6 ++--
 sw/source/filter/basflt/shellio.cxx |   49 +---
 3 files changed, 28 insertions(+), 29 deletions(-)

New commits:
commit cb20ca1f52f2a0d61b972f88fb01e23958a0f3a5
Author: Caolán McNamara 
Date:   Fri Mar 24 14:29:35 2017 +

fix indent

Change-Id: Ifc1f654e4f63fc7aa62e1b920d1550281a0fa71e

diff --git a/sw/source/filter/basflt/shellio.cxx 
b/sw/source/filter/basflt/shellio.cxx
index 642c84dca8de..0dc77c9d5ea2 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -486,37 +486,36 @@ SwDoc* Reader::GetTemplateDoc()
 aChkDateTime += tools::Time( 0L, 1L );
 }
 
-if( bLoad )
+if (bLoad)
 {
 ClearTemplate();
 OSL_ENSURE( !mxTemplate.is(), "Who holds the template doc?" );
 
-// If the writer module is not installed,
-// we cannot create a SwDocShell. We could create a
-// SwWebDocShell however, because this exists always
-// for the help.
-SvtModuleOptions aModuleOptions;
-if( aModuleOptions.IsWriter() )
+// If the writer module is not installed,
+// we cannot create a SwDocShell. We could create a
+// SwWebDocShell however, because this exists always
+// for the help.
+SvtModuleOptions aModuleOptions;
+if (aModuleOptions.IsWriter())
+{
+SwDocShell *pDocSh = new 
SwDocShell(SfxObjectCreateMode::INTERNAL);
+SfxObjectShellLock xDocSh = pDocSh;
+if (pDocSh->DoInitNew())
 {
-SwDocShell *pDocSh =
-new SwDocShell ( SfxObjectCreateMode::INTERNAL );
-SfxObjectShellLock xDocSh = pDocSh;
-if( pDocSh->DoInitNew() )
-{
-mxTemplate = pDocSh->GetDoc();
-mxTemplate->SetOle2Link( Link() );
-// always FALSE
-mxTemplate->GetIDocumentUndoRedo().DoUndo( false );
-
mxTemplate->getIDocumentSettingAccess().set(DocumentSettingId::BROWSE_MODE, 
bTmplBrowseMode );
-mxTemplate->RemoveAllFormatLanguageDependencies();
-
-ReadXML->SetOrganizerMode( true );
-SfxMedium aMedium( aFileName, StreamMode::NONE );
-SwReader aRdr( aMedium, OUString(), mxTemplate.get() );
-aRdr.Read( *ReadXML );
-ReadXML->SetOrganizerMode( false );
-}
+mxTemplate = pDocSh->GetDoc();
+mxTemplate->SetOle2Link( Link() );
+// always FALSE
+mxTemplate->GetIDocumentUndoRedo().DoUndo( false );
+
mxTemplate->getIDocumentSettingAccess().set(DocumentSettingId::BROWSE_MODE, 
bTmplBrowseMode );
+mxTemplate->RemoveAllFormatLanguageDependencies();
+
+ReadXML->SetOrganizerMode( true );
+SfxMedium aMedium( aFileName, StreamMode::NONE );
+SwReader aRdr( aMedium, OUString(), mxTemplate.get() );
+aRdr.Read( *ReadXML );
+ReadXML->SetOrganizerMode( false );
 }
+}
 }
 
 OSL_ENSURE( !mxTemplate.is() || FStatHelper::IsDocument( aFileName ) 
|| aTemplateNm=="$$Dummy$$",
commit a85840ecea45d254c932f011f3f43f307b089f8a
Author: Caolán McNamara 
Date:   Fri Mar 24 14:24:09 2017 +

Offst might as well be expanded to Offset

Change-Id: I6ba3131155fbbe5a01e47aca4008d39191254fe0

diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index fd3d28132e7c..965d98697f20 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -113,7 +113,7 @@ class SW_DLLPUBLIC SwViewShell : public 
sw::Ring
  // i.e. if the EndActions of the other
  // Shells on the document are through.
 
-Point maPrtOffst;// Ofst for Printer,
+Point maPrtOffset;   // Offset for Printer,
  // non-printable margin.
 Size  maBrowseBorder;// Border for frame documents.
 SwRectmaInvalidRect;
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 110ae57b2bf3..b9f516251d1f 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -200,9 +200,9 @@ void SwViewShell::InitPrt( OutputDevice *pOutDev )
 // physical page while the output uses OutputOffset as origin.
 if ( pOutDev )
 {
-maPrtOffst = Point();
+ 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2017-02-16 Thread Caolán McNamara
 sw/inc/pagedesc.hxx|   13 -
 sw/source/core/layout/pagedesc.cxx |4 ++--
 sw/source/core/layout/paintfrm.cxx |4 ++--
 sw/source/ui/misc/pgfnote.cxx  |6 +++---
 sw/source/uibase/utlui/uiitems.cxx |2 +-
 5 files changed, 12 insertions(+), 17 deletions(-)

New commits:
commit 3a3f223f5a931680fb0543ee732dd5e800d6850b
Author: Caolán McNamara 
Date:   Thu Feb 16 10:19:58 2017 +

hazard a de->en translation

Change-Id: I82df46b8fa9d31b393bf3ddecbfb92128680b258

diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index 6f27e4c..70e109c 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -265,10 +265,10 @@ bool SwFootNotePage::FillItemSet(SfxItemSet *rSet)
 // Separator color
 rFootnoteInfo.SetLineColor( m_pLineColorBox->GetSelectEntryColor() );
 
-// Position
+// Position
 
rFootnoteInfo.SetAdj((css::text::HorizontalAdjust)m_pLinePosBox->GetSelectEntryPos());
 
-// Breite
+// Width
 rFootnoteInfo.SetWidth(Fraction( static_cast< long 
>(m_pLineLengthEdit->GetValue()), 100));
 
 const SfxPoolItem* pOldItem;
commit 0d9ad65f689a975747903b226baa0132d057f523
Author: Caolán McNamara 
Date:   Thu Feb 16 10:15:15 2017 +

replace SwFootnoteAdj with css::text::HorizontalAdjust

to ensure the retention of the values the code depends on

Change-Id: I3baafc1ee66481518aec5928585464c8a214be16

diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index 9b9378f..c259e37 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -42,12 +43,6 @@ class SwTextFormatColl;
 class SwNode;
 class SwPageDescs;
 
-/// Separator line adjustment.
-enum class SwFootnoteAdj
-{
-Left = 0, Center = 1, Right = 2
-};
-
 /// Footnote information.
 class SW_DLLPUBLIC SwPageFootnoteInfo
 {
@@ -57,7 +52,7 @@ private:
 editeng::SvxBorderStyle m_eLineStyle;  ///< Style of the separator line
 Color   m_LineColor;///< color of the separator line
 Fractionm_Width;///< percentage width of the separator line.
-SwFootnoteAdjm_eAdjust;  ///< line adjustment.
+css::text::HorizontalAdjust m_eAdjust;  ///< line adjustment.
 SwTwips m_nTopDist; ///< distance between body and separator.
 SwTwips m_nBottomDist;  ///< distance between separator and first 
footnote
 
@@ -67,7 +62,7 @@ public:
 const Color& GetLineColor() const   { return m_LineColor;}
 editeng::SvxBorderStyle  GetLineStyle() const { return m_eLineStyle; }
 const Fraction& GetWidth() const{ return m_Width; }
-SwFootnoteAdjGetAdj() const  { return m_eAdjust; }
+css::text::HorizontalAdjust GetAdj() const { return m_eAdjust; }
 SwTwips GetTopDist() const  { return m_nTopDist; }
 SwTwips GetBottomDist() const   { return m_nBottomDist; }
 
@@ -76,7 +71,7 @@ public:
 void SetLineStyle(editeng::SvxBorderStyle const eSet) {m_eLineStyle = 
eSet;}
 void SetLineColor(const Color& rCol){ m_LineColor = rCol;}
 void SetWidth(const Fraction & rNew){ m_Width = rNew; }
-void SetAdj(SwFootnoteAdj const eNew)   { m_eAdjust = eNew; }
+void SetAdj(css::text::HorizontalAdjust const eNew)   { m_eAdjust = eNew; }
 void SetTopDist   (SwTwips const nNew)  { m_nTopDist = nNew; }
 void SetBottomDist(SwTwips const nNew)  { m_nBottomDist = nNew; }
 
diff --git a/sw/source/core/layout/pagedesc.cxx 
b/sw/source/core/layout/pagedesc.cxx
index 556a382..14a0914 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -383,8 +383,8 @@ SwPageFootnoteInfo::SwPageFootnoteInfo()
 , m_nBottomDist( 57 )
 {
 m_eAdjust = FRMDIR_HORI_RIGHT_TOP == 
GetDefaultFrameDirection(GetAppLanguage()) ?
-   SwFootnoteAdj::Right :
-   SwFootnoteAdj::Left;
+   css::text::HorizontalAdjust_RIGHT :
+   css::text::HorizontalAdjust_LEFT;
 }
 
 SwPageFootnoteInfo::SwPageFootnoteInfo( const SwPageFootnoteInfo  )
diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 51ed713..e11c009 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -5573,9 +5573,9 @@ void SwFootnoteContFrame::PaintLine( const SwRect& rRect,
 SwTwips nX = aRectFnSet.GetPrtLeft(*this);
 switch ( rInf.GetAdj() )
 {
-case SwFootnoteAdj::Right:
+case css::text::HorizontalAdjust_RIGHT:
 nX += nPrtWidth - nWidth; break;
-case SwFootnoteAdj::Left:
+case css::text::HorizontalAdjust_LEFT:
 /* do nothing */; break;
 default:
 SAL_WARN("sw.core", "New adjustment for footnote lines?");
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index 44f6d03..6f27e4c 100644
--- 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2017-02-14 Thread Bjoern Michaelsen
 sw/inc/frmfmt.hxx   |   14 +-
 sw/source/core/draw/dcontact.cxx|   11 ---
 sw/source/core/layout/atrfrm.cxx|   16 ++--
 sw/source/core/layout/fly.cxx   |   19 +++
 sw/source/core/unocore/unoframe.cxx |   19 ---
 sw/source/filter/ww8/ww8graf.cxx|   17 -
 6 files changed, 46 insertions(+), 50 deletions(-)

New commits:
commit 837545feb63f31095d69d006aeda520637c3bc8c
Author: Bjoern Michaelsen 
Date:   Sat Feb 11 05:03:07 2017 +0100

DYING_FLYFRAMEFORMAT not needed anymore

Change-Id: Id9ded246752903f692c0f8254a258fada299d9bf
Reviewed-on: https://gerrit.libreoffice.org/34142
Tested-by: Jenkins 
Reviewed-by: Björn Michaelsen 

diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index 6daa2ad..9d40d96 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -262,7 +262,6 @@ namespace sw
 {
 enum class DrawFrameFormatHintId {
 DYING,
-DYING_FLYFRAMEFORMAT, /* possibly can be merged with DYING, if all 
client handle it and handle it the same */
 PREPPASTING,
 PREP_INSERT_FLY,
 PREP_DELETE_FLY,
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index b0e2e9a..9a4c78e 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -594,17 +594,6 @@ void SwFlyDrawContact::SwClientNotify(const SwModify& 
rMod, const SfxHint& rHint
 {
 pKillDrawHint->m_rpContact = this;
 }
-else if (auto pDrawFrameFormatHint = dynamic_cast())
-{
-switch(pDrawFrameFormatHint->m_eId)
-{
-case sw::DrawFrameFormatHintId::DYING_FLYFRAMEFORMAT:
-
dynamic_cast(const_cast())->ClearContact();
-break;
-default:
-;
-}
-}
 }
 
 // SwDrawContact
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index aff63bd..01c5923 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2889,8 +2889,6 @@ SwFlyFrameFormat::~SwFlyFrameFormat()
 {
 SwFrame::DestroyFrame(pLast);
 } while( nullptr != ( pLast = aIter.Next() ));
-
-
CallSwClientNotify(sw::DrawFrameFormatHint(sw::DrawFrameFormatHintId::DYING_FLYFRAMEFORMAT));
 }
 
 /// Creates the Frames if the format describes a paragraph-bound frame.
commit 4ae93f7d3b063d13ff75788a468212227ef9
Author: Bjoern Michaelsen 
Date:   Sat Feb 11 02:43:52 2017 +0100

give SwFlyDrawContact a clear owner: SwFlyFrameFormat

Change-Id: Ida24ef9ae65ae8658645496369673d886e0935cc
Reviewed-on: https://gerrit.libreoffice.org/34141
Tested-by: Jenkins 
Reviewed-by: Björn Michaelsen 

diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index b55ca5d..6daa2ad 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -174,11 +174,15 @@ public:
 
 // The FlyFrame-Format
 
+class SdrModel;
+class SwFlyDrawContact;
+
 class SW_DLLPUBLIC SwFlyFrameFormat: public SwFrameFormat
 {
 friend class SwDoc;
 OUString msTitle;
 OUString msDesc;
+std::unique_ptr m_pContact;
 
 /** Both not existent.
it stores the previous position of Prt rectangle from 
RequestObjectResize
@@ -190,12 +194,13 @@ class SW_DLLPUBLIC SwFlyFrameFormat: public SwFrameFormat
 SwFlyFrameFormat =( const SwFlyFrameFormat  ) = delete;
 
 protected:
-SwFlyFrameFormat( SwAttrPool& rPool, const OUString ,
-SwFrameFormat *pDrvdFrame )
-: SwFrameFormat( rPool, rFormatNm, pDrvdFrame, RES_FLYFRMFMT )
-{}
+SwFlyFrameFormat(SwAttrPool& rPool, const OUString& rFormatNm, 
SwFrameFormat* pDrvdFrame);
 
 public:
+SwFlyDrawContact* GetContact()
+{ return m_pContact.get(); };
+void InitContact(SdrModel* pSdrModel);
+void ClearContact();
 virtual ~SwFlyFrameFormat() override;
 
 /// Creates the views.
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 6d2c08b..b0e2e9a 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -599,7 +599,7 @@ void SwFlyDrawContact::SwClientNotify(const SwModify& rMod, 
const SfxHint& rHint
 switch(pDrawFrameFormatHint->m_eId)
 {
 case sw::DrawFrameFormatHintId::DYING_FLYFRAMEFORMAT:
-delete this;
+
dynamic_cast(const_cast())->ClearContact();
 break;
 default:
 ;
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 1b420b7..aff63bd 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2866,6 +2866,20 @@ void 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2017-01-25 Thread Michael Stahl
 sw/inc/IDocumentSettingAccess.hxx |1 -
 sw/source/core/doc/DocumentSettingManager.cxx |7 ---
 sw/source/core/inc/DocumentSettingManager.hxx |1 -
 sw/source/filter/xml/xmlimp.cxx   |   16 
 sw/source/uibase/uno/SwXDocumentSettings.cxx  |5 ++---
 5 files changed, 2 insertions(+), 28 deletions(-)

New commits:
commit 3e6042c2ce4613f5f200739b5842d4e38e8ec54a
Author: Michael Stahl 
Date:   Wed Jan 25 11:46:14 2017 +0100

sw: config item "OutlineLevelYieldsNumbering" has no effect

... since CWS swqbf90 in 2005, so remove it, except for the
entry in the property set.

Change-Id: I5f82d1957a15bf5141108ac9821b813dd36f1995

diff --git a/sw/inc/IDocumentSettingAccess.hxx 
b/sw/inc/IDocumentSettingAccess.hxx
index e85e7d7..ed7da12 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -54,7 +54,6 @@ enum class DocumentSettingId
 DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK,
 TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK,
 DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT,
-OUTLINE_LEVEL_YIELDS_OUTLINE_RULE,
 
 DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE,
 TABLE_ROW_KEEP,
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx 
b/sw/source/core/doc/DocumentSettingManager.cxx
index 64644c5..22a2581 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -67,7 +67,6 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc 
)
 mbTableRowKeep(false),
 mbIgnoreTabsAndBlanksForLineCalculation(false),
 mbDoNotCaptureDrawObjsOnPage(false),
-mbOutlineLevelYieldsOutlineRule(false),
 mbClipAsCharacterAnchoredWriterFlyFrames(false),
 mbUnixForceZeroExtLeading(false),
 mbTabRelativeToIndent(true),
@@ -159,7 +158,6 @@ bool sw::DocumentSettingManager::get(/*[in]*/ 
DocumentSettingId id) const
 case DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION: return 
mbConsiderWrapOnObjPos;
 case DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK: return 
mbDoNotJustifyLinesWithManualBreak;
 case DocumentSettingId::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING: return 
mbIgnoreFirstLineIndentInNumbering;
-case DocumentSettingId::OUTLINE_LEVEL_YIELDS_OUTLINE_RULE: return 
mbOutlineLevelYieldsOutlineRule;
 case DocumentSettingId::TABLE_ROW_KEEP: return mbTableRowKeep;
 case DocumentSettingId::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION: 
return mbIgnoreTabsAndBlanksForLineCalculation;
 case DocumentSettingId::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE: return 
mbDoNotCaptureDrawObjsOnPage;
@@ -276,10 +274,6 @@ void sw::DocumentSettingManager::set(/*[in]*/ 
DocumentSettingId id, /*[in]*/ boo
 mbIgnoreFirstLineIndentInNumbering = value;
 break;
 
-case DocumentSettingId::OUTLINE_LEVEL_YIELDS_OUTLINE_RULE:
-mbOutlineLevelYieldsOutlineRule = value;
-break;
-
 case DocumentSettingId::TABLE_ROW_KEEP:
 mbTableRowKeep = value;
 break;
@@ -554,7 +548,6 @@ void 
sw::DocumentSettingManager::ReplaceCompatibilityOptions(const DocumentSetti
 mbIgnoreFirstLineIndentInNumbering = 
rSource.mbIgnoreFirstLineIndentInNumbering;
 mbDoNotJustifyLinesWithManualBreak = 
rSource.mbDoNotJustifyLinesWithManualBreak;
 mbDoNotResetParaAttrsForNumFont = rSource.mbDoNotResetParaAttrsForNumFont;
-mbOutlineLevelYieldsOutlineRule = rSource.mbOutlineLevelYieldsOutlineRule;
 mbTableRowKeep = rSource.mbTableRowKeep;
 mbIgnoreTabsAndBlanksForLineCalculation = 
rSource.mbIgnoreTabsAndBlanksForLineCalculation;
 mbDoNotCaptureDrawObjsOnPage = rSource.mbDoNotCaptureDrawObjsOnPage;
diff --git a/sw/source/core/inc/DocumentSettingManager.hxx 
b/sw/source/core/inc/DocumentSettingManager.hxx
index c4dcd47..ae835d7 100644
--- a/sw/source/core/inc/DocumentSettingManager.hxx
+++ b/sw/source/core/inc/DocumentSettingManager.hxx
@@ -133,7 +133,6 @@ class DocumentSettingManager :
 bool mbTableRowKeep : 1;
 bool mbIgnoreTabsAndBlanksForLineCalculation: 1;   // #i3952#
 bool mbDoNotCaptureDrawObjsOnPage   : 1;   // #i62875#
-bool mbOutlineLevelYieldsOutlineRule: 1;
 bool mbClipAsCharacterAnchoredWriterFlyFrames   : 1;
 bool mbUnixForceZeroExtLeading  : 1;   // #i60945#
 bool mbTabRelativeToIndent  : 1;   // #i24363# tab 
stops relative to indent
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 41929fd..880d96f 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1100,7 +1100,6 @@ void SwXMLImport::SetConfigurationSettings(const Sequence 
< PropertyValue > & aC
 // below, and set them if not found
 bool bPrinterIndependentLayout = false;
 bool bUseOldNumbering = false;
-bool bOutlineLevelYieldsOutlineRule = false;
 bool 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2016-12-24 Thread Bjoern Michaelsen
 sw/inc/dcontact.hxx  |5 ++---
 sw/inc/frmfmt.hxx|   35 +++
 sw/source/core/draw/dcontact.cxx |   31 ++-
 sw/source/core/layout/atrfrm.cxx |   15 ++-
 sw/source/core/text/itrform2.cxx |2 +-
 sw/source/core/text/porfly.cxx   |   16 +---
 sw/source/core/text/porfly.hxx   |4 ++--
 7 files changed, 65 insertions(+), 43 deletions(-)

New commits:
commit 4280607328c1c46b566719212ae3f802d511493b
Author: Bjoern Michaelsen 
Date:   Sat Dec 24 03:02:26 2016 +0100

kill FindContactObject and adapt FindSdrObject

- the latter is cheating for now, the FrameFormat should really actively 
bookkeep
  those

Change-Id: Icf64256ba5277dc4d1ec9ac8858bdc014b3f95f5
Reviewed-on: https://gerrit.libreoffice.org/32392
Tested-by: Jenkins 
Reviewed-by: Björn Michaelsen 

diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx
index 9c2b628..ae84eee 100644
--- a/sw/inc/dcontact.hxx
+++ b/sw/inc/dcontact.hxx
@@ -66,7 +66,7 @@ SwContact* GetUserCall( const SdrObject* );
 bool IsMarqueeTextObj( const SdrObject& rObj );
 
 /// Base class for the following contact objects (frame + draw objects).
-class SwContact : public SdrObjUserCall, public SwClient
+class SW_DLLPUBLIC SwContact : public SdrObjUserCall, public SwClient
 {
 /** boolean, indicating destruction of contact object
  important note: boolean has to be set at the beginning of each destructor
@@ -100,6 +100,7 @@ class SwContact : public SdrObjUserCall, public SwClient
 
 protected:
 void SetInDTOR();
+virtual void SwClientNotify(const SwModify&, const SfxHint& rHint) 
override;
 
 public:
 
@@ -190,8 +191,6 @@ class SW_DLLPUBLIC SwFlyDrawContact : public SwContact
 private:
 SwFlyDrawObj* mpMasterObj;
 
-protected:
-virtual void SwClientNotify(const SwModify&, const SfxHint& rHint) 
override;
 
 public:
 
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index f1ebc09..fafa003 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -33,7 +33,19 @@ class IMapObject;
 class SwRect;
 class SwContact;
 class SdrObject;
-namespace sw { class DocumentLayoutManager; }
+namespace sw
+{
+class DocumentLayoutManager;
+// This is cheating: we are not really decoupling much with this hint.
+// SwDrawFrameFormat should probably bookkeep its SdrObject (and
+// SwDrawFrameFormat too) as members
+struct SW_DLLPUBLIC FindSdrObjectHint final : SfxHint
+{
+SdrObject** m_ppObject;
+FindSdrObjectHint(SdrObject** ppObject) : m_ppObject(ppObject) {};
+virtual ~FindSdrObjectHint() override;
+};
+}
 class SwFrameFormats;
 
 /// Style of a layout element.
@@ -106,17 +118,16 @@ public:
 SwRect FindLayoutRect( const bool bPrtArea = false,
const Point* pPoint = nullptr ) const;
 
-/** Searches SdrObject. SdrObjUserCall is client of the format.
-   The UserCall knows its SdrObject. */
-  SwContact *FindContactObj();
-const SwContact *FindContactObj() const
-{ return const_cast(this)->FindContactObj(); }
-
 /** @return the SdrObject, that is connected to the ContactObject.
Only DrawFrameFormats are connected to the "real SdrObject". 
FlyFrameFormats
are connected to a Master and all FlyFrames has the "real SdrObject".
"Real SdrObject" has position and a Z-order. */
-  SdrObject *FindSdrObject();
+SdrObject* FindSdrObject()
+{
+SdrObject* pObject(nullptr);
+CallSwClientNotify(sw::FindSdrObjectHint());
+return pObject;
+}
 const SdrObject *FindSdrObject() const
 { return const_cast(this)->FindSdrObject(); }
 
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 0b08435..d014583 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -378,6 +378,17 @@ sal_uInt32 SwContact::GetMaxOrdNum() const
 return nMaxOrdNum;
 }
 
+void SwContact::SwClientNotify(const SwModify&, const SfxHint& rHint)
+{
+// this does not call SwClient::SwClientNotify and thus doesnt handle 
RES_OBJECTDYING as usual. Is this intentional?
+if (auto pFindSdrObjectHint = dynamic_cast())
+{
+if(!*pFindSdrObjectHint->m_ppObject)
+*pFindSdrObjectHint->m_ppObject = GetMaster();
+}
+}
+
+
 SwFlyDrawContact::SwFlyDrawContact( SwFlyFrameFormat *pToRegisterIn, SdrModel 
* ) :
 SwContact( pToRegisterIn )
 {
@@ -434,10 +445,6 @@ void SwFlyDrawContact::SetMaster( SdrObject* _pNewMaster )
 mpMasterObj = static_cast(_pNewMaster);
 }
 
-void SwFlyDrawContact::SwClientNotify(const SwModify&, const SfxHint&)
-{
-}
-
 /**
  * @note Overriding method to control Writer fly frames, which are linked, and
  *   to assure that all objects anchored at/inside 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2016-12-19 Thread Michael Stahl
 sw/inc/accmap.hxx|2 -
 sw/source/core/access/accmap.cxx |   41 ++
 sw/source/core/draw/dcontact.cxx |   52 +++
 3 files changed, 36 insertions(+), 59 deletions(-)

New commits:
commit b052b5d890be70dd22b9aea36a356074a2c39871
Author: Michael Stahl 
Date:   Mon Dec 19 12:53:30 2016 +0100

tdf#104488 SwAccessibleMap: dispose sub-shapes of group shapes

... and ensure that they are removed from the mpShapeMap.

Commit 76c549eb01dcb7b5bf28a271ce00e386f3d388ba added all sub-shapes of
group shapes to SwAccessibleMap::mpShapeMap.
It's not immediately obvious why this is necessary, given that
AccessibleShape will probably create these on demand.

It turns out that the AccessibleShapes are not only disposed from
SwAccessible code but also from svx code,
in particular the call to ViewForwarderChanged() in
SwAccessibleContext::ChildrenScrolled() leads to visibility checks.

Thus the RemoveGroupContext() may fail to remove the sub-shapes from the
mpShapeMap and the assertion in ~SwAccessibleMap is triggered.

Change-Id: I6d9c3d816f5521960855d5e6a563bec49d8030b8

diff --git a/sw/inc/accmap.hxx b/sw/inc/accmap.hxx
index 469fba1..aaef5a7 100644
--- a/sw/inc/accmap.hxx
+++ b/sw/inc/accmap.hxx
@@ -175,7 +175,7 @@ public:
 
 void AddGroupContext(const SdrObject *pParentObj,
 css::uno::Reference < css::accessibility::XAccessible > 
const & xAccParent);
-void RemoveGroupContext(const SdrObject *pParentObj, css::uno::Reference < 
css::accessibility::XAccessible > const & xAccParent);
+void RemoveGroupContext(const SdrObject *pParentObj);
 
 const SwRect& GetVisArea() const;
 
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index d2090e0..be1054b 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -2056,36 +2056,23 @@ void SwAccessibleMap::AddShapeContext(const SdrObject 
*pObj, uno::Reference < XA
 }
 
 //Added by yanjun for sym2_6407
-void SwAccessibleMap::RemoveGroupContext(const SdrObject *pParentObj, 
css::uno::Reference < css::accessibility::XAccessible > const & xAccParent)
+void SwAccessibleMap::RemoveGroupContext(const SdrObject *pParentObj)
 {
 osl::MutexGuard aGuard( maMutex );
-if (mpShapeMap && pParentObj && pParentObj->IsGroupObject() && 
xAccParent.is())
+// TODO: Why are sub-shapes of group shapes even added to our map?
+//   Doesn't the AccessibleShape of the top-level shape create them
+//   on demand anyway? Why does SwAccessibleMap need to know them?
+// We cannot rely on getAccessibleChild here to remove the sub-shapes
+// from mpShapes because the top-level shape may not only be disposed here
+// but also by visibility checks in svx, then it doesn't return children.
+if (mpShapeMap && pParentObj && pParentObj->IsGroupObject())
 {
-uno::Reference < XAccessibleContext > xContext = 
xAccParent->getAccessibleContext();
-if (xContext.is())
+SdrObjList *const pChildren(pParentObj->GetSubList());
+for (size_t i = 0; pChildren && i < pChildren->GetObjCount(); ++i)
 {
-for (sal_Int32 i = 0; i < xContext->getAccessibleChildCount(); ++i)
-{
-uno::Reference < XAccessible > xChild = 
xContext->getAccessibleChild(i);
-if (xChild.is())
-{
-uno::Reference < XAccessibleContext > xChildContext = 
xChild->getAccessibleContext();
-if (xChildContext.is())
-{
-if (xChildContext->getAccessibleRole() == 
AccessibleRole::SHAPE)
-{
-::accessibility::AccessibleShape* pAccShape = 
static_cast < ::accessibility::AccessibleShape* >( xChild.get());
-uno::Reference < drawing::XShape > xShape = 
pAccShape->GetXShape();
-if (xShape.is())
-{
-SdrObject* pObj = 
GetSdrObjectFromXShape(xShape);
-if (pObj)
-RemoveContext(pObj);
-}
-}
-}
-}
-}
+SdrObject *const pChild(pChildren->GetObj(i));
+assert(pChild);
+RemoveContext(pChild);
 }
 }
 }
@@ -2195,7 +2182,7 @@ void SwAccessibleMap::RemoveContext( const SdrObject 
*pObj )
 {
 uno::Reference < XAccessible > xAcc( (*aIter).second );
 mpShapeMap->erase( aIter );
-RemoveGroupContext(pObj, xAcc);
+RemoveGroupContext(pObj);
 // The shape selection flag is not cleared, but one might do
 // so but has to make sure that the removed 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2016-10-01 Thread Caolán McNamara
 sw/inc/calc.hxx|4 +
 sw/source/core/bastyp/calc.cxx |   85 +
 2 files changed, 57 insertions(+), 32 deletions(-)

New commits:
commit a77223b281d79db60c6905e77538f077200b1af8
Author: Caolán McNamara 
Date:   Sat Oct 1 12:23:46 2016 +0100

rearrange SwCalc some more

Change-Id: Ib1ffc112ddd006102b29536f7433a3f16bf63a3f

diff --git a/sw/inc/calc.hxx b/sw/inc/calc.hxx
index 20f9901..8389861 100644
--- a/sw/inc/calc.hxx
+++ b/sw/inc/calc.hxx
@@ -174,6 +174,7 @@ class SwCalc
 SwCalcOper  GetToken();
 SwSbxValue  Expr();
 SwSbxValue  Term();
+SwSbxValue  PrimFunc(bool );
 SwSbxValue  Prim();
 SwSbxValue  StdFunc(pfCalc pFnc, bool bChkTrig);
 
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index 2f2e42f..c7bdf9f 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -1042,36 +1042,34 @@ SwSbxValue SwCalc::StdFunc(pfCalc pFnc, bool bChkTrig)
 return nErg;
 }
 
-SwSbxValue SwCalc::Prim()
+SwSbxValue SwCalc::PrimFunc(bool )
 {
-SwSbxValue nErg;
-
-bool bChkPow = false;
+rChkPow = false;
 
 switch (m_eCurrOper)
 {
 case CALC_SIN:
-nErg = StdFunc(, false);
+return StdFunc(, false);
 break;
 case CALC_COS:
-nErg = StdFunc(, false);
+return StdFunc(, false);
 break;
 case CALC_TAN:
-nErg = StdFunc(, false);
+return StdFunc(, false);
 break;
 case CALC_ATAN:
-nErg = StdFunc(, false);
+return StdFunc(, false);
 break;
 case CALC_ASIN:
-nErg = StdFunc(, true);
+return StdFunc(, true);
 break;
 case CALC_ACOS:
-nErg = StdFunc(, true);
+return StdFunc(, true);
 break;
 case CALC_NOT:
 {
 GetToken();
-nErg = Prim();
+SwSbxValue nErg = Prim();
 if( SbxSTRING == nErg.GetType() )
 {
 nErg.PutBool( nErg.GetOUString().isEmpty() );
@@ -1092,10 +1090,12 @@ SwSbxValue SwCalc::Prim()
 //!! computes a binary NOT
 nErg.Compute( SbxNOT, nErg );
 }
+return nErg;
 break;
 }
 case CALC_NUMBER:
 {
+SwSbxValue nErg;
 if( GetToken() == CALC_PHD )
 {
 double aTmp = m_nNumberValue.GetDouble();
@@ -1110,12 +1110,14 @@ SwSbxValue SwCalc::Prim()
 else
 {
 nErg = m_nNumberValue;
-bChkPow = true;
+rChkPow = true;
 }
+return nErg;
 break;
 }
 case CALC_NAME:
 {
+SwSbxValue nErg;
 switch(SwCalcOper eOper = GetToken())
 {
 case CALC_ASSIGN:
@@ -1132,19 +1134,24 @@ SwSbxValue SwCalc::Prim()
 if (nErg.IsVoidValue() && (eOper == CALC_LP))
 m_eError = CALC_SYNTAX;
 else
-bChkPow = true;
+rChkPow = true;
 break;
 }
+return nErg;
 break;
 }
 case CALC_MINUS:
+{
+SwSbxValue nErg;
 GetToken();
 nErg.PutDouble( -(Prim().GetDouble()) );
+return nErg;
 break;
+}
 case CALC_LP:
 {
 GetToken();
-nErg = Expr();
+SwSbxValue nErg = Expr();
 if( m_eCurrOper != CALC_RP )
 {
 m_eError = CALC_BRACK;
@@ -1152,46 +1159,64 @@ SwSbxValue SwCalc::Prim()
 else
 {
 GetToken();
-bChkPow = true; // in order for =(7)^2 to work
+rChkPow = true; // in order for =(7)^2 to work
 }
+return nErg;
 break;
 }
 case CALC_MEAN:
 {
 m_nListPor = 1;
 GetToken();
-nErg = Expr();
+SwSbxValue nErg = Expr();
 double aTmp = nErg.GetDouble();
 aTmp /= m_nListPor;
 nErg.PutDouble( aTmp );
+return nErg;
 break;
 }
 case CALC_SQRT:
 {
 GetToken();
-nErg = Prim();
+SwSbxValue nErg = Prim();
 if( nErg.GetDouble() < 0 )
 m_eError = CALC_OVERFLOW;
 else
 nErg.PutDouble( sqrt( nErg.GetDouble() ));
+return nErg;
 break;
 }
 case CALC_SUM:
 case CALC_DATE:
 case CALC_MIN:
 case CALC_MAX:
+{
 GetToken();
-nErg = Expr();
+SwSbxValue nErg = 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2016-06-21 Thread Michael Stahl
 sw/inc/unoframe.hxx |   67 +++---
 sw/source/core/unocore/unoframe.cxx |  169 ++--
 sw/source/core/unocore/unotext.cxx  |2 
 3 files changed, 30 insertions(+), 208 deletions(-)

New commits:
commit eca55c4b8d8cb119aa1b8ad8744fa68f8fcc0ac7
Author: Michael Stahl 
Date:   Tue Jun 21 22:06:37 2016 +0200

sw: replace pointless XComponent and XTextContent overrides

... from SwXTextGraphicObject and SwXTextEmbeddedObject.

Change-Id: I22c2937617b84262c124d2504a8f9d889895005b

diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx
index 9c5b7a9..5135a9a 100644
--- a/sw/inc/unoframe.hxx
+++ b/sw/inc/unoframe.hxx
@@ -46,11 +46,12 @@ class BaseFrameProperties_Impl;
 class SwXFrame : public cppu::WeakImplHelper
 <
 css::lang::XServiceInfo,
+css::lang::XUnoTunnel,
 css::beans::XPropertySet,
 css::beans::XPropertyState,
 css::drawing::XShape,
 css::container::XNamed,
-css::lang::XUnoTunnel
+css::text::XTextContent
 >,
 public SwClient
 {
@@ -124,11 +125,13 @@ public:
 
 //Base implementation
 //XComponent
-virtual void SAL_CALL dispose(  ) throw(css::uno::RuntimeException, 
std::exception);
-virtual void SAL_CALL addEventListener( const css::uno::Reference< 
css::lang::XEventListener >& xListener ) throw(css::uno::RuntimeException, 
std::exception);
-virtual void SAL_CALL removeEventListener( const css::uno::Reference< 
css::lang::XEventListener >& aListener ) throw(css::uno::RuntimeException, 
std::exception);
+virtual void SAL_CALL dispose() throw (css::uno::RuntimeException, 
std::exception) override;
+virtual void SAL_CALL addEventListener(const 
css::uno::Reference& xListener) throw 
(css::uno::RuntimeException, std::exception) override;
+virtual void SAL_CALL removeEventListener(const 
css::uno::Reference& xListener) throw 
(css::uno::RuntimeException, std::exception) override;
 
-virtual css::uno::Reference< css::text::XTextRange >  SAL_CALL getAnchor() 
throw( css::uno::RuntimeException, std::exception );
+// XTextContent
+virtual void SAL_CALL attach(const 
css::uno::Reference& xTextRange) throw 
(css::lang::IllegalArgumentException, css::uno::RuntimeException, 
std::exception) override;
+virtual css::uno::Reference  SAL_CALL getAnchor() 
throw (css::uno::RuntimeException, std::exception) override;
 
 //XServiceInfo
 virtual OUString SAL_CALL getImplementationName() throw( 
css::uno::RuntimeException, std::exception ) override;
@@ -136,7 +139,6 @@ public:
 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() 
throw( css::uno::RuntimeException, std::exception ) override;
 
 void attachToRange(const css::uno::Reference< css::text::XTextRange > & 
xTextRange)throw(css::lang::IllegalArgumentException, 
css::uno::RuntimeException, std::exception);
-void attach( const css::uno::Reference< css::text::XTextRange >& 
xTextRange ) throw(css::lang::IllegalArgumentException, 
css::uno::RuntimeException, std::exception);
 
 const SwFrameFormat* GetFrameFormat() const
 {
@@ -239,7 +241,6 @@ public:
 
 typedef cppu::ImplInheritanceHelper
 <   SwXFrame,
-css::text::XTextContent,
 css::document::XEventsSupplier
 >
 SwXTextGraphicObjectBaseClass;
@@ -258,15 +259,6 @@ public:
 static css::uno::Reference
 CreateXTextGraphicObject(SwDoc & rDoc, SwFrameFormat * pFrameFormat);
 
-//XTextContent
-virtual void SAL_CALL attach(const css::uno::Reference< 
css::text::XTextRange > & xTextRange) throw( 
css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception 
) override;
-virtual css::uno::Reference< css::text::XTextRange >  SAL_CALL getAnchor() 
throw( css::uno::RuntimeException, std::exception ) override;
-
-//XComponent
-virtual void SAL_CALL dispose() throw( css::uno::RuntimeException, 
std::exception ) override;
-virtual void SAL_CALL addEventListener(const css::uno::Reference< 
css::lang::XEventListener > & aListener) throw( css::uno::RuntimeException, 
std::exception ) override;
-virtual void SAL_CALL removeEventListener(const css::uno::Reference< 
css::lang::XEventListener > & aListener) throw( css::uno::RuntimeException, 
std::exception ) override;
-
 //XServiceInfo
 virtual OUString SAL_CALL getImplementationName() throw( 
css::uno::RuntimeException, std::exception ) override;
 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) 
throw( css::uno::RuntimeException, std::exception ) override;
@@ -274,6 +266,7 @@ public:
 
 // XEventsSupplier
 virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL 
getEvents(  ) throw(css::uno::RuntimeException, std::exception) override;
+
 void * SAL_CALL operator new( size_t ) throw();
 void SAL_CALL operator delete( void * ) throw();
 };
@@ -281,7 +274,6 @@ public:
 class SwOLENode;
 typedef cppu::ImplInheritanceHelper
 <   SwXFrame,
- 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2016-04-07 Thread Michael Stahl
 sw/inc/pch/precompiled_msword.hxx   |1 -
 sw/inc/pch/precompiled_sw.hxx   |1 -
 sw/inc/pch/precompiled_swui.hxx |1 -
 sw/inc/pch/precompiled_vbaswobj.hxx |1 -
 sw/source/core/doc/tblafmt.cxx  |7 ---
 sw/source/filter/ww8/wrtw8sty.cxx   |6 --
 sw/source/filter/ww8/wrtww8.cxx |   11 ---
 sw/source/filter/ww8/ww8par.cxx |6 --
 sw/source/filter/ww8/ww8par.hxx |   19 +++
 sw/source/filter/ww8/ww8par2.cxx|   12 +---
 sw/source/filter/xml/xmlimpit.cxx   |6 --
 sw/source/ui/dbui/dbinsdlg.cxx  |6 --
 sw/source/uibase/app/swdllimpl.hxx  |6 --
 sw/source/uibase/sidebar/SwPanelFactory.cxx |   10 ++
 sw/source/uibase/uno/unomailmerge.cxx   |   13 +
 15 files changed, 71 insertions(+), 35 deletions(-)

New commits:
commit 082005bf81b1c72da042193449974bbb610ca85f
Author: Michael Stahl 
Date:   Wed Apr 6 17:47:34 2016 +0200

sw: replace boost::noncopyable with C++11 delete

Change-Id: Iac20763c7d1db467420f9c2fbb3cd636839d4c80

diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx
index 53ad3c2..e085bba 100644
--- a/sw/inc/pch/precompiled_sw.hxx
+++ b/sw/inc/pch/precompiled_sw.hxx
@@ -52,7 +52,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/sw/inc/pch/precompiled_swui.hxx b/sw/inc/pch/precompiled_swui.hxx
index f49478c..480012e 100644
--- a/sw/inc/pch/precompiled_swui.hxx
+++ b/sw/inc/pch/precompiled_swui.hxx
@@ -61,7 +61,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 9edc798..a9e3d58 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -41,8 +41,6 @@
 #include 
 #include 
 
-#include 
-
 #include 
 #include 
 
@@ -130,7 +128,7 @@ namespace
 
 See also: BeginSwBlock and EndSwBlock.
 */
-class WriterSpecificAutoFormatBlock : private ::boost::noncopyable
+class WriterSpecificAutoFormatBlock
 {
 public:
 explicit WriterSpecificAutoFormatBlock(SvStream ) : 
_rStream(rStream)
@@ -144,6 +142,9 @@ namespace
 }
 
 private:
+WriterSpecificAutoFormatBlock(WriterSpecificAutoFormatBlock const&) = 
delete;
+WriterSpecificAutoFormatBlock& operator=(WriterSpecificAutoFormatBlock 
const&) = delete;
+
 SvStream &_rStream;
 sal_uInt64 _whereToWriteEndOfBlock;
 };
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index ae4abb0..b0153bd 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -91,7 +91,6 @@
 
 #include 
 
-#include 
 #include 
 #include 
 
@@ -157,7 +156,7 @@ struct DB_Column
 }
 };
 
-struct DB_ColumnConfigData: private boost::noncopyable
+struct DB_ColumnConfigData
 {
 SwInsDBColumns aDBColumns;
 OUString sSource;
@@ -171,6 +170,9 @@ struct DB_ColumnConfigData: private boost::noncopyable
  bIsHeadlineOn : 1,
  bIsEmptyHeadln : 1;
 
+DB_ColumnConfigData(DB_ColumnConfigData const&) = delete;
+DB_ColumnConfigData& operator=(DB_ColumnConfigData const&) = delete;
+
 DB_ColumnConfigData()
 {
 bIsTable = bIsHeadlineOn = true;
diff --git a/sw/source/uibase/app/swdllimpl.hxx 
b/sw/source/uibase/app/swdllimpl.hxx
index 06f277c..57a34be 100644
--- a/sw/source/uibase/app/swdllimpl.hxx
+++ b/sw/source/uibase/app/swdllimpl.hxx
@@ -12,12 +12,11 @@
 
 #include 
 
-#include 
 #include 
 
 namespace sw { class Filters; }
 
-class SwDLL: private boost::noncopyable
+class SwDLL
 {
 public:
 static void RegisterFactories();
@@ -30,6 +29,9 @@ public:
 sw::Filters & getFilters();
 
 private:
+SwDLL(SwDLL const&) = delete;
+SwDLL& operator=(SwDLL const&) = delete;
+
 std::unique_ptr< sw::Filters > filters_;
 };
 
diff --git a/sw/source/uibase/sidebar/SwPanelFactory.cxx 
b/sw/source/uibase/sidebar/SwPanelFactory.cxx
index dc048745..ed9263b 100644
--- a/sw/source/uibase/sidebar/SwPanelFactory.cxx
+++ b/sw/source/uibase/sidebar/SwPanelFactory.cxx
@@ -37,7 +37,6 @@
 #include 
 #include 
 
-#include 
 
 using namespace css;
 using namespace css::uno;
@@ -49,10 +48,13 @@ typedef ::cppu::WeakComponentImplHelper <
 > PanelFactoryInterfaceBase;
 
 class SwPanelFactory
-: private ::boost::noncopyable,
-  private ::cppu::BaseMutex,
-  public PanelFactoryInterfaceBase
+: private ::cppu::BaseMutex
+, public PanelFactoryInterfaceBase
 {
+private:
+SwPanelFactory(SwPanelFactory const&) = delete;
+SwPanelFactory& operator=(SwPanelFactory const&) = delete;
+
 public:
 SwPanelFactory();
 virtual ~SwPanelFactory();
diff --git a/sw/source/uibase/uno/unomailmerge.cxx 
b/sw/source/uibase/uno/unomailmerge.cxx
index 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2015-10-21 Thread Miklos Vajna
 sw/inc/hints.hxx   |   16 ++--
 sw/source/core/attr/hints.cxx  |2 
 sw/source/core/inc/pagefrm.hxx |  124 ++---
 sw/source/core/layout/calcmove.cxx |8 +-
 sw/source/core/layout/flylay.cxx   |   42 ++--
 sw/source/core/layout/pagechg.cxx  |   44 ++---
 sw/source/core/layout/paintfrm.cxx |2 
 7 files changed, 119 insertions(+), 119 deletions(-)

New commits:
commit 652933e8fe46b24049ad0a6e61811727b1965aea
Author: Miklos Vajna 
Date:   Wed Oct 21 09:28:12 2015 +0200

sw: prefix members of SwPageFrm

Change-Id: I7587c587a52310dbfee8e79a038495eb26b108b0

diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index d2e797e..2979491 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -48,25 +48,25 @@ class SwPageFrm: public SwFootnoteBossFrm
 {
 friend class SwFrm;
 
-SwSortedObjs *pSortedObjs;
-
-SwPageDesc *pDesc; //PageDesc that describes the Page
-
-sal_uInt16  nPhyPageNum; // Physical page number
-
-bool bInvalidContent:1;
-bool bInvalidLayout   :1;
-bool bInvalidFlyContent :1;
-bool bInvalidFlyLayout:1;
-bool bInvalidFlyInCnt :1;
-bool bFootnotePage :1; // This Page is for document end 
footnotes
-bool bEmptyPage   :1; // This Page is an explicitly empty page
-bool bEndNotePage :1; // 'Footnote page' for end notes
-bool bInvalidSpelling :1; // We need online spelling
-bool bInvalidSmartTags:1; // We need checking for smarttags
-bool bInvalidAutoCmplWrds :1; // Update auto complete word list
-bool bInvalidWordCount:1;
-bool bHasGrid :1; // Grid for Asian layout
+SwSortedObjs *m_pSortedObjs;
+
+SwPageDesc *m_pDesc; //PageDesc that describes the Page
+
+sal_uInt16  m_nPhyPageNum; // Physical page number
+
+bool m_bInvalidContent:1;
+bool m_bInvalidLayout   :1;
+bool m_bInvalidFlyContent :1;
+bool m_bInvalidFlyLayout:1;
+bool m_bInvalidFlyInCnt :1;
+bool m_bFootnotePage :1; // This Page is for document end 
footnotes
+bool m_bEmptyPage   :1; // This Page is an explicitly empty page
+bool m_bEndNotePage :1; // 'Footnote page' for end notes
+bool m_bInvalidSpelling :1; // We need online spelling
+bool m_bInvalidSmartTags:1; // We need checking for smarttags
+bool m_bInvalidAutoCmplWrds :1; // Update auto complete word list
+bool m_bInvalidWordCount:1;
+bool m_bHasGrid :1; // Grid for Asian layout
 
 static const sal_Int8 mnShadowPxWidth;
 
@@ -120,8 +120,8 @@ public:
 void PrepareHeader();
 void PrepareFooter();
 
-const SwSortedObjs  *GetSortedObjs() const  { return pSortedObjs; }
-  SwSortedObjs  *GetSortedObjs()  { return pSortedObjs; }
+const SwSortedObjs  *GetSortedObjs() const  { return m_pSortedObjs; }
+  SwSortedObjs  *GetSortedObjs()  { return m_pSortedObjs; }
 
 void AppendDrawObjToPage( SwAnchoredObject& _rNewObj );
 void RemoveDrawObjFromPage( SwAnchoredObject& _rToRemoveObj );
@@ -131,8 +131,8 @@ public:
 void MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest ); // Optimized 
Remove/Append
 
 void  SetPageDesc( SwPageDesc *, SwFrameFormat * );
-  SwPageDesc *GetPageDesc() { return pDesc; }
-const SwPageDesc *GetPageDesc() const { return pDesc; }
+  SwPageDesc *GetPageDesc() { return m_pDesc; }
+const SwPageDesc *GetPageDesc() const { return m_pDesc; }
   SwPageDesc *FindPageDesc();
 
  SwContentFrm  *FindLastBodyContent();
@@ -145,7 +145,7 @@ public:
 // Specialized GetContentPos() for Field in Frames
 void GetContentPosition( const Point , SwPosition  ) const;
 
-bool IsEmptyPage() const { return bEmptyPage; } // Explicitly empty page
+bool IsEmptyPage() const { return m_bEmptyPage; } // Explicitly empty page
 
 voidUpdateFootnoteNum();
 
@@ -174,7 +174,7 @@ public:
 virtual void CheckDirection( bool bVert ) override;
 void CheckGrid( bool bInvalidate );
 void PaintGrid( OutputDevice* pOut, SwRect  ) const;
-bool HasGrid() const { return bHasGrid; }
+bool HasGrid() const { return m_bHasGrid; }
 
 void PaintDecorators( ) const;
 virtual void PaintSubsidiaryLines( const SwPageFrm*, const SwRect& ) const 
override;
@@ -187,15 +187,15 @@ public:
 void RefreshSubsidiary( const SwRect& ) const;
 
 /// Foot note interface
-bool IsFootnotePage() const  { return 
bFootnotePage; }
-bool IsEndNotePage() const  { return bEndNotePage; }
-void SetFootnotePage( bool b )   { bFootnotePage = b; }
-void SetEndNotePage( bool b )   { bEndNotePage = b; }
+bool IsFootnotePage() const 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2015-09-10 Thread Caolán McNamara
 sw/inc/fesh.hxx|1 
 sw/source/core/frmedt/fefly1.cxx   |   10 ++
 sw/source/core/frmedt/fews.cxx |   56 +++--
 sw/source/core/inc/UndoInsert.hxx  |1 
 sw/source/core/undo/unins.cxx  |   16 +++---
 sw/source/uibase/shells/basesh.cxx |   16 +++---
 6 files changed, 77 insertions(+), 23 deletions(-)

New commits:
commit 93ab0ff24cb71c36c9e7958046e96d7472b5af90
Author: Caolán McNamara 
Date:   Thu Sep 10 15:46:57 2015 +0100

Related: tdf#93676 default to as-char inside captions

This will (hopefull) improve round-tripping to doc[x] for new documents 
because
word can only have as-char elements inside frames so we get a like-for-like
conversion if the defaults are used.

Change-Id: I3913b9b624dd5ba57ed07140bced8e3dca289cf5

diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index 8227b30..35be44c 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace com::sun::star;
 
@@ -395,14 +396,18 @@ void SwFEShell::InsertLabel( const SwLabelType eType, 
const OUString , con
 if( LTYPE_DRAW==eType || pCnt )
 {
 StartAllAction();
+SwRewriter aRewriter(SwUndoInsertLabel::CreateRewriter(rText));
+StartUndo(UNDO_INSERTLABEL, );
 
 sal_uLong nIdx = 0;
+bool bInnerCntIsFly = false;
 SwFlyFrameFormat* pFlyFormat = 0;
 switch( eType )
 {
 case LTYPE_OBJECT:
 case LTYPE_FLY:
-if( pCnt->IsInFly() )
+bInnerCntIsFly = pCnt->IsInFly();
+if (bInnerCntIsFly)
 {
 // pass down index to the startnode for flys
 nIdx = pCnt->FindFlyFrm()->
@@ -423,7 +428,6 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const 
OUString , con
 {
 SwDrawView *pDView = Imp()->GetDrawView();
 const SdrMarkList& rMrkList = pDView->GetMarkedObjectList();
-StartUndo();
 
 // copy marked drawing objects to
 // local list to perform the corresponding action for each 
object
@@ -452,7 +456,6 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const 
OUString , con
 aDrawObjs.pop_back();
 }
 
-EndUndo();
 }
 break;
 default:
@@ -460,14 +463,49 @@ void SwFEShell::InsertLabel( const SwLabelType eType, 
const OUString , con
 }
 
 if( nIdx )
-pFlyFormat = GetDoc()->InsertLabel( eType, rText, rSeparator, 
rNumberSeparator, bBefore, nId,
- nIdx, rCharacterStyle, bCpyBrd );
+{
+pFlyFormat = GetDoc()->InsertLabel(eType, rText, rSeparator,
+   rNumberSeparator, bBefore, nId,
+   nIdx, rCharacterStyle, bCpyBrd);
+
+//if we succeeded in putting a caption on the content, and the
+//content was a frame/graphic, then set the contained element
+//to as-char anchoring because that's all msword is able to
+//do when inside a frame, and in writer for freshly captioned
+//elements it's largely irrelevent what the anchor of the contained
+//type is but making it as-char by default results in very
+//good roundtripping
+if (pFlyFormat && bInnerCntIsFly)
+{
+SwNodeIndex 
aAnchIdx(*pFlyFormat->GetContent().GetContentIdx(), 1);
+SwTextNode *pTxtNode = aAnchIdx.GetNode().GetTextNode();
+
+SwFormatAnchor aAnc(FLY_AS_CHAR);
+sal_Int32 nInsertPos = bBefore ? pTxtNode->Len() : 0;
+SwPosition aPos(*pTxtNode, nInsertPos);
+
+aAnc.SetAnchor();
+
+SfxItemSet 
aSet(makeItemSetFromFormatAnchor(GetDoc()->GetAttrPool(), aAnc));
 
-SwFlyFrm* pFrm;
-const Point aPt( GetCrsrDocPos() );
-if( pFlyFormat && 0 != ( pFrm = pFlyFormat->GetFrm(  )))
-SelectFlyFrm( *pFrm, true );
+SwFlyFrm *pFly = GetSelectedOrCurrFlyFrm();
+SwFlyFrameFormat* pInnerFlyFormat = pFly->GetFormat();
+GetDoc()->SetFlyFrmAttr(*pInnerFlyFormat, aSet);
 
+//put a hard-break after the graphic to keep it separated
+//from the caption text if the outer frame is resized
+SwIndex aIdx(pTxtNode, bBefore ? nInsertPos : 1);
+pTxtNode->InsertText(OUString("\n"), aIdx);
+}
+}
+
+if (pFlyFormat)
+{
+const Point aPt(GetCrsrDocPos());
+if (SwFlyFrm* pFrm = pFlyFormat->GetFrm())
+SelectFlyFrm(*pFrm, true);
+}
+

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2015-09-04 Thread Michael Stahl
 sw/inc/unocrsrhelper.hxx |8 +---
 sw/source/core/txtnode/ndtxt.cxx |8 +++-
 sw/source/core/unocore/unocrsrhelper.cxx |   14 +++---
 3 files changed, 19 insertions(+), 11 deletions(-)

New commits:
commit 15a439dacf77bfcd7cc47bd1c360945375a24141
Author: Michael Stahl 
Date:   Thu Sep 3 23:11:50 2015 +0200

sw: replace boost::ptr_map with std::map

Change-Id: I8cf906b7f3f9647a60b20a977ea11c8698438ec2

diff --git a/sw/inc/unocrsrhelper.hxx b/sw/inc/unocrsrhelper.hxx
index 9692639..4dc6ffd 100644
--- a/sw/inc/unocrsrhelper.hxx
+++ b/sw/inc/unocrsrhelper.hxx
@@ -19,8 +19,6 @@
 #ifndef INCLUDED_SW_INC_UNOCRSRHELPER_HXX
 #define INCLUDED_SW_INC_UNOCRSRHELPER_HXX
 
-#include 
-
 #include 
 #include 
 #include 
@@ -29,6 +27,8 @@
 #include 
 #include 
 
+#include 
+
 class SfxItemSet;
 class SfxItemPropertySet;
 struct SfxItemPropertySimpleEntry;
@@ -68,8 +68,10 @@ namespace SwUnoCursorHelper
 {
 class SwAnyMapHelper
 {
+private:
 //  keep Any's mapped by (WhichId << 16 ) + (MemberId)
-boost::ptr_map maMap;
+std::map m_Map;
+
 public:
 voidSetValue( sal_uInt16 nWhichId, sal_uInt16 nMemberId, const 
com::sun::star::uno::Any& rAny );
 boolFillValue( sal_uInt16 nWhichId, sal_uInt16 nMemberId, 
const com::sun::star::uno::Any*& pAny );
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx 
b/sw/source/core/unocore/unocrsrhelper.cxx
index 983b5ed..c6dcb50 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -1402,21 +1402,21 @@ void makeTableCellRedline( SwTableBox& rTableBox,
 void SwAnyMapHelper::SetValue( sal_uInt16 nWhichId, sal_uInt16 nMemberId, 
const uno::Any& rAny )
 {
 sal_uInt32 nKey = (nWhichId << 16) + nMemberId;
-auto aIt = maMap.find( nKey );
-if( aIt != maMap.end() )
-*(aIt->second) = rAny;
+auto aIt = m_Map.find( nKey );
+if (aIt != m_Map.end())
+aIt->second = rAny;
 else
-maMap.insert( nKey, new uno::Any(rAny) );
+m_Map.insert(std::make_pair(nKey, rAny));
 }
 
 boolSwAnyMapHelper::FillValue( sal_uInt16 nWhichId, sal_uInt16 nMemberId, 
const uno::Any*& pAny )
 {
 bool bRet = false;
 sal_uInt32 nKey = (nWhichId << 16) + nMemberId;
-auto aIt = maMap.find( nKey );
-if( aIt != maMap.end() )
+auto aIt = m_Map.find( nKey );
+if (aIt != m_Map.end())
 {
-pAny = aIt->second;
+pAny = & aIt->second;
 bRet = true;
 }
 return bRet;
commit 9b5d96d7e074dd9ea26f835351ac6d36fe01b086
Author: Michael Stahl 
Date:   Thu Sep 3 22:25:47 2015 +0200

sw: avoid asserts from RsidOnlyAutoFormats check

This happens with a document that has a header or footer that is not
displayed after loading, for example 1-page document with separate
left/right or first page header.

The SwTextNode::FileLoadedInitHints() is not called for these headers
because they are not visible so MakeFrm() is not called.

If they are not visible the RSID related flags don't matter.

Change-Id: Ie3bd1ce3bc0ac2ff1c429386149294e0c8fd3cb6

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index d8e8698..3317369 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -102,8 +102,12 @@ TYPEINIT1( SwTextNode, SwContentNode )
 #define CHECK_SWPHINTS(pNd)  { if( pNd->GetpSwpHints() && \
!pNd->GetDoc()->IsInReading() ) \
   pNd->GetpSwpHints()->Check(true); }
+#define CHECK_SWPHINTS_IF_FRM(pNd)  { if( pNd->GetpSwpHints() && \
+   !pNd->GetDoc()->IsInReading() ) \
+pNd->GetpSwpHints()->Check(getLayoutFrm(nullptr, nullptr, nullptr, false) 
!= nullptr); }
 #else
 #define CHECK_SWPHINTS(pNd)
+#define CHECK_SWPHINTS_IF_FRM(pNd)
 #endif
 
 SwTextNode *SwNodes::MakeTextNode( const SwNodeIndex & rWhere,
@@ -1643,6 +1647,8 @@ void SwTextNode::CopyText( SwTextNode *const pDest,
   sal_Int32 nLen,
   const bool bForceCopyOfAllAttrs )
 {
+CHECK_SWPHINTS_IF_FRM(this);
+CHECK_SWPHINTS(pDest);
 sal_Int32 nTextStartIdx = rStart.GetIndex();
 sal_Int32 nDestStart = rDestStart.GetIndex();  // alte Pos merken
 
@@ -1896,7 +1902,7 @@ void SwTextNode::CopyText( SwTextNode *const pDest,
 }
 }
 
-CHECK_SWPHINTS(this);
+CHECK_SWPHINTS_IF_FRM(this);
 CHECK_SWPHINTS(pDest);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2015-08-10 Thread Miklos Vajna
 sw/inc/swmodule.hxx |5 +
 sw/source/core/inc/drawfont.hxx |2 +-
 sw/source/core/inc/frame.hxx|2 +-
 sw/source/core/inc/swfont.hxx   |2 +-
 sw/source/core/layout/paintfrm.cxx  |8 
 sw/source/core/txtnode/fntcache.cxx |   10 ++
 6 files changed, 26 insertions(+), 3 deletions(-)

New commits:
commit 31937624e359803d2db8c12a805ec1a5c9d0fe30
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Aug 10 09:16:22 2015 +0200

sw: make these available outside sw core

Change-Id: Id5c4c65369c713d8fd7ba45acf55a65c0a05bb0e

diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index f6bdea0..35d58c6 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -258,6 +258,11 @@ inline ::com::sun::star::uno::Reference
 SW_DLLPUBLIC SwView*GetActiveView();
 SW_DLLPUBLIC SwWrtShell* GetActiveWrtShell();
 
+namespace sw
+{
+SW_DLLPUBLIC Color* GetActiveRetoucheColor();
+}
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/drawfont.hxx b/sw/source/core/inc/drawfont.hxx
index 7d36258..b751fc1 100644
--- a/sw/source/core/inc/drawfont.hxx
+++ b/sw/source/core/inc/drawfont.hxx
@@ -40,7 +40,7 @@ namespace vcl {
 class SwUnderlineFont;
 
 // encapsulates information for drawing text
-class SwDrawTextInfo
+class SW_DLLPUBLIC SwDrawTextInfo
 {
 const SwTextFrm* pFrm;
 VclPtrOutputDevice pOut;
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 58df49f..bdfb9a6 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -213,7 +213,7 @@ namespace drawinglayer { namespace attribute {
  * level: pages, headers, footers, etc. (Inside a paragraph SwLinePortion
  * instances are used.)
  */
-class SwFrm: public SwClient, public SfxBroadcaster
+class SW_DLLPUBLIC SwFrm: public SwClient, public SfxBroadcaster
 {
 // the hidden Frm
 friend class SwFlowFrm;
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index e9c96e1..70a0aca 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -123,7 +123,7 @@ public:
 #define SW_CTL 2
 #define SW_SCRIPTS 3
 
-class SwFont
+class SW_DLLPUBLIC SwFont
 {
 // CJK == Chinese, Japanese, Korean
 // CTL == Complex text layout ( Hebrew, Arabic )
diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index e4482e8..748fe0a 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -235,6 +235,14 @@ const static double aEdgeScale = 0.5;
 //To optimize the expensive RetouchColor determination
 Color aGlobalRetoucheColor;
 
+namespace sw
+{
+Color* GetActiveRetoucheColor()
+{
+return aGlobalRetoucheColor;
+}
+}
+
 /**
  * Container for static properties
  */
commit d48d0e81971266ff4625721b0f069a62ec7014e2
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Aug 10 09:14:27 2015 +0200

tdf#87922 SwDrawTextInfo::ApplyAutoColor: handle fill attributes

With this, if page background is set to e.g. black, then automatic color
of text is again white, not black.

Change-Id: I8246fa4b7834f60872b0737f03906ccc86948cc1

diff --git a/sw/source/core/txtnode/fntcache.cxx 
b/sw/source/core/txtnode/fntcache.cxx
index a106cbd..fba875c 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -47,6 +47,7 @@
 #include swmodule.hxx
 #include accessibilityoptions.hxx
 #include svtools/accessibilityoptions.hxx
+#include svx/sdr/attribute/sdrallfillattributeshelper.hxx
 #include doc.hxx
 #include editeng/fhgtitem.hxx
 #include docsh.hxx
@@ -2521,6 +2522,7 @@ bool SwDrawTextInfo::ApplyAutoColor( vcl::Font* pFont )
 {
 // check if current background has a user defined setting
 const Color* pCol = GetFont() ? GetFont()-GetBackColor() : NULL;
+Color aColor;
 if( ! pCol || COL_TRANSPARENT == pCol-GetColor() )
 {
 const SvxBrushItem* pItem;
@@ -2537,6 +2539,14 @@ bool SwDrawTextInfo::ApplyAutoColor( vcl::Font* pFont )
 /// is a background brush and its color is *not* no 
fill/auto fill.
 if( GetFrm()-GetBackgroundBrush( aFillAttributes, pItem, 
pCol, aOrigBackRect, false ) )
 {
+if (aFillAttributes.get()  aFillAttributes-isUsed())
+{
+// First see if fill atttributes provide a color.
+aColor = 
Color(aFillAttributes-getAverageColor(aGlobalRetoucheColor.getBColor()));
+pCol = aColor;
+}
+
+// If not, then fall back to the old brush item.
 if ( !pCol )
 {
 pCol = pItem-GetColor();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2015-06-24 Thread Miklos Vajna
 sw/inc/viewsh.hxx  |2 +-
 sw/source/core/view/viewsh.cxx |   10 +-
 sw/source/core/view/vprint.cxx |   12 ++--
 sw/source/uibase/app/docsh.cxx |2 +-
 4 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 1d1c0632d2de3180abaa9782404c0aea1f1b30af
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jun 24 09:34:40 2015 +0200

SwViewShell::PrtOle2: take a vcl::RenderContext

Change-Id: I0d56649cf322b7769f77ccd99be367cd813570ea

diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index cb7f1a3..e2ea4b5 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -365,7 +365,7 @@ public:
 
 // Printing for OLE 2.0.
 static void PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const 
SwPrintData rOptions,
- OutputDevice* pOleOut, const Rectangle rRect );
+ vcl::RenderContext rRenderContext, const Rectangle 
rRect );
 
 // Fill temporary doc with selected text for Print or PDF export.
 SwDoc * FillPrtDoc( SwDoc* pPrtDoc, const SfxPrinter* pPrt );
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 6867025..3098745c 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -583,15 +583,15 @@ bool SwViewShell::PrintOrPDFExport(
 }
 
 void SwViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const 
SwPrintData rOptions,
- OutputDevice* pOleOut, const Rectangle rRect )
+   vcl::RenderContext rRenderContext, const 
Rectangle rRect )
 {
 // For printing a shell is needed. Either the Doc already has one, than we
 // create a new view, or it has none, than we create the first view.
 SwViewShell *pSh;
 if( pDoc-getIDocumentLayoutAccess().GetCurrentViewShell() )
-pSh = new SwViewShell( 
*pDoc-getIDocumentLayoutAccess().GetCurrentViewShell(), 0, 
pOleOut,VSHELLFLAG_SHARELAYOUT );
+pSh = new SwViewShell( 
*pDoc-getIDocumentLayoutAccess().GetCurrentViewShell(), 0, 
rRenderContext,VSHELLFLAG_SHARELAYOUT );
 else
-pSh = new SwViewShell( *pDoc, 0, pOpt, pOleOut);
+pSh = new SwViewShell( *pDoc, 0, pOpt, rRenderContext);
 
 {
 SET_CURR_SHELL( pSh );
@@ -614,11 +614,11 @@ void SwViewShell::PrtOle2( SwDoc *pDoc, const 
SwViewOption *pOpt, const SwPrintD
 // document because the thumbnail creation will not trigger a complete
 // formatting of the document.
 
-pOleOut-Push( PushFlags::CLIPREGION );
-pOleOut-IntersectClipRegion( aSwRect.SVRect() );
+rRenderContext.Push( PushFlags::CLIPREGION );
+rRenderContext.IntersectClipRegion( aSwRect.SVRect() );
 pSh-GetLayout()-Paint( aSwRect );
 
-pOleOut-Pop();
+rRenderContext.Pop();
 // first the CurrShell object needs to be destroyed!
 }
 delete pSh;
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index 55e3b74..e060a1e 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -831,7 +831,7 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup 
rSetup,
 pDev-SetBackground();
 const bool bWeb = this-ISA(SwWebDocShell);
 SwPrintData aOpts;
-SwViewShell::PrtOle2(m_pDoc, SW_MOD()-GetUsrPref(bWeb), aOpts, pDev, 
aRect);
+SwViewShell::PrtOle2(m_pDoc, SW_MOD()-GetUsrPref(bWeb), aOpts, *pDev, 
aRect);
 pDev-Pop();
 
 if( pOrig )
commit f25ee3ce07b942b5b8ec3d24d05ac4037f1cb9d0
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jun 24 09:34:00 2015 +0200

SwViewShell::Paint: can use render context here directly

Change-Id: I75a532e85ce4caa3fe199669054a9811e3e5144a

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index ea4fc5d2..009f6e4 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1777,11 +1777,11 @@ void SwViewShell::Paint(vcl::RenderContext 
rRenderContext, const Rectangle rRe
 const vcl::Region aDLRegion(rRect);
 DLPrePaint2(aDLRegion);
 
-mpOut-Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
-mpOut-SetFillColor( Imp()-GetRetoucheColor() );
-mpOut-SetLineColor();
-mpOut-DrawRect( rRect );
-mpOut-Pop();
+rRenderContext.Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
+rRenderContext.SetFillColor( Imp()-GetRetoucheColor() );
+rRenderContext.SetLineColor();
+rRenderContext.DrawRect( rRect );
+rRenderContext.Pop();
 // #i68597#
 DLPostPaint2(true);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2015-06-19 Thread Michael Stahl
 sw/inc/authfld.hxx   |2 -
 sw/inc/fldbas.hxx|2 -
 sw/source/core/fields/fldbas.cxx |6 
 sw/source/filter/ww8/docxattributeoutput.cxx |4 ++
 sw/source/filter/ww8/ww8atr.cxx  |   37 ---
 5 files changed, 37 insertions(+), 14 deletions(-)

New commits:
commit f56289ac6d7f3da7fd45dd431ce4c540aadcad56
Author: Michael Stahl mst...@redhat.com
Date:   Sat Jun 13 00:37:39 2015 +0200

tdf#88697: sw: make WW8 export of CITATION fields compatible with

... older versions of Word and LO.

Based on a prototype patch by Yury yury.tarasiev...@gmail.com

The problem is that Word 2003 does not understand the new CITATION field
added in commit 06f7d1a96eef5aa69d4872ff6d96eb5085296d09.

Word 2010 does appear to at least recognize it as a field.

Also fix the textual field type, which was omitted for CITATION fields,
except when the document was imported from DOCX.

Change-Id: I62b13a4f585dce535d587555b357ab7e4ef0e460

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 616de7b..e669d79 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1828,6 +1828,27 @@ WW8_WrPlcField* WW8Export::CurrentFieldPlc() const
 void WW8Export::OutputField( const SwField* pField, ww::eField eFieldType,
 const OUString rFieldCmd, sal_uInt8 nMode )
 {
+OUString sFieldCmd(rFieldCmd);
+switch (eFieldType)
+{
+// map fields that are not supported in WW8 as of Word 2003
+case ww::eBIBLIOGRPAHY:
+eFieldType = ww::eQUOTE;
+assert(rFieldCmd == FieldString(ww::eBIBLIOGRPAHY));
+sFieldCmd = FieldString(ww::eQUOTE);
+break;
+case ww::eCITATION:
+eFieldType = ww::eQUOTE;
+assert(rFieldCmd.startsWith(FieldString(ww::eCITATION)));
+sFieldCmd = rFieldCmd.replaceFirst(FieldString(ww::eCITATION),
+   FieldString(ww::eQUOTE));
+break;
+default:
+break;
+}
+
+assert(eFieldType = 0x5F); // 95 is the highest documented one
+
 bool bUnicode = IsUnicode();
 WW8_WrPlcField* pFieldP = CurrentFieldPlc();
 
@@ -1845,10 +1866,10 @@ void WW8Export::OutputField( const SwField* pField, 
ww::eField eFieldType,
 if (WRITEFIELD_CMD_START  nMode)
 {
 if (bUnicode)
-SwWW8Writer::WriteString16(Strm(), rFieldCmd, false);
+SwWW8Writer::WriteString16(Strm(), sFieldCmd, false);
 else
 {
-SwWW8Writer::WriteString8(Strm(), rFieldCmd, false,
+SwWW8Writer::WriteString8(Strm(), sFieldCmd, false,
 RTL_TEXTENCODING_MS_1252);
 }
 // #i43956# - write hyperlink character including
@@ -1901,7 +1922,7 @@ void WW8Export::OutputField( const SwField* pField, 
ww::eField eFieldType,
 if( pField )
 sOut = lcl_GetExpandedField(*pField);
 else
-sOut = rFieldCmd;
+sOut = sFieldCmd;
 if( !sOut.isEmpty() )
 {
 if( bUnicode )
@@ -2902,8 +2923,15 @@ void AttributeOutputBase::TextField( const 
SwFormatField rField )
 break;
 case RES_AUTHORITY:
 {
-OUString const sRet(static_castSwAuthorityField const*(pField)
+OUString sRet(static_castSwAuthorityField const*(pField)
 -ExpandCitation(AUTH_FIELD_IDENTIFIER));
+// FIXME: DomainMapper_Impl::CloseFieldCommand() stuffs fully formed
+// field instructions in here, but if the field doesn't originate
+// from those filters it won't have that
+if (!sRet.trim().startsWith(CITATION))
+{
+sRet = FieldString(ww::eCITATION) +  \ + sRet + \;
+}
 GetExport().OutputField( pField, ww::eCITATION, sRet );
 }
 break;
commit 8ee3cb95638f25fea8dc85e2dc5eec89ea41fc38
Author: Michael Stahl mst...@redhat.com
Date:   Fri Jun 19 13:55:12 2015 +0200

sw: remove the SwField::ExpandCitation disaster

Change-Id: I3adf4182ad77bfd1af3737f640e9d3fe6db5dfc9

diff --git a/sw/inc/authfld.hxx b/sw/inc/authfld.hxx
index 11ce33e..73e1d09 100644
--- a/sw/inc/authfld.hxx
+++ b/sw/inc/authfld.hxx
@@ -155,7 +155,7 @@ public:
 OUString ConditionalExpand(ToxAuthorityField eField) const;
 
 //To handle Citation
-OUString ExpandCitation(ToxAuthorityField eField) const;
+SW_DLLPUBLIC OUString ExpandCitation(ToxAuthorityField eField) const;
 
 SwAuthorityField(SwAuthorityFieldType* pType, const OUString 
rFieldContents);
 SwAuthorityField(SwAuthorityFieldType* pType, sal_IntPtr nHandle);
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index 7447fdb..6406fae 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -319,8 +319,6 @@ public:
   */
 OUStringExpandField(bool const 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2015-06-08 Thread Michael Stahl
 sw/inc/crsrsh.hxx  |3 --
 sw/source/core/crsr/crsrsh.cxx |   58 -
 2 files changed, 25 insertions(+), 36 deletions(-)

New commits:
commit a874d2a9f66d69aa69f36393de94c803ffa3eaa7
Author: Michael Stahl mst...@redhat.com
Date:   Mon Jun 8 23:30:33 2015 +0200

sw: remove unused CrsrFlag::NOCALRECT

Change-Id: I985ac3eea9ebb780821ab4fffd460935be5e536d

diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index b513fc1..17cf27b 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -156,8 +156,7 @@ public:
 UPDOWN  = (1  0), /// keep Up/Down on columns
 SCROLLWIN   = (1  1), /// scroll window
 CHKRANGE= (1  2), /// check overlapping PaMs
-NOCALRECT   = (1  3), /// don't recalculate CharRect
-READONLY= (1  4)  /// make visible in spite of Readonly
+READONLY= (1  3)  /// make visible in spite of Readonly
 };
 
 private:
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index e6b6680..c01966b 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1724,44 +1724,36 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, bool 
bIdleEnd )
 }
 } while( bAgainst );
 
-if( !( eFlags  SwCrsrShell::NOCALRECT ))
-{
-SwCrsrMoveState aTmpState( m_eMvState );
-aTmpState.bSetInReadOnly = IsReadOnlyAvailable();
-aTmpState.bRealHeight = true;
-aTmpState.bRealWidth = IsOverwriteCrsr();
-aTmpState.nCursorBidiLevel = pShellCrsr-GetCrsrBidiLevel();
-
-// #i27615#,#i30453#
-SwSpecialPos aSpecialPos;
-aSpecialPos.nExtendRange = SwSPExtendRange::BEFORE;
-if (pShellCrsr-IsInFrontOfLabel())
-{
-aTmpState.pSpecialPos = aSpecialPos;
-}
+SwCrsrMoveState aTmpState( m_eMvState );
+aTmpState.bSetInReadOnly = IsReadOnlyAvailable();
+aTmpState.bRealHeight = true;
+aTmpState.bRealWidth = IsOverwriteCrsr();
+aTmpState.nCursorBidiLevel = pShellCrsr-GetCrsrBidiLevel();
 
-++mnStartAction; // tdf#91602 prevent recursive Action!
-if( !pFrm-GetCharRect( m_aCharRect, *pShellCrsr-GetPoint(), 
aTmpState ) )
-{
-Point rPt = pShellCrsr-GetPtPos();
-rPt = m_aCharRect.Center();
-pFrm-GetCrsrOfst( pShellCrsr-GetPoint(), rPt, aTmpState );
-}
---mnStartAction;
+// #i27615#,#i30453#
+SwSpecialPos aSpecialPos;
+aSpecialPos.nExtendRange = SwSPExtendRange::BEFORE;
+if (pShellCrsr-IsInFrontOfLabel())
+{
+aTmpState.pSpecialPos = aSpecialPos;
+}
 
-if( !pShellCrsr-HasMark() )
-m_aCrsrHeight = aTmpState.aRealHeight;
-else
-{
-m_aCrsrHeight.setX(0);
-m_aCrsrHeight.setY(aTmpState.aRealHeight.getY()  0 ?
-  -m_aCharRect.Width() : m_aCharRect.Height());
-}
+++mnStartAction; // tdf#91602 prevent recursive Action!
+if( !pFrm-GetCharRect( m_aCharRect, *pShellCrsr-GetPoint(), 
aTmpState ) )
+{
+Point rPt = pShellCrsr-GetPtPos();
+rPt = m_aCharRect.Center();
+pFrm-GetCrsrOfst( pShellCrsr-GetPoint(), rPt, aTmpState );
 }
+--mnStartAction;
+
+if( !pShellCrsr-HasMark() )
+m_aCrsrHeight = aTmpState.aRealHeight;
 else
 {
 m_aCrsrHeight.setX(0);
-m_aCrsrHeight.setY(m_aCharRect.Height());
+m_aCrsrHeight.setY(aTmpState.aRealHeight.getY()  0 ?
+  -m_aCharRect.Width() : m_aCharRect.Height());
 }
 
 if( !bFirst  aOld == m_aCharRect )
commit 238e07ddca879e0951bef6391fdc5c3fc26bded5
Author: Michael Stahl mst...@redhat.com
Date:   Mon Jun 8 23:28:11 2015 +0200

tdf#91917 tdf#91602: avoid layout recursion differently

(regression from 587006cac508616f486aea45e265a170bcccdc87)

Change-Id: I38e00a7469243088e25aa1a91e3581240b3bbdea

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 0b8aba3..e6b6680 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -284,10 +284,6 @@ void SwCrsrShell::EndAction( const bool bIdleEnd, const 
bool DoSetPosX )
 }
 return;
 }
-else
-{
-eFlags |= SwCrsrShell::NOCALRECT; // tdf#91602 prevent recursive 
Action!
-}
 
 if ( !bIdleEnd )
 eFlags |= SwCrsrShell::SCROLLWIN;
@@ -1744,12 +1740,14 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, bool 
bIdleEnd )
 aTmpState.pSpecialPos = aSpecialPos;
 }
 
+++mnStartAction; // tdf#91602 prevent recursive Action!
 if( 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2015-06-05 Thread Michael Stahl
 sw/inc/index.hxx  |2 +-
 sw/inc/pam.hxx|4 ++--
 sw/source/filter/ww8/writerhelper.cxx |   22 +-
 sw/source/filter/ww8/writerhelper.hxx |4 
 sw/source/filter/ww8/wrtww8.cxx   |3 +++
 5 files changed, 31 insertions(+), 4 deletions(-)

New commits:
commit ab706f85bb777ba160712c072c9d2a08ebcddcc6
Author: Michael Stahl mst...@redhat.com
Date:   Fri Jun 5 15:32:32 2015 +0200

sw: WW8 export: avoid invalidated positions in sw::Frames

When exporting ooo67907-1.doc we get ~SwIndexReg assert because there's
a frame anchored in a redline, and the SwPosition in the sw::Frame for
it is invalidated during SetRedlineMode because the node it points to is
deleted.  Add another horrible workaround to the redline trainwreck.

Change-Id: Ia9b2393c77f42502862daaa30fd54eb3b040a214

diff --git a/sw/source/filter/ww8/writerhelper.cxx 
b/sw/source/filter/ww8/writerhelper.cxx
index f6b0b08..e8db7a7 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -126,7 +126,11 @@ namespace
 
 if (const SwPosition* pAnchor = 
rEntry.GetAnchor().GetContentAnchor())
 {
-aRet.push_back(sw::Frame(rEntry, *pAnchor));
+// the anchor position will be invalidated by SetRedlineMode
+// so set a dummy position and fix it in UpdateFramePositions
+SwPosition const dummy(SwNodeIndex(
+const_castSwNodes(pAnchor-nNode.GetNodes(;
+aRet.push_back(sw::Frame(rEntry, dummy));
 }
 else
 {
@@ -522,6 +526,22 @@ namespace sw
 return aRet;
 }
 
+void UpdateFramePositions(Frames  rFrames)
+{
+for (Frame  rFrame : rFrames)
+{
+SwFormatAnchor const rAnchor = 
rFrame.GetFrameFormat().GetAnchor();
+if (SwPosition const*const pAnchor = 
rAnchor.GetContentAnchor())
+{
+rFrame.SetPosition(*pAnchor);
+}
+else
+{   // these don't need to be corrected, they're not in 
redlines
+assert(FLY_AT_PAGE == rAnchor.GetAnchorId());
+}
+}
+}
+
 Frames GetFramesInNode(const Frames rFrames, const SwNode rNode)
 {
 Frames aRet;
diff --git a/sw/source/filter/ww8/writerhelper.hxx 
b/sw/source/filter/ww8/writerhelper.hxx
index cdefebc..c80e119 100644
--- a/sw/source/filter/ww8/writerhelper.hxx
+++ b/sw/source/filter/ww8/writerhelper.hxx
@@ -126,6 +126,7 @@ namespace sw
 The anchor position of this frame
 */
 const SwPosition GetPosition() const { return maPos; }
+void SetPosition(SwPosition const rPos) { maPos = rPos; }
 
 /** Get the node this frame is anchored into
 
@@ -633,6 +634,9 @@ namespace sw
 */
 Frames GetFrames(const SwDoc rDoc, SwPaM *pPaM = 0);
 
+/** fix up frame positions, must be called after SetRedlineMode */
+void UpdateFramePositions(Frames  rFrames);
+
 /** Get the Frames anchored to a given node
 
 Given a container of frames, find the ones anchored to a given node
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 78168f3..432a287 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3060,6 +3060,9 @@ void MSWordExportBase::ExportDocument( bool bWriteAll )
  
nsRedlineMode_t::REDLINE_SHOW_INSERT);
 }
 
+// fix the SwPositions in m_aFrames after SetRedlineMode
+UpdateFramePositions(m_aFrames);
+
 m_aFontHelper.InitFontTable( SupportsUnicode(), *m_pDoc );
 GatherChapterFields();
 
commit f1ecbd9e3541cbe0b8ae1075ab158f5e3f4a651a
Author: Michael Stahl mst...@redhat.com
Date:   Fri Jun 5 14:41:08 2015 +0200

sw: let's export the debug-logging stuff so msword filters can use it

Change-Id: I2caec82a89e44ee60bb49c6c0069dc30c8de400f

diff --git a/sw/inc/index.hxx b/sw/inc/index.hxx
index 3330861..e430fa8 100644
--- a/sw/inc/index.hxx
+++ b/sw/inc/index.hxx
@@ -109,7 +109,7 @@ public:
 void SetMark(const sw::mark::IMark* pMark);
 };
 
-std::ostream operator (std::ostream s, const SwIndex index);
+SW_DLLPUBLIC std::ostream operator (std::ostream s, const SwIndex index);
 
 class SwIndexReg
 {
diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx
index 4518954..40715b4 100644
--- a/sw/inc/pam.hxx
+++ b/sw/inc/pam.hxx
@@ -77,7 +77,7 @@ struct SW_DLLPUBLIC SwPosition
 void dumpAsXml(struct _xmlTextWriter* pWriter) const;
 };
 
-std::ostream operator (std::ostream s, const SwPosition position);
+SW_DLLPUBLIC std::ostream operator (std::ostream s, const SwPosition 
position);
 
 // Result of comparing positions.
 enum SwComparePosition {
@@ -322,7 +322,7 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2015-06-03 Thread Miklos Vajna
 sw/inc/dbmgr.hxx |   10 ++
 sw/inc/swdbdata.hxx  |6 +---
 sw/source/core/doc/doc.cxx   |9 --
 sw/source/core/doc/docfmt.cxx|1 
 sw/source/core/doc/docnew.cxx|5 +++
 sw/source/uibase/dbui/dbmgr.cxx  |   39 ---
 sw/source/uibase/uno/SwXDocumentSettings.cxx |   10 +++---
 7 files changed, 57 insertions(+), 23 deletions(-)

New commits:
commit d611b2e0b2b713ffaf8b2ec75e6a74180316f50b
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jun 3 19:11:57 2015 +0200

sw: add SwDBManager::RevokeDataSource()

And call it from the SwDoc dtor, so that embedded data source
definitions registered on opening are deregistered on close.

Change-Id: I40309389d44dcbc225f6f2ef98bb20579e12d650

diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx
index e397e57..657e957 100644
--- a/sw/inc/dbmgr.hxx
+++ b/sw/inc/dbmgr.hxx
@@ -376,6 +376,9 @@ public:
 /// Load the embedded data source of the document and also register it.
 void LoadAndRegisterEmbeddedDataSource(const SwDBData rData, const 
SwDocShell rDocShell);
 
+/// Unregister a data source.
+static void RevokeDataSource(const OUString rName);
+
 /** try to get the data source from the given connection through the 
XChild interface.
 If this is not possible, the data source will be created through its 
name.
 @param _xConnection
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index ec44cb5..302ebef 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -540,6 +540,11 @@ SwDoc::~SwDoc()
 mpCharFormatTable-erase( mpCharFormatTable-begin() );
 
 #if HAVE_FEATURE_DBCONNECTIVITY
+// On load, SwDBManager::setEmbeddedName() may register a data source.
+// If we have an embedded one, then sDataSoure points to the registered 
name, so revoke it here.
+if (!mpDBManager-getEmbeddedName().isEmpty()  
!maDBData.sDataSource.isEmpty())
+SwDBManager::RevokeDataSource(maDBData.sDataSource);
+
 DELETEZ( mpDBManager );
 #endif
 
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index b138730..d59d78b 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -2663,6 +2663,13 @@ OUString SwDBManager::LoadAndRegisterDataSource(const 
OUString rURI, const OUSt
 return LoadAndRegisterDataSource( type, aURLAny, pSettings, rURI, pPrefix, 
pDestDir );
 }
 
+void SwDBManager::RevokeDataSource(const OUString rName)
+{
+uno::Referencesdb::XDatabaseContext xDatabaseContext = 
sdb::DatabaseContext::create(comphelper::getProcessComponentContext());
+if (xDatabaseContext-hasByName(rName))
+xDatabaseContext-revokeObject(rName);
+}
+
 void SwDBManager::LoadAndRegisterEmbeddedDataSource(const SwDBData rData, 
const SwDocShell rDocShell)
 {
 uno::Referencesdb::XDatabaseContext xDatabaseContext = 
sdb::DatabaseContext::create(comphelper::getProcessComponentContext());
@@ -2673,8 +2680,7 @@ void SwDBManager::LoadAndRegisterEmbeddedDataSource(const 
SwDBData rData, const
 if (sDataSource.isEmpty())
 sDataSource = EmbeddedDatabase;
 
-if (xDatabaseContext-hasByName(rData.sDataSource))
-xDatabaseContext-revokeObject(rData.sDataSource);
+SwDBManager::RevokeDataSource(rData.sDataSource);
 
 // Encode the stream name and the real path into a single URL.
 const INetURLObject rURLObject = rDocShell.GetMedium()-GetURLObject();
commit b79017f49a487a3981b1cd9f488ed5062eeb880b
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jun 3 18:54:08 2015 +0200

sw: move name of the embedded data source def from SwDBData to SwDBManager

The problem is that SwDBData just describes the current data source,
and when changing that, the embedded name doesn't change, so they should
be separate.

Change-Id: I2dd7e0a97b9f7d6a3a74a5752467515a0a09171a

diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx
index 27c86a7..e397e57 100644
--- a/sw/inc/dbmgr.hxx
+++ b/sw/inc/dbmgr.hxx
@@ -199,6 +199,8 @@ friend class SwConnectionDisposedListener_Impl;
 SwDSParamArraDataSourceParams;
 SwDBManager_Impl*pImpl;
 const SwXMailMerge* pMergeEvtSrc;   /// != 0 if mail merge events are to 
be send
+/// Name of the embedded database that's included in the current document.
+OUString m_sEmbeddedName;
 
 SAL_DLLPRIVATE SwDSParam*  FindDSData(const SwDBData rData, bool 
bCreate);
 SAL_DLLPRIVATE SwDSParam*  FindDSConnection(const OUString 
rSource, bool bCreate);
@@ -372,7 +374,7 @@ public:
  const 
::com::sun::star::uno::Reference  ::com::sun::star::beans::XPropertySet  
*pSettings = 0);
 
 /// Load the embedded data source of the document and also register it.
-static void 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2015-05-03 Thread Katarina Behrens
 sw/inc/IDocumentFieldsAccess.hxx |2 -
 sw/inc/doc.hxx   |6 ++--
 sw/inc/docary.hxx|6 ++--
 sw/inc/editsh.hxx|   10 +++
 sw/source/core/doc/DocumentFieldsManager.cxx |4 +--
 sw/source/core/doc/doc.cxx   |2 -
 sw/source/core/doc/docfmt.cxx|   12 -
 sw/source/core/docnode/ndsect.cxx|4 +--
 sw/source/core/edit/edsect.cxx   |   10 +++
 sw/source/core/fields/dbfld.cxx  |4 +--
 sw/source/core/inc/DocumentFieldsManager.hxx |2 -
 sw/source/core/tox/tox.cxx   |2 -
 sw/source/core/undo/rolbck.cxx   |   15 ---
 sw/source/core/undo/unattr.cxx   |   22 -
 sw/source/core/undo/undobj1.cxx  |4 +--
 sw/source/core/undo/unfmco.cxx   |5 +--
 sw/source/core/undo/untbl.cxx|6 ++--
 sw/source/core/undo/untblk.cxx   |6 ++--
 sw/source/core/unocore/unosect.cxx   |4 +--
 sw/source/filter/basflt/shellio.cxx  |2 -
 sw/source/filter/ww8/wrtw8esh.cxx|2 -
 sw/source/filter/ww8/wrtw8num.cxx|2 -
 sw/source/ui/dialog/uiregionsw.cxx   |   34 +--
 sw/source/ui/frmdlg/column.cxx   |2 -
 sw/source/uibase/dbui/dbmgr.cxx  |4 +--
 sw/source/uibase/inc/regionsw.hxx|2 -
 26 files changed, 85 insertions(+), 89 deletions(-)

New commits:
commit 98436c4b53639d86f261ac630c46d32e3c7b8e28
Author: Katarina Behrens katarina.behr...@cib.de
Date:   Sun May 3 23:25:52 2015 +0200

tdf#89783: Adjust to new GetPos retval (size_t vs. sal_uInt16)

Some of the usages of GetPos were just misusing it to find out
whether a vector contains given element -- use Contains() in those
cases

This patch is partially based on work of Christoph Lutz

Conflicts:
sw/source/filter/ww8/wrtw8esh.cxx
sw/source/filter/ww8/wrtw8num.cxx

Change-Id: I40bedba905e7577ba23f69acee178e0ea7cc1521

diff --git a/sw/inc/IDocumentFieldsAccess.hxx b/sw/inc/IDocumentFieldsAccess.hxx
index f0859a3..36c0129 100644
--- a/sw/inc/IDocumentFieldsAccess.hxx
+++ b/sw/inc/IDocumentFieldsAccess.hxx
@@ -54,7 +54,7 @@ namespace com { namespace sun { namespace star { namespace 
uno { class Any; } }
 
 virtual SwFieldType* GetFldType(sal_uInt16 nResId, const OUString rName, 
bool bDbFieldMatching) const = 0;
 
-virtual void RemoveFldType(sal_uInt16 nFld) = 0;
+virtual void RemoveFldType(size_t nFld) = 0;
 
 virtual void UpdateFlds( SfxPoolItem* pNewHt, bool bCloseDB) = 0;
 
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index c935ede..2dab95b 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -826,7 +826,7 @@ public:
 SwCharFmt *MakeCharFmt(const OUString rFmtName, SwCharFmt *pDerivedFrom,
bool bBroadcast = false,
bool bAuto = true );
-void   DelCharFmt(sal_uInt16 nFmt, bool bBroadcast = false);
+void   DelCharFmt(size_t nFmt, bool bBroadcast = false);
 void   DelCharFmt(SwCharFmt* pFmt, bool bBroadcast = false);
 SwCharFmt* FindCharFmtByName( const OUString rName ) const
 {   return static_castSwCharFmt*(FindFmtByName( 
(SwFmtsBase)*mpCharFmtTbl, rName )); }
@@ -844,7 +844,7 @@ public:
 SwConditionTxtFmtColl* MakeCondTxtFmtColl( const OUString rFmtName,
SwTxtFmtColl *pDerivedFrom,
bool bBroadcast = false);
-void DelTxtFmtColl(sal_uInt16 nFmt, bool bBroadcast = false);
+void DelTxtFmtColl(size_t nFmt, bool bBroadcast = false);
 void DelTxtFmtColl( SwTxtFmtColl* pColl, bool bBroadcast = false );
 /** Add 4th optional parameter bResetListAttrs.
  'side effect' of SetTxtFmtColl with bReset = true is that the hard
diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx 
b/sw/source/core/doc/DocumentFieldsManager.cxx
index e1746a2..847a96b 100644
--- a/sw/source/core/doc/DocumentFieldsManager.cxx
+++ b/sw/source/core/doc/DocumentFieldsManager.cxx
@@ -290,13 +290,13 @@ SwFieldType* DocumentFieldsManager::GetFldType(
 }
 
 /// Remove field type
-void DocumentFieldsManager::RemoveFldType(sal_uInt16 nFld)
+void DocumentFieldsManager::RemoveFldType(size_t nFld)
 {
 OSL_ENSURE( INIT_FLDTYPES = nFld,  don't remove InitFlds );
 /*
  * Dependent fields present - ErrRaise
  */
-sal_uInt16 nSize = mpFldTypes-size();
+size_t nSize = mpFldTypes-size();
 if(nFld  nSize)
 {
 SwFieldType* pTmp = (*mpFldTypes)[nFld];
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 08bb056..1dbcb13 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -667,7 +667,7 @@ const SfxPoolItem 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2015-05-01 Thread Jan Holesovsky
 sw/inc/ndtyp.hxx |8 +++-
 sw/inc/node.hxx  |   17 +
 sw/source/core/doc/docnew.cxx|2 +-
 sw/source/core/docnode/nodes.cxx |   18 +-
 4 files changed, 22 insertions(+), 23 deletions(-)

New commits:
commit befe83a707e8faf37094523550dfa5bcf87be279
Author: Jan Holesovsky ke...@collabora.com
Date:   Thu Apr 30 12:59:15 2015 +0200

sw: Decouple ND_SECTIONDUMMY from ND_SECTIONNODE, and rename it.

Change-Id: Ic88a133d20336ce0548154847edd9900cb5b7691

diff --git a/sw/inc/ndtyp.hxx b/sw/inc/ndtyp.hxx
index c62f706..cbf71ab 100644
--- a/sw/inc/ndtyp.hxx
+++ b/sw/inc/ndtyp.hxx
@@ -26,13 +26,12 @@
 // in base class.
 const sal_uInt8 ND_ENDNODE  = 0x01;
 const sal_uInt8 ND_STARTNODE= 0x02;
-const sal_uInt8 ND_TABLENODE= 0x04 | ND_STARTNODE; // SwTableNode is 
derived from SwStartNode
+const sal_uInt8 ND_TABLENODE= 0x04 | ND_STARTNODE; /// SwTableNode is 
derived from SwStartNode.
 const sal_uInt8 ND_TEXTNODE = 0x08;
 const sal_uInt8 ND_GRFNODE  = 0x10;
 const sal_uInt8 ND_OLENODE  = 0x20;
-const sal_uInt8 ND_SECTIONDUMMY = 0x40; //(ND_SECTIONNODE  ~ND_STARTNODE);
-
-const sal_uInt8 ND_SECTIONNODE  = ND_SECTIONDUMMY | ND_STARTNODE;
+const sal_uInt8 ND_SECTIONNODE  = 0x40 | ND_STARTNODE; /// SwSectionNode is 
derived from SwStartNode.
+const sal_uInt8 ND_PLACEHOLDER  = 0x80;
 
 // NoTxtNode (if any of the 2 bits are set).
 const sal_uInt8 ND_NOTXTNODE= ND_GRFNODE | ND_OLENODE;
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index 51bfb2e..d7621be 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -567,15 +567,16 @@ public:
 
 };
 
-/** This class is internal. And quite frankly I don't know what 
ND_SECTIONDUMMY is for,
-   the class has been merely created to replace SwNode( ND_SECTIONDUMMY ), 
the only case
-   of instantiating SwNode directly. Now SwNode can be an abstract base class. 
*/
-class SwDummySectionNode
-: private SwNode
+/** This class is internal, used only during 
DocumentContentOperationsManager::CopyWithFlyInFly(), and for undo.
+
+Some of the nodes are then replaced with SwPlaceholderNode, and at the end of 
the operation, removed again.
+FIXME find out if this is really necessary, and if we can avoid creation of 
the SwPlaceholderNodes in the first place.
+*/
+class SwPlaceholderNode : private SwNode
 {
 private:
 friend class SwNodes;
-SwDummySectionNode( const SwNodeIndex rWhere );
+SwPlaceholderNode(const SwNodeIndex rWhere);
 };
 
 inline   SwEndNode   *SwNode::GetEndNode()
@@ -731,8 +732,8 @@ inline const SfxPoolItem SwCntntNode::GetAttr( sal_uInt16 
nWhich,
 return GetSwAttrSet().Get( nWhich, bInParents );
 }
 
-inline SwDummySectionNode::SwDummySectionNode( const SwNodeIndex rWhere )
-: SwNode( rWhere, ND_SECTIONDUMMY )
+inline SwPlaceholderNode::SwPlaceholderNode(const SwNodeIndex rWhere)
+: SwNode(rWhere, ND_PLACEHOLDER)
 {
 }
 
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 05ec76d..0e945b3 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -942,7 +942,7 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc rSource, 
sal_uInt16 const nStartPageNu
 #endif
 pTargetShell-StartAllAction();
 
-// Otherwise we have to handle SwDummySectionNodes as first node
+// Otherwise we have to handle SwPlaceholderNodes as first node
 if ( pTargetPageDesc ) {
 OUString name = pTargetPageDesc-GetName();
 pTargetShell-InsertPageBreak( name, nStartPageNumber );
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 9a54ec9..0806894 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -622,7 +622,7 @@ bool SwNodes::_MoveNodes( const SwNodeRange aRange, 
SwNodes  rNodes,
 rNodes))
 {
 // use placeholder in UndoNodes array
-new SwDummySectionNode( aIdx );
+new SwPlaceholderNode(aIdx);
 }
 else
 {
@@ -694,7 +694,7 @@ bool SwNodes::_MoveNodes( const SwNodeRange aRange, 
SwNodes  rNodes,
 aIdx -= nInsPos;
 nInsPos = 0;
 }
-new SwDummySectionNode( aIdx );
+new SwPlaceholderNode(aIdx);
 --aRg.aEnd;
 --aIdx;
 break;
@@ -814,7 +814,7 @@ bool SwNodes::_MoveNodes( const SwNodeRange aRange, 
SwNodes  rNodes,
 }
 break;
 
-case ND_SECTIONDUMMY:
+case ND_PLACEHOLDER:
 if (GetDoc()-GetIDocumentUndoRedo().IsUndoNodes(*this))
 {
 if( rNodes == this ) // inside UndoNodesArray
@@ -1753,7 +1753,7 @@ void SwNodes::_CopyNodes( const SwNodeRange rRange,
 
 // 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source sw/util

2015-03-12 Thread Stephan Bergmann
 sw/inc/finalthreadmanager.hxx |   11 ---
 sw/source/core/docnode/finalthreadmanager.cxx |   34 +++
 sw/source/core/inc/unofreg.hxx|   19 --
 sw/source/core/layout/dumpfilter.cxx  |   33 +++
 sw/source/uibase/inc/SwXFilterOptions.hxx |8 --
 sw/source/uibase/inc/unomailmerge.hxx |4 -
 sw/source/uibase/uno/SwXFilterOptions.cxx |   27 +++--
 sw/source/uibase/uno/unoatxt.cxx  |   37 
 sw/source/uibase/uno/unofreg.cxx  |   78 ++
 sw/source/uibase/uno/unomailmerge.cxx |   28 -
 sw/source/uibase/uno/unomod.cxx   |   32 +++---
 sw/util/sw.component  |   17 +++--
 12 files changed, 88 insertions(+), 240 deletions(-)

New commits:
commit 1c363fadccb5b0df92ecf0fa304e547092cba88d
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Mar 12 10:04:52 2015 +0100

Clean up previous commit

Change-Id: I76dbe81308a9a12a04d77a794bb1d11bfb2d5125

diff --git a/sw/inc/finalthreadmanager.hxx b/sw/inc/finalthreadmanager.hxx
index ce51064..babeba5 100644
--- a/sw/inc/finalthreadmanager.hxx
+++ b/sw/inc/finalthreadmanager.hxx
@@ -34,15 +34,6 @@ class CancelJobsThread;
 class TerminateOfficeThread;
 class SwPauseThreadStarting;
 
-// service helper namespace
-namespace comp_FinalThreadManager {
-
-// component and service helper functions:
-OUString SAL_CALL _getImplementationName();
-com::sun::star::uno::Sequence OUString  SAL_CALL _getSupportedServiceNames();
-
-} // closing service helper namespace
-
 class FinalThreadManager : public ::cppu::WeakImplHelper3 
com::sun::star::lang::XServiceInfo,

com::sun::star::util::XJobManager,

com::sun::star::frame::XTerminateListener2 
diff --git a/sw/source/core/docnode/finalthreadmanager.cxx 
b/sw/source/core/docnode/finalthreadmanager.cxx
index 3683f0a..bb7e97f 100644
--- a/sw/source/core/docnode/finalthreadmanager.cxx
+++ b/sw/source/core/docnode/finalthreadmanager.cxx
@@ -284,7 +284,7 @@ FinalThreadManager::~FinalThreadManager()
 // com.sun.star.uno.XServiceInfo:
 OUString SAL_CALL FinalThreadManager::getImplementationName() throw 
(css::uno::RuntimeException, std::exception)
 {
-return comp_FinalThreadManager::_getImplementationName();
+return OUString(com.sun.star.util.comp.FinalThreadManager);
 }
 
 sal_Bool SAL_CALL FinalThreadManager::supportsService(OUString const  
serviceName) throw (css::uno::RuntimeException, std::exception)
@@ -294,7 +294,9 @@ sal_Bool SAL_CALL 
FinalThreadManager::supportsService(OUString const  serviceNa
 
 css::uno::Sequence OUString  SAL_CALL 
FinalThreadManager::getSupportedServiceNames() throw 
(css::uno::RuntimeException, std::exception)
 {
-return comp_FinalThreadManager::_getSupportedServiceNames();
+css::uno::Sequence OUString  s(1);
+s[0] = com.sun.star.util.JobManager;
+return s;
 }
 
 // ::com::sun::star::util::XJobManager:
@@ -442,24 +444,6 @@ void SAL_CALL FinalThreadManager::disposing( const 
css::lang::EventObject ) thr
 // nothing to do, because instance doesn't hold any references of observed 
objects
 }
 
-// component helper namespace
-namespace comp_FinalThreadManager {
-
-OUString SAL_CALL _getImplementationName()
-{
-return OUString(com.sun.star.util.comp.FinalThreadManager);
-}
-
-css::uno::Sequence OUString  SAL_CALL _getSupportedServiceNames()
-{
-css::uno::Sequence OUString  s(1);
-s[0] = com.sun.star.util.JobManager;
-return s;
-}
-
-} // closing component helper namespace
-
-
 extern C SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
 
com_sun_star_util_comp_FinalThreadManager_get_implementation(::com::sun::star::uno::XComponentContext*
 context,
 ::com::sun::star::uno::Sequencecss::uno::Any 
const )
diff --git a/sw/source/core/inc/unofreg.hxx b/sw/source/core/inc/unofreg.hxx
index 0e7d087..962baac 100644
--- a/sw/source/core/inc/unofreg.hxx
+++ b/sw/source/core/inc/unofreg.hxx
@@ -39,22 +39,6 @@ css::uno::Sequence OUString  SAL_CALL 
SwTextDocument_getSupportedServiceNames(
 OUString SAL_CALL SwTextDocument_getImplementationName() throw();
 css::uno::Reference css::uno::XInterface  SAL_CALL 
SwTextDocument_createInstance( const css::uno::Reference 
css::lang::XMultiServiceFactory  rSMgr, const sal_uInt64 _nCreationFlags ) 
throw( css::uno::Exception );
 
-//API objects
-css::uno::Sequence OUString  SAL_CALL 
SwXAutoTextContainer_getSupportedServiceNames() throw();
-OUString SAL_CALL SwXAutoTextContainer_getImplementationName() throw();
-css::uno::Reference css::uno::XInterface  SAL_CALL 
SwXAutoTextContainer_createInstance(const css::uno::Reference 
css::lang::XMultiServiceFactory   rSMgr) throw( css::uno::Exception );
-
-css::uno::Sequence OUString  SAL_CALL 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2015-03-11 Thread Noel Grandin
 sw/inc/IDocumentContentOperations.hxx |2 
 sw/inc/IDocumentMarkAccess.hxx|2 
 sw/inc/crsrsh.hxx |2 
 sw/inc/ndtxt.hxx  |4 
 sw/source/core/crsr/crbm.cxx  |2 
 sw/source/core/doc/DocumentContentOperationsManager.cxx   |6 
 sw/source/core/doc/DocumentLinksAdministrationManager.cxx |2 
 sw/source/core/doc/docbm.cxx  |  100 +++---
 sw/source/core/edit/editsh.cxx|2 
 sw/source/core/inc/DocumentContentOperationsManager.hxx   |2 
 sw/source/core/tox/txmsrt.cxx |2 
 sw/source/core/txtnode/thints.cxx |2 
 sw/source/core/undo/undobj.cxx|8 -
 sw/source/core/unocore/unobkm.cxx |   15 +-
 sw/source/core/unocore/unocoll.cxx|8 -
 sw/source/core/unocore/unocrsrhelper.cxx  |2 
 sw/source/core/unocore/unoobj2.cxx|2 
 sw/source/core/unocore/unoportenum.cxx|3 
 sw/source/core/unocore/unotext.cxx|2 
 sw/source/filter/basflt/fltshell.cxx  |4 
 sw/source/filter/html/swhtml.cxx  |2 
 sw/source/filter/ww8/wrtw8nds.cxx |2 
 sw/source/filter/ww8/ww8par.cxx   |2 
 sw/source/ui/dbui/dbinsdlg.cxx|2 
 sw/source/ui/fldui/fldref.cxx |6 
 sw/source/ui/misc/bookmark.cxx|2 
 sw/source/uibase/dbui/dbmgr.cxx   |2 
 sw/source/uibase/dochdl/swdtflvr.cxx  |8 -
 sw/source/uibase/docvw/edtwin2.cxx|2 
 sw/source/uibase/uiview/viewmdi.cxx   |2 
 sw/source/uibase/utlui/bookctrl.cxx   |2 
 sw/source/uibase/utlui/content.cxx|2 
 sw/source/uibase/utlui/navipi.cxx |4 
 33 files changed, 106 insertions(+), 104 deletions(-)

New commits:
commit 89245da9f49140427a2582e3af03a5cda05c0f95
Author: Noel Grandin n...@peralex.com
Date:   Wed Mar 11 13:39:10 2015 +0200

fix windows build

after my commit 5eea85ec4fa7c458785be749a0e370a0883ff693
convert SwMoveFlags and SwInsertFlags from enum to enum class

Change-Id: If5af977fdd77b82de447b71e166d81fca5840395

diff --git a/sw/inc/IDocumentContentOperations.hxx 
b/sw/inc/IDocumentContentOperations.hxx
index ac1f881..39f9265 100644
--- a/sw/inc/IDocumentContentOperations.hxx
+++ b/sw/inc/IDocumentContentOperations.hxx
@@ -138,7 +138,7 @@ public:
 /** Insert string into existing text node at position rRg.Point().
  */
 virtual bool InsertString(const SwPaM rRg, const OUString,
-  const enum SwInsertFlags nInsertMode = 
SwInsertFlags::EMPTYEXPAND ) = 0;
+  const SwInsertFlags nInsertMode = SwInsertFlags::EMPTYEXPAND ) = 
0;
 
 /** change text to Upper/Lower/Hiragana/Katagana/...
  */
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index e5bf4b8..3973cb3 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -246,7 +246,7 @@ public:
 /// of the node, the longest prefix that fits is inserted
 /// @return the prefix of rStr that was actually inserted
 OUString InsertText( const OUString  rStr, const SwIndex  rIdx,
- const enum SwInsertFlags nMode
+ const SwInsertFlags nMode
  = SwInsertFlags::DEFAULT );
 
 /** delete text content
@@ -254,7 +254,7 @@ public:
an attribute with both extent and dummy char
  */
 void EraseText ( const SwIndex rIdx, const sal_Int32 nCount = 
SAL_MAX_INT32,
- const enum SwInsertFlags nMode = SwInsertFlags::DEFAULT );
+ const SwInsertFlags nMode = SwInsertFlags::DEFAULT );
 
 /** delete all attributes.
 If neither pSet nor nWhich is given, delete all attributes (except
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 39d6d81..2f8066e 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -87,7 +87,7 @@ void SwEditShell::Insert2(const OUString rStr, const bool 
bForceExpandHints )
 {
 StartAllAction();
 {
-const enum SwInsertFlags nInsertFlags =
+const SwInsertFlags nInsertFlags =
 (bForceExpandHints)
 ? (SwInsertFlags::FORCEHINTEXPAND | SwInsertFlags::EMPTYEXPAND)
 : SwInsertFlags::EMPTYEXPAND;
diff --git a/sw/source/core/inc/DocumentContentOperationsManager.hxx 
b/sw/source/core/inc/DocumentContentOperationsManager.hxx
index c60f47b..c2e72fc 100644
--- 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2015-01-30 Thread Caolán McNamara
 sw/inc/docary.hxx |1 
 sw/inc/redline.hxx|   12 ++---
 sw/source/core/doc/DocumentRedlineManager.cxx |   40 +++---
 sw/source/core/doc/docredln.cxx   |   56 ++
 sw/source/core/txtnode/ndtxt.cxx  |2 
 sw/source/core/undo/unredln.cxx   |2 
 6 files changed, 56 insertions(+), 57 deletions(-)

New commits:
commit 793b2b865e9ea898ddec45ef40658a7a8cace8f1
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Jan 30 16:10:15 2015 +

WaE: silence -Werror=unused-variable

Change-Id: Ie3a2b81ea986dcfaa402030c99ad1314bdc562ac

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index cb5c1e1..18da646 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1062,7 +1062,7 @@ void SwTxtNode::Update(
 // the unused position must not be on a SwTxtNode
 bool const isOneUsed(pRedl-GetBound(true) == 
pRedl-GetPoint());
 
assert(!pRedl-GetBound(!isOneUsed).nNode.GetNode().IsTxtNode());
-assert(!pRedl-GetBound(!isOneUsed).nContent.GetIdxReg());
+assert(!pRedl-GetBound(!isOneUsed).nContent.GetIdxReg()); 
(void)isOneUsed;
 }
 }
 
commit a5a20187c3a5e5956492f932c49501f9547e4915
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Jan 30 15:34:30 2015 +

During DocumentRedlineManager::SetRedlineMode the array becomes unsorted

so GetPos cannot be used safely, so pass down the known index
of the redline and propogate it everywhere the redline goes

This reverts

commit 36e158ce7a0effb130936ba4598a193102faa6a1
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Jan 19 12:09:17 2015 +

if we change the keys we have to resort based on the new keys

which tried to keep the table sorted, but thats no use because
DocumentRedlineManager::SetRedlineMode loops over by index
so sorting the table during the process busts that.

Taking a copy of the entries and looping over that shows another
gadzillion problems.

So try this approach instead.

I imagine it should be possible to calculate the correct
current index of pRedl in DocumentRedlineManager::AppendRedline
but for now assume that we are sorted correctly at that
point and can use GetPos

Change-Id: If092dce185e3b36fd256db390132358cba155847

diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx
index fba92fb..8b36d6a 100644
--- a/sw/inc/docary.hxx
+++ b/sw/inc/docary.hxx
@@ -232,6 +232,7 @@ public:
 using _SwRedlineTbl::size_type;
 using _SwRedlineTbl::operator[];
 using _SwRedlineTbl::empty;
+using _SwRedlineTbl::Resort;
 };
 
 /// Table that holds 'extra' redlines, such as 'table row insert\delete', 
'paragraph moves' etc...
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index 17bc9b7..6ff3358 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -189,8 +189,8 @@ class SW_DLLPUBLIC SwRangeRedline : public SwPaM
 
 void MoveToSection();
 void CopyToSection();
-void DelCopyOfSection();
-void MoveFromSection();
+void DelCopyOfSection(size_t nMyPos);
+void MoveFromSection(size_t nMyPos);
 
 public:
 SwRangeRedline( RedlineType_t eType, const SwPaM rPam );
@@ -260,10 +260,10 @@ public:
 // hide the Del-Redlines via Copy and Delete.
 // Otherwise at Move the attribution would be handled incorrectly.
 // All other callers must always give 0.
-void CallDisplayFunc( sal_uInt16 nLoop = 0 );
-void Show( sal_uInt16 nLoop = 0 );
-void Hide( sal_uInt16 nLoop = 0 );
-void ShowOriginal( sal_uInt16 nLoop = 0 );
+void CallDisplayFunc(sal_uInt16 nLoop, size_t nMyPos);
+void Show(sal_uInt16 nLoop , size_t nMyPos);
+void Hide(sal_uInt16 nLoop , size_t nMyPos);
+void ShowOriginal(sal_uInt16 nLoop, size_t nMyPos);
 
 /// Calculates the intersection with text node number nNdIdx.
 void CalcStartEnd(sal_uLong nNdIdx, sal_Int32 rStart, sal_Int32 rEnd) 
const;
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index 24d0bdc..873b4d6 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -606,7 +606,7 @@ void DocumentRedlineManager::SetRedlineMode( RedlineMode_t 
eMode )
 bool bSaveInXMLImportFlag = m_rDoc.IsInXMLImport();
 m_rDoc.SetInXMLImport( false );
 // and then hide/display everything
-void (SwRangeRedline::*pFnc)( sal_uInt16 ) = 0;
+void (SwRangeRedline::*pFnc)(sal_uInt16, size_t) = 0;
 
 switch( nsRedlineMode_t::REDLINE_SHOW_MASK  eMode )
 {
@@ -628,10 +628,17 @@ void DocumentRedlineManager::SetRedlineMode( 
RedlineMode_t eMode )
 
 _CHECK_REDLINE( 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2015-01-07 Thread Caolán McNamara
 sw/inc/doc.hxx  |   18 +--
 sw/inc/pagedesc.hxx |2 
 sw/source/core/doc/DocumentTimerManager.cxx |6 -
 sw/source/core/doc/docdesc.cxx  |  147 ++--
 sw/source/core/doc/docfmt.cxx   |   27 +
 sw/source/core/doc/docnew.cxx   |7 -
 sw/source/core/layout/pagedesc.cxx  |6 -
 7 files changed, 94 insertions(+), 119 deletions(-)

New commits:
commit fd0577e6b65cfd948b2fbe16fa1bd06fe0c635b9
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jan 7 13:13:12 2015 +

Resolves: fdo#73165 don't restart timer if already running

If the timer is already running and you restart it then it starts counting 
down
again so the timeout occasion just keeps getting pushed out indefinitely.

Change-Id: I964beb0c4756c7bce1e29bdf06cbe9a593ba79cf

diff --git a/sw/source/core/doc/DocumentTimerManager.cxx 
b/sw/source/core/doc/DocumentTimerManager.cxx
index 5c97d2c..a2ed9c4 100644
--- a/sw/source/core/doc/DocumentTimerManager.cxx
+++ b/sw/source/core/doc/DocumentTimerManager.cxx
@@ -72,9 +72,11 @@ void DocumentTimerManager::UnblockIdling()
 maIdle.Start();
 }
 
-void DocumentTimerManager::StartBackgroundJobs() {
+void DocumentTimerManager::StartBackgroundJobs()
+{
 // Trigger DoIdleJobs(), asynchronously.
-maIdle.Start();
+if (!maIdle.IsActive()) //fdo#73165 if the timer is already running don't 
restart from 0
+maIdle.Start();
 }
 
 IMPL_LINK( DocumentTimerManager, DoIdleJobs, Timer *, pTimer )
commit 28b61d7a2839aebc7458312d312dc6cdb03a8b3f
Author: Michaël Lefèvre lefevr...@yahoo.fr
Date:   Mon Dec 8 17:28:23 2014 +0100

fdo#75757 remove inheritance to std::vector

Conflicts:
sw/source/core/doc/docnew.cxx

Change-Id: I4ba20e689b77e75bea75e5a60f50ff40577183e8

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index bcc89ea..6efdfd49 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -237,13 +237,7 @@ namespace sfx2 {
 class LinkManager;
 }
 
-// PageDescriptor-interface, Array because of inlines.
-class SwPageDescs : public std::vectorSwPageDesc*
-{
-public:
-// the destructor will free all objects still in the vector
-~SwPageDescs();
-};
+typedef boost::ptr_vectorSwPageDesc SwPageDescs;
 
 // forward declaration
 void SetAllScriptItem( SfxItemSet rSet, const SfxPoolItem rItem );
@@ -953,9 +947,9 @@ public:
 
 // PageDescriptor interface.
 sal_uInt16 GetPageDescCnt() const { return maPageDescs.size(); }
-const SwPageDesc GetPageDesc( const sal_uInt16 i ) const { return 
*maPageDescs[i]; }
-SwPageDesc GetPageDesc( sal_uInt16 i ) { return *maPageDescs[i]; }
-SwPageDesc* FindPageDesc(const OUString rName, sal_uInt16* pPos = NULL) 
const;
+const SwPageDesc GetPageDesc( const sal_uInt16 i ) const { return 
maPageDescs[i]; }
+SwPageDesc GetPageDesc( sal_uInt16 i ) { return maPageDescs[i]; }
+SwPageDesc* FindPageDesc(const OUString rName, sal_uInt16* pPos = NULL);
 
 /** Copy the complete PageDesc - beyond document and deep!
  Optionally copying of PoolFmtId, -HlpId can be prevented. */
@@ -1680,9 +1674,9 @@ public:
 
 private:
 // Copies master header to left / first one, if necessary - used by 
ChgPageDesc().
-void CopyMasterHeader(const SwPageDesc rChged, const SwFmtHeader rHead, 
SwPageDesc *pDesc, bool bLeft, bool bFirst);
+void CopyMasterHeader(const SwPageDesc rChged, const SwFmtHeader rHead, 
SwPageDesc pDesc, bool bLeft, bool bFirst);
 // Copies master footer to left / first one, if necessary - used by 
ChgPageDesc().
-void CopyMasterFooter(const SwPageDesc rChged, const SwFmtFooter rFoot, 
SwPageDesc *pDesc, bool bLeft, bool bFirst);
+void CopyMasterFooter(const SwPageDesc rChged, const SwFmtFooter rFoot, 
SwPageDesc pDesc, bool bLeft, bool bFirst);
 
 };
 
diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index b556e9b..c4af052 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -162,7 +162,7 @@ protected:
 
 public:
 OUString GetName() const { return aDescName; }
-bool HasName( const OUString rThisName ) { return aDescName == rThisName; 
}
+bool HasName( const OUString rThisName ) const { return aDescName == 
rThisName; }
 void SetName( const OUString rNewName ) { aDescName = rNewName; }
 
 bool GetLandscape() const { return bLandscape; }
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index a6a2a4a..4f3801d 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -212,24 +212,24 @@ static void lcl_DescSetAttr( const SwFrmFmt rSource, 
SwFrmFmt rDest,
 rDest.SetPoolHlpFileId( rSource.GetPoolHlpFileId() );
 }
 
-void SwDoc::CopyMasterHeader(const SwPageDesc rChged, const SwFmtHeader 
rHead, SwPageDesc *pDesc, bool bLeft, bool bFirst)
+void SwDoc::CopyMasterHeader(const SwPageDesc rChged, const SwFmtHeader 
rHead, SwPageDesc rDesc, bool 

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source writerfilter/source

2014-12-15 Thread Miklos Vajna
 sw/inc/paratr.hxx |2 ++
 sw/source/core/doc/textboxhelper.cxx  |3 ---
 sw/source/core/docnode/nodedump.cxx   |4 +++-
 sw/source/core/para/paratr.cxx|9 +
 sw/source/filter/ww8/docxsdrexport.cxx|6 --
 sw/source/filter/ww8/docxtablestyleexport.cxx |1 -
 sw/source/filter/ww8/rtfattributeoutput.cxx   |   10 --
 sw/source/filter/ww8/rtfexport.cxx|8 
 writerfilter/source/filter/RtfFilter.cxx  |1 -
 9 files changed, 14 insertions(+), 30 deletions(-)

New commits:
commit 0f18e9de72c9e2ba7507a881bbf279eab420cdbc
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Dec 15 08:55:32 2014 +0100

Unused includes

Change-Id: I84e475a64cf09e4eeea524b73f8febf7f0a1a46b

diff --git a/sw/source/core/doc/textboxhelper.cxx 
b/sw/source/core/doc/textboxhelper.cxx
index d0c99df..d447b5b 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -26,9 +26,7 @@
 #include dflyobj.hxx
 #include mvsave.hxx
 #include sortedobjs.hxx
-#include anchoredobject.hxx
 #include cntfrm.hxx
-#include docary.hxx
 
 #include editeng/unoprnms.hxx
 #include editeng/charrotateitem.hxx
@@ -38,7 +36,6 @@
 #include comphelper/sequenceashashmap.hxx
 
 #include com/sun/star/document/XActionLockable.hpp
-#include com/sun/star/table/BorderLine2.hpp
 #include com/sun/star/text/SizeType.hpp
 #include com/sun/star/text/TextContentAnchorType.hpp
 #include com/sun/star/text/WrapTextMode.hpp
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx 
b/sw/source/filter/ww8/docxsdrexport.cxx
index 3e86967..9b05166 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -10,10 +10,6 @@
 #include com/sun/star/drawing/PointSequenceSequence.hpp
 #include com/sun/star/xml/sax/XSAXSerializable.hpp
 #include com/sun/star/xml/sax/Writer.hpp
-#include editeng/lrspitem.hxx
-#include editeng/ulspitem.hxx
-#include editeng/opaqitem.hxx
-#include editeng/shaditem.hxx
 #include editeng/unoprnms.hxx
 #include editeng/charrotateitem.hxx
 #include svx/svdogrp.hxx
@@ -21,14 +17,12 @@
 #include oox/export/utils.hxx
 #include oox/export/vmlexport.hxx
 #include oox/token/properties.hxx
-#include frmfmt.hxx
 #include textboxhelper.hxx
 #include fmtanchr.hxx
 #include fmtsrnd.hxx
 #include fmtcntnt.hxx
 #include ndtxt.hxx
 #include txatbase.hxx
-#include fmtautofmt.hxx
 #include fmtfsize.hxx
 #include drawdoc.hxx
 #include docxsdrexport.hxx
diff --git a/sw/source/filter/ww8/docxtablestyleexport.cxx 
b/sw/source/filter/ww8/docxtablestyleexport.cxx
index 23757dd..53194d1 100644
--- a/sw/source/filter/ww8/docxtablestyleexport.cxx
+++ b/sw/source/filter/ww8/docxtablestyleexport.cxx
@@ -13,7 +13,6 @@
 #include docsh.hxx
 #include oox/token/tokens.hxx
 #include comphelper/sequenceashashmap.hxx
-#include boost/optional.hpp
 
 using namespace com::sun::star;
 using namespace oox;
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index ea0bd99..d6e6115 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -23,15 +23,12 @@
 #include writerwordglue.hxx
 #include ww8par.hxx
 #include fmtcntnt.hxx
-#include fchrfmt.hxx
 #include svtools/rtfkeywd.hxx
 #include editeng/fontitem.hxx
 #include editeng/tstpitem.hxx
 #include editeng/adjustitem.hxx
 #include editeng/spltitem.hxx
 #include editeng/widwitem.hxx
-#include editeng/keepitem.hxx
-#include editeng/brushitem.hxx
 #include editeng/postitem.hxx
 #include editeng/wghtitem.hxx
 #include editeng/kernitem.hxx
@@ -44,8 +41,6 @@
 #include editeng/fhgtitem.hxx
 #include editeng/colritem.hxx
 #include editeng/hyphenzoneitem.hxx
-#include editeng/ulspitem.hxx
-#include editeng/boxitem.hxx
 #include editeng/contouritem.hxx
 #include editeng/shdditem.hxx
 #include editeng/autokernitem.hxx
@@ -55,11 +50,8 @@
 #include editeng/charrotateitem.hxx
 #include editeng/charreliefitem.hxx
 #include editeng/paravertalignitem.hxx
-#include editeng/frmdiritem.hxx
 #include editeng/blinkitem.hxx
 #include editeng/charhiddenitem.hxx
-#include editeng/shaditem.hxx
-#include editeng/opaqitem.hxx
 #include svx/fmglob.hxx
 #include svx/svdouno.hxx
 #include filter/msfilter/rtfutil.hxx
@@ -68,8 +60,6 @@
 #include drawdoc.hxx
 #include docufld.hxx
 #include fmtclds.hxx
-#include fmtinfmt.hxx
-#include fmtftn.hxx
 #include fmtrowsplt.hxx
 #include fmtline.hxx
 #include fmtanchr.hxx
diff --git a/sw/source/filter/ww8/rtfexport.cxx 
b/sw/source/filter/ww8/rtfexport.cxx
index fc7acc1..7cdd3da 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -27,19 +27,12 @@
 #include viewopt.hxx
 #include ndtxt.hxx
 #include fmtpdsc.hxx
-#include section.hxx
-#include pagedesc.hxx
 #include ftninfo.hxx
 #include fmthdft.hxx
 #include editeng/colritem.hxx
 #include editeng/udlnitem.hxx
-#include editeng/boxitem.hxx

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2014-11-26 Thread Noel Grandin
 sw/inc/pagedesc.hxx  |2 
 sw/inc/unotbl.hxx|   15 ++---
 sw/source/core/inc/frame.hxx |4 -
 sw/source/core/inc/layfrm.hxx|6 +-
 sw/source/core/inc/txtfrm.hxx|6 +-
 sw/source/core/text/frmform.cxx  |4 -
 sw/source/core/txtnode/atrflyin.cxx  |   18 +++---
 sw/source/core/txtnode/atrftn.cxx|6 +-
 sw/source/core/txtnode/fmtatr2.cxx   |7 +-
 sw/source/core/txtnode/fntcache.cxx  |2 
 sw/source/core/txtnode/fntcap.cxx|2 
 sw/source/core/txtnode/ndhints.cxx   |4 -
 sw/source/core/txtnode/ndtxt.cxx |   10 +--
 sw/source/core/txtnode/swfntcch.cxx  |2 
 sw/source/core/txtnode/swfont.cxx|   14 ++---
 sw/source/core/txtnode/thints.cxx|   74 +--
 sw/source/core/txtnode/txtedt.cxx|4 -
 sw/source/core/undo/SwUndoFmt.cxx|   28 +-
 sw/source/core/undo/SwUndoPageDesc.cxx   |   18 +++---
 sw/source/core/undo/unattr.cxx   |4 -
 sw/source/core/undo/undel.cxx|6 +-
 sw/source/core/undo/undobj.cxx   |4 -
 sw/source/core/undo/undobj1.cxx  |4 -
 sw/source/core/undo/undraw.cxx   |   14 ++---
 sw/source/core/undo/unfmco.cxx   |4 -
 sw/source/core/undo/unins.cxx|6 +-
 sw/source/core/undo/unspnd.cxx   |2 
 sw/source/core/undo/untbl.cxx|   53 +--
 sw/source/core/undo/untblk.cxx   |2 
 sw/source/core/unocore/SwXTextDefaults.cxx   |6 +-
 sw/source/core/unocore/unocrsrhelper.cxx |4 -
 sw/source/core/unocore/unodraw.cxx   |4 -
 sw/source/core/unocore/unoevent.cxx  |8 +-
 sw/source/core/unocore/unofield.cxx  |   68 
 sw/source/core/unocore/unoframe.cxx  |   42 +++
 sw/source/core/unocore/unoobj.cxx|2 
 sw/source/core/unocore/unoobj2.cxx   |   10 +--
 sw/source/core/unocore/unosett.cxx   |6 +-
 sw/source/core/unocore/unostyle.cxx  |   36 ++---
 sw/source/core/unocore/unotbl.cxx|   20 +++
 sw/source/filter/html/css1atr.cxx|   44 
 sw/source/filter/html/htmlctxt.cxx   |8 +-
 sw/source/filter/html/htmldrawwriter.cxx |   10 +--
 sw/source/filter/html/htmlfld.cxx|2 
 sw/source/filter/html/htmlfldw.cxx   |   14 ++---
 sw/source/filter/html/htmlflywriter.cxx  |8 +-
 sw/source/filter/html/htmlform.cxx   |4 -
 sw/source/filter/html/htmlgrin.cxx   |2 
 sw/source/filter/html/htmlnumreader.cxx  |2 
 sw/source/filter/html/htmlsect.cxx   |6 +-
 sw/source/filter/html/htmltab.cxx|   10 +--
 sw/source/filter/html/htmltabw.cxx   |4 -
 sw/source/filter/html/svxcss1.cxx|   14 ++---
 sw/source/filter/html/swhtml.cxx |8 +-
 sw/source/filter/html/wrthtml.cxx|   18 +++---
 sw/source/filter/writer/wrtswtbl.cxx |2 
 sw/source/filter/ww8/docxattributeoutput.cxx |2 
 sw/source/filter/ww8/docxexport.cxx  |2 
 sw/source/filter/ww8/rtfattributeoutput.cxx  |2 
 sw/source/filter/ww8/rtfexport.cxx   |2 
 sw/source/filter/ww8/wrtw8nds.cxx|   10 +--
 sw/source/filter/ww8/wrtww8.cxx  |2 
 sw/source/filter/ww8/wrtww8gr.cxx|2 
 sw/source/filter/ww8/ww8atr.cxx  |   10 +--
 sw/source/filter/ww8/ww8graf.cxx |4 -
 sw/source/filter/ww8/ww8par.cxx  |4 -
 sw/source/filter/ww8/ww8par6.cxx |2 
 sw/source/filter/xml/xmlfmt.cxx  |2 
 sw/source/filter/xml/xmlfmte.cxx |4 -
 sw/source/filter/xml/xmliteme.cxx|2 
 sw/source/filter/xml/xmltbli.cxx |4 -
 sw/source/filter/xml/xmltexte.cxx|2 
 sw/source/ui/chrdlg/chardlg.cxx  |4 -
 sw/source/ui/chrdlg/numpara.cxx  |8 +-
 sw/source/ui/config/optload.cxx  |6 +-
 sw/source/ui/config/optpage.cxx  |   12 ++--
 sw/source/ui/dbui/dbinsdlg.cxx   |2 
 sw/source/ui/dialog/uiregionsw.cxx   |2 
 sw/source/ui/fldui/fldvar.cxx|2 
 sw/source/ui/index/swuiidxmrk.cxx|2 
 sw/source/ui/misc/num.cxx|2 
 sw/source/ui/misc/titlepage.cxx  |2 
 sw/source/ui/table/tabledlg.cxx  |   34 ++--
 sw/source/uibase/app/apphdl.cxx  |2 
 sw/source/uibase/app/docsh.cxx   |8 +-
 sw/source/uibase/app/docsh2.cxx  |2 
 sw/source/uibase/app/docst.cxx   |   18 +++---
 sw/source/uibase/app/docstyle.cxx

[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source

2014-11-12 Thread Noel Grandin
 sw/inc/doc.hxx   |3 +
 sw/inc/edimp.hxx |2 -
 sw/inc/fmtcnct.hxx   |6 +--
 sw/inc/fmthdft.hxx   |   12 +++---
 sw/inc/ndgrf.hxx |4 +-
 sw/inc/paratr.hxx|   56 ++-
 sw/inc/unochart.hxx  |5 +-
 sw/source/core/crsr/trvlcol.cxx  |4 +-
 sw/source/core/crsr/trvlfnfl.cxx |2 -
 sw/source/core/crsr/trvltbl.cxx  |   14 +++
 sw/source/core/crsr/viscrs.cxx   |8 ++--
 sw/source/core/doc/acmplwrd.cxx  |6 +--
 sw/source/core/doc/dbgoutsw.cxx  |2 -
 sw/source/core/doc/doc.cxx   |   43 ---
 sw/source/core/doc/doccomp.cxx   |   70 +++
 sw/source/core/inc/sectfrm.hxx   |6 +--
 16 files changed, 129 insertions(+), 114 deletions(-)

New commits:
commit ca0b3bb41988b679fff028a3a8e8cd7c7ec5bdd2
Author: Noel Grandin n...@peralex.com
Date:   Wed Nov 12 11:04:31 2014 +0200

loplugin: cstylecast

Change-Id: I8c840d6635f347dcb1b8d9d193a05d509ba6cacb

diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index adff16c..747d3a6 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -145,8 +145,8 @@ void SwAutoCompleteClient::Modify( const SfxPoolItem* pOld, 
const SfxPoolItem *)
 {
 case RES_REMOVE_UNO_OBJECT:
 case RES_OBJECTDYING:
-if( (void*)GetRegisteredIn() == ((SwPtrMsgPoolItem *)pOld)-pObject )
-((SwModify*)GetRegisteredIn())-Remove(this);
+if( (void*)GetRegisteredIn() == static_castconst SwPtrMsgPoolItem 
*(pOld)-pObject )
+static_castSwModify*(GetRegisteredIn())-Remove(this);
 pAutoCompleteWord-DocumentDying(*pDoc);
 break;
 }
@@ -283,7 +283,7 @@ bool SwAutoCompleteWord::InsertWord( const OUString rWord, 
SwDoc rDoc )
 {
 delete pNew;
 // then move up
-pNew = (SwAutoCompleteString*)(*aInsPair.first);
+pNew = static_castSwAutoCompleteString*(*aInsPair.first);
 
 // add the document to the already inserted string
 pNew-AddDocument(rDoc);
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index 3837e0e..67ac7f2 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -277,7 +277,7 @@ static const OUString lcl_dbg_out(const SfxItemSet  rSet)
 if (!bFirst)
 aStr += , ;
 
-if ((sal_uIntPtr)pItem != SAL_MAX_SIZE)
+if (reinterpret_castsal_uIntPtr(pItem) != SAL_MAX_SIZE)
 aStr += lcl_dbg_out(*pItem);
 else
 aStr += invalid;
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 2281b08..74b1aa0 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -508,9 +508,9 @@ struct _PostItFld : public _SetGetExpFld
 const std::set sal_Int32  rPossiblePages,
 sal_uInt16 rVirtPgNo, sal_uInt16 rLineNo );
 
-SwPostItField* GetPostIt() const
+const SwPostItField* GetPostIt() const
 {
-return (SwPostItField*) GetTxtFld()-GetFmtFld().GetField();
+return static_castconst SwPostItField*( 
GetTxtFld()-GetFmtFld().GetField() );
 }
 };
 
@@ -582,7 +582,7 @@ bool sw_GetPostIts(
 static void lcl_FormatPostIt(
 IDocumentContentOperations* pIDCO,
 SwPaM aPam,
-SwPostItField* pField,
+const SwPostItField* pField,
 bool bNewPage, bool bIsFirstPostIt,
 sal_uInt16 nPageNo, sal_uInt16 nLineNo )
 {
@@ -684,7 +684,7 @@ void SwDoc::CalculatePagesForPrinting(
 }
 
 ++nPageNum;
-pStPage = (SwPageFrm*)pStPage-GetNext();
+pStPage = static_castconst SwPageFrm*(pStPage-GetNext());
 }
 
 // now that we have identified the valid pages for printing according
@@ -767,7 +767,7 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
 bool bIsFirstPostIt = true;
 for (sal_uInt16 i = 0; i  nPostItCount; ++i)
 {
-_PostItFld rPostIt = (_PostItFld)*(*rData.m_pPostItFields)[ i ];
+_PostItFld rPostIt = 
static_cast_PostItFld(*(*rData.m_pPostItFields)[ i ]);
 nLastPageNum = nPhyPageNum;
 nPhyPageNum = rPostIt.GetPageNo(
 aRangeEnum, rData.GetValidPagesSet(), nVirtPg, nLineNo );
@@ -811,7 +811,7 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
 // now we just need to add the post-it pages to be printed to the
 // end of the vector of pages to print
 sal_Int32 nPageNum = 0;
-const SwPageFrm * pPageFrm = 
(SwPageFrm*)rData.m_pPostItShell-GetLayout()-Lower();
+const SwPageFrm * pPageFrm = 
static_castSwPageFrm*(rData.m_pPostItShell-GetLayout()-Lower());
 while( pPageFrm  nPageNum  nPostItDocPageCount )
 {
 OSL_ENSURE( pPageFrm, Empty page frame. How are we going to 
print 

  1   2   >