core.git: svx/source sw/source

2023-12-23 Thread Caolán McNamara (via logerrit)
 svx/source/form/datanavi.cxx|2 +-
 sw/source/uibase/shells/grfshex.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 25d4fae8d3f69dc4d03c1a04233e6ed670742ed5
Author: Caolán McNamara 
AuthorDate: Sat Dec 23 14:00:26 2023 +
Commit: Caolán McNamara 
CommitDate: Sat Dec 23 16:03:30 2023 +0100

cid#1546064 COPY_INSTEAD_OF_MOVE

and

cid#1546034 COPY_INSTEAD_OF_MOVE

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

diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 0178a82c5947..9116c0eb075f 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -306,7 +306,7 @@ namespace svxform
 
 // tdf#154535 create the OXFormsDescriptor on-demand so we don't cause 
an unwanted
 // Binding to be created unless we are forced to.
-auto fnCreateFormsDescriptor = [this, szName, xNode, xPropSet](){
+auto fnCreateFormsDescriptor = [this, szName=std::move(szName), 
xNode=std::move(xNode), xPropSet=std::move(xPropSet)](){
 OXFormsDescriptor desc;
 desc.szName = szName;
 if (xNode) {
diff --git a/sw/source/uibase/shells/grfshex.cxx 
b/sw/source/uibase/shells/grfshex.cxx
index 45d40764525b..a9af8799b009 100644
--- a/sw/source/uibase/shells/grfshex.cxx
+++ b/sw/source/uibase/shells/grfshex.cxx
@@ -80,7 +80,7 @@ bool SwTextShell::InsertMediaDlg( SfxRequest const & rReq )
 css::uno::Reference 
xDispatchProvider(GetView().GetViewFrame().GetFrame().GetFrameInterface(), 
css::uno::UNO_QUERY);
 
 rtl::Reference xPlayerListener(new 
avmedia::PlayerListener(
-[xDispatchProvider, aURL, bLink](const 
css::uno::Reference& rPlayer){
+[xDispatchProvider=std::move(xDispatchProvider), aURL, 
bLink](const css::uno::Reference& rPlayer){
 css::awt::Size aSize = 
rPlayer->getPreferredPlayerWindowSize();
 
avmedia::MediaWindow::dispatchInsertAVMedia(xDispatchProvider, aSize, aURL, 
bLink);
 }));


core.git: svx/source sw/source

2023-12-09 Thread Caolán McNamara (via logerrit)
 svx/source/form/fmshimp.cxx|2 +-
 sw/source/core/layout/paintfrm.cxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit cf3dda7c1c1da50db75d4c022bef279149d26636
Author: Caolán McNamara 
AuthorDate: Sat Dec 9 19:28:18 2023 +
Commit: Caolán McNamara 
CommitDate: Sat Dec 9 21:59:57 2023 +0100

cid#1546275 Using invalid iterator

and

cid#1545870 Using invalid iterator

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

diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index d54c5acaebde..890394856688 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -3372,7 +3372,7 @@ void FmXFormShell::CreateExternalView_Lock()
 
 // list source
 MapUString2UstringSeq::const_iterator aCurrentListSource = 
aRadioListSources.find(rCtrlSource.first);
-DBG_ASSERT(aCurrentListSource != aRadioListSources.end(),
+assert(aCurrentListSource != aRadioListSources.end() &&
 "FmXFormShell::CreateExternalView : inconsistent radio 
descriptions !");
 pListBoxDescription->Name = FM_PROP_LISTSOURCE;
 pListBoxDescription->Value <<= (*aCurrentListSource).second;
diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 0f048c4e805d..8ca5e35d1c84 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2746,8 +2746,8 @@ void SwTabFramePainter::FindStylesForLine( Point& 
rStartPoint,
 }
 
 aMapIter = maHoriLines.find( rStartPoint.Y() );
-OSL_ENSURE( aMapIter != maHoriLines.end(), "FindStylesForLine: Error" );
-const SwLineEntrySet& rHoriSet = (*aMapIter).second;
+assert(aMapIter != maHoriLines.end() && "FindStylesForLine: Error");
+const SwLineEntrySet& rHoriSet = aMapIter->second;
 
 for ( const SwLineEntry& rEntry : rHoriSet )
 {


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

2023-06-10 Thread Khaled Hosny (via logerrit)
 svx/source/svdraw/svdotextdecomposition.cxx |8 ++--
 sw/source/core/txtnode/fntcache.cxx |   10 ++
 2 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit 74b6c5ea3c333de7c5e7ef8636732edadd9083f2
Author: Khaled Hosny 
AuthorDate: Thu Jun 8 16:41:18 2023 +0300
Commit: خالد حسني 
CommitDate: Sat Jun 10 19:05:13 2023 +0200

tdf#151968: Fix vertical position of RTL spelling wavy line

Second try. This time making sure start > end even for RTL text.

This also now works for horizontal, vertical and rotated Arabic text, in
Writer and Edit Engine.

Change-Id: I6fe1e9dbb9c071287054200a58d4ee073311
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152743
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 138b709e9769..726ee850eb8b 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -427,8 +427,12 @@ namespace
 // full portion width
 const double fTextWidth(aDXArray[aDXArray.size() - 1]);
 
-fStart = fTextWidth - fStart;
-fEnd = fTextWidth - fEnd;
+// tdf#151968
+// if start < end, OutputDevice::DrawWaveLine() will
+// think it is a rotated line, so we swap fStart and
+// fEnd to avoid this.
+fStart = fTextWidth - fEnd;
+fEnd = fTextWidth - fStart;
 }
 
 // need to take FontScaling out of values; it's already 
part of
diff --git a/sw/source/core/txtnode/fntcache.cxx 
b/sw/source/core/txtnode/fntcache.cxx
index e125906767f6..bc5dd603a433 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -241,10 +241,20 @@ static void lcl_calcLinePos( const CalcLinePosData ,
 break;
 }
 
+// tdf#151968
+// if start < end, OutputDevice::DrawWaveLine() will think it is a rotated
+// line, so we swap nStart and nEnd to avoid this.
+if ( rData.bBidiPor )
+std::swap(rStart, rEnd);
+
 if ( rData.bSwitchL2R )
 {
 rData.rInf.GetFrame()->SwitchLTRtoRTL( rStart );
 rData.rInf.GetFrame()->SwitchLTRtoRTL( rEnd );
+
+// tdf#151968
+// We need to do this here as well for LTR text in a RTL paragraph.
+std::swap(rStart, rEnd);
 }
 
 if ( rData.bSwitchH2V )


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

2023-03-30 Thread Mike Kaganski (via logerrit)
 svx/source/xoutdev/_xoutbmp.cxx |4 +
 sw/source/filter/html/htmlflywriter.cxx |6 -
 vcl/inc/graphic/UnoGraphicDescriptor.hxx|   50 +++
 vcl/source/graphic/UnoGraphicDescriptor.cxx |   90 +---
 4 files changed, 72 insertions(+), 78 deletions(-)

New commits:
commit ab07ba6a9f89aedf4c33fbe911ed8a7d55ced1dd
Author: Mike Kaganski 
AuthorDate: Thu Mar 30 10:13:12 2023 +0300
Commit: Mike Kaganski 
CommitDate: Thu Mar 30 09:39:32 2023 +

Report correct mimetypes for TIF and EMF

Change-Id: I2eeb07780e3581eea29a9ad98b493de4e78a5d65
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149745
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index d392426defb5..9fbb4d5690b5 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -155,6 +155,10 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, 
OUString& rFileName,
 }
 
 rFileName = aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE);
+if (pMediaType)
+if (auto xGraphic = 
rGraphic.GetXGraphic().query())
+xGraphic->getPropertyValue("MimeType") >>= *pMediaType;
+
 SfxMedium 
aMedium(aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), 
StreamMode::WRITE | StreamMode::SHARE_DENYNONE | StreamMode::TRUNC);
 SvStream* pOStm = aMedium.GetOutStream();
 
diff --git a/sw/source/filter/html/htmlflywriter.cxx 
b/sw/source/filter/html/htmlflywriter.cxx
index acfeec1edaec..85cae063cda5 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -1974,8 +1974,6 @@ static SwHTMLWriter& OutHTML_FrameFormatGrfNode( 
SwHTMLWriter& rWrt, const SwFra
 if (!rGraphic.isAvailable())
 const_cast(rGraphic).makeAvailable();
 
-OUString aMimeTypeOverride;
-
 if (rWrt.mbReqIF && bWritePNGFallback)
 {
 // ReqIF: force native data if possible.
@@ -1987,7 +1985,6 @@ static SwHTMLWriter& OutHTML_FrameFormatGrfNode( 
SwHTMLWriter& rWrt, const SwFra
 else if (rGraphic.GetGfxLink().IsEMF())
 {
 aFilterName = "emf";
-aMimeTypeOverride = "image/x-emf"; // avoid image/x-wmf
 }
 else if (pVectorGraphicData && pVectorGraphicData->getType() 
== VectorGraphicDataType::Wmf)
 {
@@ -1996,7 +1993,6 @@ static SwHTMLWriter& OutHTML_FrameFormatGrfNode( 
SwHTMLWriter& rWrt, const SwFra
 else if (rGraphic.GetGfxLink().GetType() == 
GfxLinkType::NativeTif)
 {
 aFilterName = "tif";
-aMimeTypeOverride = "image/tiff"; // avoid 
image/x-vclgraphic
 }
 }
 
@@ -2010,8 +2006,6 @@ static SwHTMLWriter& OutHTML_FrameFormatGrfNode( 
SwHTMLWriter& rWrt, const SwFra
 aGraphicURL = URIHelper::SmartRel2Abs(
 INetURLObject(rWrt.GetBaseURL()), aGraphicURL,
 URIHelper::GetMaybeFileHdl() );
-if (!aMimeTypeOverride.isEmpty())
-aMimeType = aMimeTypeOverride;
 }
 else
 {
diff --git a/vcl/inc/graphic/UnoGraphicDescriptor.hxx 
b/vcl/inc/graphic/UnoGraphicDescriptor.hxx
index d57bb3a65d28..98b953b443e5 100644
--- a/vcl/inc/graphic/UnoGraphicDescriptor.hxx
+++ b/vcl/inc/graphic/UnoGraphicDescriptor.hxx
@@ -27,31 +27,31 @@
 #include 
 #include 
 
-#define MIMETYPE_BMP"image/x-MS-bmp"
-#define MIMETYPE_GIF"image/gif"
-#define MIMETYPE_JPG"image/jpeg"
-#define MIMETYPE_PCD"image/x-photo-cd"
-#define MIMETYPE_PCX"image/x-pcx"
-#define MIMETYPE_PNG"image/png"
-#define MIMETYPE_TIF"image/tiff"
-#define MIMETYPE_XBM"image/x-xbitmap"
-#define MIMETYPE_XPM"image/x-xpixmap"
-#define MIMETYPE_PBM"image/x-portable-bitmap"
-#define MIMETYPE_PGM"image/x-portable-graymap"
-#define MIMETYPE_PPM"image/x-portable-pixmap"
-#define MIMETYPE_RAS"image/x-cmu-raster"
-#define MIMETYPE_TGA"image/x-targa"
-#define MIMETYPE_PSD"image/vnd.adobe.photoshop"
-#define MIMETYPE_EPS"image/x-eps"
-#define MIMETYPE_DXF"image/vnd.dxf"
-#define MIMETYPE_MET"image/x-met"
-#define MIMETYPE_PCT"image/x-pict"
-#define MIMETYPE_SVM"image/x-svm"
-#define MIMETYPE_WMF"image/x-wmf"
-#define MIMETYPE_EMF"image/x-emf"
-#define MIMETYPE_SVG"image/svg+xml"
-#define MIMETYPE_PDF"application/pdf"
-#define MIMETYPE_WEBP   "image/webp"
+inline constexpr OUStringLiteral MIMETYPE_BMP = u"image/x-MS-bmp";
+inline constexpr OUStringLiteral MIMETYPE_GIF = u"image/gif";
+inline constexpr OUStringLiteral MIMETYPE_JPG = u"image/jpeg";
+inline constexpr 

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

2023-01-11 Thread Justin Luth (via logerrit)
 svx/source/tbxctrls/bulletsnumbering.cxx |7 +-
 sw/source/uibase/shells/txtnum.cxx   |   33 ---
 2 files changed, 6 insertions(+), 34 deletions(-)

New commits:
commit d07b1cc8148140bd3a78103da668d002b9d266ab
Author: Justin Luth 
AuthorDate: Mon Jan 9 14:18:15 2023 -0500
Commit: Justin Luth 
CommitDate: Thu Jan 12 00:04:06 2023 +

Revert "tdf#56258 svx SetOutline: convert to toggle"

This reverts 7.6 commit a9b666b6b839735919923d8911f7e1efe0eb87b0.

This causes too many unexpected things for the user.
The biggest problem is that it does not join
the previous list like the other numbering does.

I suppose I could fix that by first calling a UNO
command that joins/turns on numbering.

However, that is a bit more dangerous with outline,
since it modifies spacing / numbering on all levels,
and joining can unexpected skip empty paragraphs etc.

So best to just always treat the button as a dropdown
to indicate to the user that they are applying an outline change.

For the present I decided to leave the lighted-up
aspect in place, so show that the outline is in effect.

In terms of removing the list,
which was the main reason for the change in the first place,
there are several workarounds. The user has the option
to go to "more choices" and remove, or select an all-1s choice
and then remove that. Using the bullets button also is
an easy option since it seems less restricted than numbering.

The overall risk is no different from before,
except that it is easier to make those kinds of levels
now that the outline button is always available on the toolbar.

Change-Id: I64e13f203ae65b2d2b28560ba747ca99d1456578
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145240
Tested-by: Justin Luth 
Reviewed-by: Justin Luth 

diff --git a/svx/source/tbxctrls/bulletsnumbering.cxx 
b/svx/source/tbxctrls/bulletsnumbering.cxx
index 413cbc183025..a9195cd5a695 100644
--- a/svx/source/tbxctrls/bulletsnumbering.cxx
+++ b/svx/source/tbxctrls/bulletsnumbering.cxx
@@ -215,7 +215,12 @@ void SAL_CALL NumberingToolBoxControl::initialize( const 
css::uno::Sequence< css
 ToolBox* pToolBox = nullptr;
 ToolBoxItemId nId;
 if (getToolboxId(nId, ))
-pToolBox->SetItemBits(nId, pToolBox->GetItemBits(nId) | 
ToolBoxItemBits::DROPDOWN);
+{
+ToolBoxItemBits nBits = mePageType == NumberingPageType::OUTLINE
+? ToolBoxItemBits::DROPDOWNONLY
+: ToolBoxItemBits::DROPDOWN;
+pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | nBits );
+}
 }
 
 OUString SAL_CALL NumberingToolBoxControl::getImplementationName()
diff --git a/sw/source/uibase/shells/txtnum.cxx 
b/sw/source/uibase/shells/txtnum.cxx
index 3410d962ff79..34a95d13ee8e 100644
--- a/sw/source/uibase/shells/txtnum.cxx
+++ b/sw/source/uibase/shells/txtnum.cxx
@@ -17,8 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -312,37 +310,6 @@ void SwTextShell::ExecSetNumber(SfxRequest const )
 GetShell().SetCurNumRule( aNewNumRule, bCreateNewList );
 }
 }
-else if (nSlot == FN_SVX_SET_OUTLINE)
-{
-// FN_SVX_SET_NUMBER and FN_SVX_SET_BULLET are only dropdown 
actions,
-// but FN_SVX_SET_OUTLINE is different. It is also the button 
action,
-// which is what is being handled here..
-
-// Only toggle off if the current selection is a valid outline 
choice,
-// otherwise do nothing if other bullets/numbering are part of 
the selection.
-const SwNumRule* pNumRule = 
GetShell().GetNumRuleAtCurrentSelection();
-if (pNumRule)
-{
-SvxNumRule aSvxRule = pNumRule->MakeSvxNumRule();
-
-svx::sidebar::NBOTypeMgrBase* pOutline
-= svx::sidebar::NBOutlineTypeMgrFact::CreateInstance(
-svx::sidebar::NBOType::Outline);
-if (pOutline)
-{
-const sal_uInt16 nIndex = 
pOutline->GetNBOIndexForNumRule(aSvxRule, 0);
-if (nIndex < USHRT_MAX)
-comphelper::dispatchCommand(".uno:RemoveBullets", 
{});
-}
-}
-else if (!GetShell().GetNumRuleAtCurrCursorPos())
-{
-// No numbering yet. Just use the first locale-defined 
choice.
-auto aArgs(comphelper::InitPropertySequence(
-{ { "SetOutline", uno::Any(sal_uInt16(1)) } }));
-comphelper::dispatchCommand(".uno:SetOutline", aArgs);
-

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

2022-08-23 Thread Justin Luth (via logerrit)
 svx/source/tbxctrls/tbcontrl.cxx|4 
 sw/source/uibase/docvw/edtwin.cxx   |2 +-
 sw/source/uibase/shells/textsh1.cxx |   12 +---
 3 files changed, 10 insertions(+), 8 deletions(-)

New commits:
commit e93b7f6a5c5f9ee86546d95d7fe70ecc26b71b91
Author: Justin Luth 
AuthorDate: Wed Aug 10 14:00:47 2022 -0400
Commit: Justin Luth 
CommitDate: Wed Aug 24 01:07:07 2022 +0200

NFC related tdf#85592: simplify SID_ATTR_CHAR_COLOR_BACKGROUND_EXT

I am tring to replace Writer-only uno:BackColor
with uno:CharBackColor. The problem is this template flag
which gets calls in svx and then does nothing in editeng.

But I don't see any reason why this call should be
transformed into a template (_ext) call.
We can easily just keep the same call
and do the state-checking only slightly different.
All this other stuff makes _EXT seem much more
complicated than it is.

If I am right that this is a Non-Functional-Change,
then I am well on my way to fixing this bug report.

Change-Id: Idc08117217837f217ea5ca390005802c2fad392b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138101
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index db147949c306..a97bc0b12d31 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3749,10 +3749,6 @@ void SvxColorToolBoxControl::execute(sal_Int16 
/*nSelectModifier*/)
 case SID_ATTR_CHAR_COLOR2 :
 aCommand= ".uno:CharColorExt";
 break;
-
-case SID_ATTR_CHAR_COLOR_BACKGROUND :
-aCommand= ".uno:CharBackgroundExt";
-break;
 }
 
 auto aArgs( comphelper::InitPropertySequence( {
diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index 2f166579a27c..bfa5d91db8ee 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -5094,7 +5094,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
 case SID_ATTR_CHAR_COLOR_EXT:
 nId = RES_CHRATR_COLOR;
 break;
-case SID_ATTR_CHAR_COLOR_BACKGROUND_EXT:
+case SID_ATTR_CHAR_COLOR_BACKGROUND:
 nId = RES_CHRATR_BACKGROUND;
 break;
 }
diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 647ef76ade64..7e4247118526 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1284,11 +1284,11 @@ void SwTextShell::Execute(SfxRequest )
 rWrtSh.SetAttrItem(
 SvxColorItem(aSet, RES_CHRATR_COLOR) );
 }
-else if (nSlot == SID_ATTR_CHAR_COLOR_BACKGROUND)
+else if (nSlot == SID_ATTR_CHAR_COLOR_BACKGROUND_EXT)
 {
-if (!pApply || pApply->nColor != 
SID_ATTR_CHAR_COLOR_BACKGROUND_EXT)
+if (!pApply || pApply->nColor != 
SID_ATTR_CHAR_COLOR_BACKGROUND)
 {
-aTempl.nColor = SID_ATTR_CHAR_COLOR_BACKGROUND_EXT;
+aTempl.nColor = SID_ATTR_CHAR_COLOR_BACKGROUND;
 rEdtWin.SetApplyTemplate(aTempl);
 }
 }
@@ -1856,6 +1856,12 @@ void SwTextShell::GetState( SfxItemSet  )
 }
 break;
 case SID_ATTR_CHAR_COLOR_BACKGROUND_EXT:
+{
+SwEditWin& rEdtWin = GetView().GetEditWin();
+SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate();
+rSet.Put(SfxBoolItem(nWhich, pApply && pApply->nColor == 
SID_ATTR_CHAR_COLOR_BACKGROUND));
+}
+break;
 case SID_ATTR_CHAR_COLOR_EXT:
 {
 SwEditWin& rEdtWin = GetView().GetEditWin();


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

2022-08-07 Thread Mike Kaganski (via logerrit)
 svx/source/unodraw/SvxXTextColumns.cxx |4 ++--
 sw/source/core/layout/atrfrm.cxx   |4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 47b4c9bb7f0ef0175e55acaf22c740d11f6e9474
Author: Mike Kaganski 
AuthorDate: Sun Aug 7 21:00:01 2022 +0300
Commit: Mike Kaganski 
CommitDate: Sun Aug 7 21:14:12 2022 +0200

tdf#150293: setPropertyValue(WID_TXTCOL_LINE_WIDTH) takes mm100

Before commit 95ebd24a629b4c8cd62cc20c0701683512cc8fa0
  Author Mike Kaganski 
  Date   Thu May 27 13:00:10 2021 +0300
editengine-columns: ODF support [API CHANGE]

SwXTextColumns crtor took SwFormatCol, and stored line width in the
same units as in SwFormatCol - in twips; conversion to mm100 only
happened at export stage in SwXTextColumns::getPropertyValue.
The mentioned commit changed to SvxXTextColumns::setPropertyValue,
passing the line width from SwFormatCol also without any conversion;
but SvxXTextColumns::setPropertyValue expects mm100, so the result
was wrong.

So perform the proper conversion at SwFormatCol::QueryValue and
SwFormatCol::PutValue, and also store the line width in mm100 in
SvxXTextColumns, to avoid useless extra conversion.

Change-Id: Idfd62a7563f9d3aa5947c1149572a8b8b696b179
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137931
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/svx/source/unodraw/SvxXTextColumns.cxx 
b/svx/source/unodraw/SvxXTextColumns.cxx
index 838ca5d4cabb..95d289632241 100644
--- a/svx/source/unodraw/SvxXTextColumns.cxx
+++ b/svx/source/unodraw/SvxXTextColumns.cxx
@@ -209,7 +209,7 @@ void SvxXTextColumns::setPropertyValue(const OUString& 
rPropertyName, const css:
 sal_Int32 nTmp;
 if (!(aValue >>= nTmp) || nTmp < 0)
 throw css::lang::IllegalArgumentException();
-m_nSepLineWidth = o3tl::toTwips(nTmp, o3tl::Length::mm100);
+m_nSepLineWidth = nTmp;
 break;
 }
 case WID_TXTCOL_LINE_COLOR:
@@ -270,7 +270,7 @@ css::uno::Any SvxXTextColumns::getPropertyValue(const 
OUString& rPropertyName)
 switch (pEntry->nWID)
 {
 case WID_TXTCOL_LINE_WIDTH:
-aRet <<= 
o3tl::narrowing(convertTwipToMm100(m_nSepLineWidth));
+aRet <<= m_nSepLineWidth;
 break;
 case WID_TXTCOL_LINE_COLOR:
 aRet <<= m_nSepLineColor;
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index ad1c1c399291..775fe203c661 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -1114,7 +1114,8 @@ bool SwFormatCol::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 }
 }
 uno::Any aVal;
-aVal <<= o3tl::narrowing(GetLineWidth());
+aVal <<= o3tl::narrowing(
+o3tl::convert(GetLineWidth(), o3tl::Length::twip, 
o3tl::Length::mm100));
 xProps->setPropertyValue(UNO_NAME_SEPARATOR_LINE_WIDTH, aVal);
 aVal <<= GetLineColor();
 xProps->setPropertyValue(UNO_NAME_SEPARATOR_LINE_COLOR, aVal);
@@ -1204,6 +1205,7 @@ bool SwFormatCol::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
 {
 xProps->getPropertyValue(UNO_NAME_IS_AUTOMATIC) >>= m_bOrtho;
 xProps->getPropertyValue(UNO_NAME_SEPARATOR_LINE_WIDTH) >>= 
m_nLineWidth;
+m_nLineWidth = o3tl::toTwips(m_nLineWidth, 
o3tl::Length::mm100);
 xProps->getPropertyValue(UNO_NAME_SEPARATOR_LINE_COLOR) >>= 
m_aLineColor;
 if (sal_Int32 nHeight;
 
xProps->getPropertyValue(UNO_NAME_SEPARATOR_LINE_RELATIVE_HEIGHT) >>= nHeight)


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

2022-06-24 Thread Andrea Gelmini (via logerrit)
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |4 ++--
 sw/source/core/text/itrcrsr.cxx  |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit c08d71a0e0015ec7857335b68a354df04fa04a0c
Author: Andrea Gelmini 
AuthorDate: Fri Jun 24 16:48:58 2022 +0200
Commit: Julien Nabet 
CommitDate: Fri Jun 24 18:59:08 2022 +0200

Fix typos

Change-Id: I48d173ab697425bcff663f7f7d0bbc404a950bb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136402
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx 
b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index 331fe74b99dc..fba547f92cbb 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -332,10 +332,10 @@ void SlideBackgroundFillPrimitive2D::get2DDecomposition(
 }
 
 // tdf#149650 allow remember/detect of potential recursion for content 
creation.
-// use a std::set association - instead of a single bool or adress - due 
to the
+// use a std::set association - instead of a single bool or address - due 
to the
 // possibility of multiple SlideBackgroundFillPrimitive2D's being used at 
the same
 // refresh. Also possible would be a local member (bool), but that just 
makes the
-// class more complicated. Working wth the adress is not a problem here 
since below
+// class more complicated. Working with the address is not a problem here 
since below
 // it reliably gets added/removed while being incarnated only.
 static std::set 
potentiallyActiveRecursion;
 
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index ff92ab18c7e4..88679296a951 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -402,7 +402,7 @@ void SwTextCursor::CtorInitTextCursor( SwTextFrame 
*pNewFrame, SwTextSizeInfo *p
 }
 
 // tdf#120715 tdf#43100: Make width for some HolePortions, so cursor will be 
able to move into it.
-// It sould not change the layout, so this should be called after the layout 
is calculated.
+// It should not change the layout, so this should be called after the layout 
is calculated.
 void SwTextCursor::AddExtraBlankWidth()
 {
 SwLinePortion* pPos = m_pCurr->GetNextPortion();


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

2022-06-10 Thread Xisco Fauli (via logerrit)
 svx/source/dialog/charmap.cxx|2 ++
 sw/source/core/layout/atrfrm.cxx |1 +
 sw/source/core/text/frmpaint.cxx |2 ++
 sw/source/core/text/porrst.cxx   |1 +
 vcl/source/control/fmtfield.cxx  |2 ++
 5 files changed, 8 insertions(+)

New commits:
commit 4dae3508de6d2340562f0c97ca4d00b03dcae42d
Author: Xisco Fauli 
AuthorDate: Mon Jun 6 11:25:02 2022 +0200
Commit: Xisco Fauli 
CommitDate: Fri Jun 10 09:15:46 2022 +0200

Add asserts to those places where I fixed a EXCEPTION_INT_DIVIDE_BY_ZERO

I found those crashes scraping https://crashreport.libreoffice.org/stats/
so those are blind fixes basically. Add these asserts,
hoping one day someone will hit them so we can find the root cause.

See
7c8b9fa98f4c5f7f5620e797dbbe24081e252548
fae937b6859517bd9fe8e400cad3c84561ff98ab
ce39195e56ce1482e2be6b1bec2b7f992125
23e3bff528ab38c8d5c6d401b672a0033cef2bd4
ea4cd397300120a0f825752182eb3b943eb8a1b2

Change-Id: I175f47361e07961417c87cc8f3d7d4d1fb50fb2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135448
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index d7a7898d5342..6eb9745c8233 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -376,7 +376,9 @@ Point SvxShowCharSet::MapIndexToPixel( int nIndex ) const
 int SvxShowCharSet::PixelToMapIndex( const Point& point) const
 {
 int nBase = FirstInView();
+assert(nX != 0);
 int x = nX == 0 ? 0 : (point.X() - m_nXGap)/nX;
+assert(nY != 0);
 int y = nY == 0 ? 0 : (point.Y() - m_nYGap)/nY;
 return (nBase + x + y * COLUMN_COUNT);
 }
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 98588785cec3..2fcc7987d97b 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -1061,6 +1061,7 @@ void SwFormatCol::Calc( sal_uInt16 nGutterWidth, 
sal_uInt16 nAct )
 rLastCol.SetLeft(nGutterHalf);
 rLastCol.SetRight(0);
 
+assert(nAct != 0);
 //Convert the current width to the requested width.
 for (SwColumn : m_aColumns)
 {
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index 8637faca988c..36885753e514 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -83,11 +83,13 @@ public:
 SwFont* GetFont() const { return m_pFnt.get(); }
 void IncLineNr() { ++m_nLineNr; }
 bool HasNumber() const {
+assert( m_rLineInf.GetCountBy() != 0 );
 if( m_rLineInf.GetCountBy() == 0 )
 return false;
 return !( m_nLineNr % m_rLineInf.GetCountBy() );
 }
 bool HasDivider() const {
+assert( m_rLineInf.GetDividerCountBy() != 0 );
 if( !m_nDivider || m_rLineInf.GetDividerCountBy() == 0 )
 return false;
 return !(m_nLineNr % m_rLineInf.GetDividerCountBy());
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index 498d1006108a..5e3d6921292d 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -644,6 +644,7 @@ bool SwBookmarkPortion::DoPaint(SwTextPaintInfo const& 
rTextPaintInfo,
 Size aSize(rFont.GetSize(rFont.GetActual()));
 // use also the external leading (line gap) of the portion, but don't use
 // 100% of it because i can't figure out how to baseline align that
+assert(aSize.Height() != 0);
 auto const nFactor = aSize.Height() > 0 ? (Height() * 95) / aSize.Height() 
: Height();
 rFont.SetProportion(nFactor);
 rFont.SetWeight(WEIGHT_THIN, rFont.GetActual());
diff --git a/vcl/source/control/fmtfield.cxx b/vcl/source/control/fmtfield.cxx
index 3aee3317c829..359856c64486 100644
--- a/vcl/source/control/fmtfield.cxx
+++ b/vcl/source/control/fmtfield.cxx
@@ -1187,6 +1187,7 @@ void FormattedField::Up()
 
 sal_Int64 nValue = std::round(rFormatter.GetValue() * nScale);
 sal_Int64 nSpinSize = std::round(rFormatter.GetSpinSize() * nScale);
+assert(nSpinSize != 0);
 sal_Int64 nRemainder = rFormatter.GetDisableRemainderFactor() || nSpinSize 
== 0 ? 0 : nValue % nSpinSize;
 if (nValue >= 0)
 nValue = (nRemainder == 0) ? nValue + nSpinSize : nValue + nSpinSize - 
nRemainder;
@@ -1208,6 +1209,7 @@ void FormattedField::Down()
 
 sal_Int64 nValue = std::round(rFormatter.GetValue() * nScale);
 sal_Int64 nSpinSize = std::round(rFormatter.GetSpinSize() * nScale);
+assert(nSpinSize != 0);
 sal_Int64 nRemainder = rFormatter.GetDisableRemainderFactor() || nSpinSize 
== 0 ? 0 : nValue % nSpinSize;
 if (nValue >= 0)
 nValue = (nRemainder == 0) ? nValue - nSpinSize : nValue - nRemainder;


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

2022-02-04 Thread rafaelhlima (via logerrit)
 svx/source/dialog/ctredlin.cxx |2 
 sw/source/uibase/sidebar/SwPanelFactory.cxx|2 
 sw/uiconfig/swriter/ui/managechangessidebar.ui |  148 -
 3 files changed, 26 insertions(+), 126 deletions(-)

New commits:
commit c7923851d10e2dda9deb414dee67c4813d93bc87
Author: rafaelhlima 
AuthorDate: Fri Jan 28 10:42:27 2022 -0300
Commit: Rafael Lima 
CommitDate: Fri Feb 4 19:03:23 2022 +0100

tdf#146893 Remove extra buttons from Manage Changes sidebar

After commit 2e1a38ceb6866248ec30f6fe58cd3adc1b910eec that moved the 
command buttons in the Manage Changes dialog to the List tab, the Manage 
Changes sidebar started showing the buttons twice.

This patch remove the duplicated buttons from the sidebar.

Change-Id: I767e88ba9ca7595913b6ddc57d152febd595f504
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129103
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 

diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index dc9d84801c2b..8daf9fefaab4 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -364,7 +364,6 @@ void SvxRedlinTable::SetWriterView()
 o3tl::narrowing(nDigitWidth * 20)
 };
 pTreeView->set_column_fixed_widths(aWidths);
-pTreeView->set_size_request(400, -1);
 }
 
 void SvxRedlinTable::SetCalcView()
@@ -384,7 +383,6 @@ void SvxRedlinTable::SetCalcView()
 o3tl::narrowing(nDigitWidth * 20)
 };
 pTreeView->set_column_fixed_widths(aWidths);
-pTreeView->set_size_request(400, -1);
 }
 
 void SvxTPView::EnableAccept(bool bFlag)
diff --git a/sw/source/uibase/sidebar/SwPanelFactory.cxx 
b/sw/source/uibase/sidebar/SwPanelFactory.cxx
index 9dd70c0f3227..5dcd0f389216 100644
--- a/sw/source/uibase/sidebar/SwPanelFactory.cxx
+++ b/sw/source/uibase/sidebar/SwPanelFactory.cxx
@@ -167,7 +167,7 @@ Reference SAL_CALL 
SwPanelFactory::createUIElement (
 rsResourceURL,
 xFrame,
 std::move(xPanel),
-ui::LayoutSize(-1,-1,-1));
+ui::LayoutSize(0,-1,-1));
 }
 else if (rsResourceURL.endsWith("/WriterInspectorTextPanel"))
 {
diff --git a/sw/uiconfig/swriter/ui/managechangessidebar.ui 
b/sw/uiconfig/swriter/ui/managechangessidebar.ui
index bdb99548668d..681264f9a864 100644
--- a/sw/uiconfig/swriter/ui/managechangessidebar.ui
+++ b/sw/uiconfig/swriter/ui/managechangessidebar.ui
@@ -1,23 +1,24 @@
 
+
 
   
   
   
 True
-False
-True
-True
+False
+True
+True
 
   
 True
-False
-6
+False
+6
 vertical
 12
 
   
 True
-False
+False
 True
 True
 vertical
@@ -26,7 +27,7 @@
   
   
 True
-False
+False
 True
 True
 
@@ -39,103 +40,6 @@
 0
   
 
-
-  
-  
-True
-False
-6
-6
-
-  
-_Accept
-True
-True
-True
-True
-True
-  
-  
-0
-0
-1
-1
-  
-
-
-  
-_Reject
-True
-True
-True
-True
-True
-  
-  
-1
-0
-1
-1
-  
-
-
-  
-A_ccept All
-True
-True
-True
-True
-True
-  
-  
-0
-1
-1
-1
-  
-
-
-  
-R_eject All
-True
-True
-True
-True
-True
-  
-  
-1
-1
-1
-1
-  
-
-
-  
-_Undo
-True
-True
-True
-True
-True
-  
-  
-1
-2
-1
-1
-

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

2021-12-10 Thread Caolán McNamara (via logerrit)
 svx/source/svdraw/svdedxv.cxx |3 ++-
 sw/source/core/inc/frmtool.hxx|5 -
 sw/source/core/layout/frmtool.cxx |7 ++-
 3 files changed, 12 insertions(+), 3 deletions(-)

New commits:
commit 93388cca19810b41cb45b3770dd6212345e65a14
Author: Caolán McNamara 
AuthorDate: Fri Dec 10 19:56:48 2021 +
Commit: Caolán McNamara 
CommitDate: Fri Dec 10 22:49:12 2021 +0100

cid#1485150 suppress Uncaught exception

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

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index f046fb185057..6ba72c1c09f1 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -91,7 +92,7 @@ SdrObjEditView::~SdrObjEditView()
 mpTextEditWin = nullptr; // so there's no ShowCursor in SdrEndTextEdit
 assert(!IsTextEdit());
 if (IsTextEdit())
-SdrEndTextEdit();
+suppress_fun_call_w_exception(SdrEndTextEdit());
 mpTextEditOutliner.reset();
 assert(nullptr == mpOldTextEditUndoManager); // should have been reset
 }
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index 29eec3495080..872944a75a50 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -224,6 +224,9 @@ void CalcContent( SwLayoutFrame *pLay, bool bNoColl = false 
);
 // the necessary notifications in their destructor if needed
 class SwFrameNotify
 {
+private:
+void ImplDestroy();
+
 protected:
 SwFrame *mpFrame;
 const SwRect maFrame;
@@ -236,7 +239,7 @@ protected:
 
 public:
 SwFrameNotify( SwFrame *pFrame );
-~SwFrameNotify() COVERITY_NOEXCEPT_FALSE;
+~SwFrameNotify();
 
 const SwRect () const { return maFrame; }
 void SetInvaKeep() { mbInvaKeep = true; }
diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index 6872360d646c..3f92694ff7a6 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -125,7 +125,12 @@ SwFrameNotify::SwFrameNotify( SwFrame *pF ) :
 mbHadFollow = pF->IsContentFrame() && 
static_cast(pF)->GetFollow();
 }
 
-SwFrameNotify::~SwFrameNotify() COVERITY_NOEXCEPT_FALSE
+SwFrameNotify::~SwFrameNotify()
+{
+suppress_fun_call_w_exception(ImplDestroy());
+}
+
+void SwFrameNotify::ImplDestroy()
 {
 SwRectFnSet aRectFnSet(mpFrame);
 const bool bAbsP = aRectFnSet.PosDiff(maFrame, mpFrame->getFrameArea());


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

2021-08-16 Thread Noel Grandin (via logerrit)
 svx/source/sdr/contact/viewobjectcontact.cxx  |2 +-
 svx/source/sdr/contact/viewobjectcontactofgroup.cxx   |2 +-
 svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx |4 ++--
 svx/source/sdr/overlay/overlayobject.cxx  |2 +-
 sw/source/core/draw/dcontact.cxx  |2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit d8103862e78c2bbed18f0da82231d4be576083da
Author: Noel Grandin 
AuthorDate: Mon Aug 16 13:14:10 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Aug 16 16:15:40 2021 +0200

no need to make a local copy here

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

diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx 
b/svx/source/sdr/contact/viewobjectcontact.cxx
index e65c2bab1d6e..2720404cb58c 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -418,7 +418,7 @@ drawinglayer::primitive2d::Primitive2DContainer 
ViewObjectContact::getPrimitive2
 // get ranges
 const drawinglayer::geometry::ViewInformation2D& 
rViewInformation2D(GetObjectContact().getViewInformation2D());
 const basegfx::B2DRange 
aObjectRange(xRetval.getB2DRange(rViewInformation2D));
-const basegfx::B2DRange 
aViewRange(rViewInformation2D.getViewport());
+const basegfx::B2DRange& 
aViewRange(rViewInformation2D.getViewport());
 
 // check geometrical visibility
 bool bVisible = aViewRange.isEmpty() || 
aViewRange.overlaps(aObjectRange);
diff --git a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx 
b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
index a6198992a544..ee797e11743b 100644
--- a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
@@ -68,7 +68,7 @@ namespace sdr::contact
 // get ranges
 const drawinglayer::geometry::ViewInformation2D& 
rViewInformation2D(GetObjectContact().getViewInformation2D());
 const ::basegfx::B2DRange 
aObjectRange(xRetval.getB2DRange(rViewInformation2D));
-const basegfx::B2DRange 
aViewRange(rViewInformation2D.getViewport());
+const basegfx::B2DRange& 
aViewRange(rViewInformation2D.getViewport());
 
 // check geometrical visibility
 if(!aViewRange.isEmpty() && 
!aViewRange.overlaps(aObjectRange))
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx 
b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
index ef973ecea8c8..c6c69d77953f 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
@@ -384,7 +384,7 @@ drawinglayer::primitive2d::Primitive2DContainer 
ViewObjectContactOfPageHierarchy
 // get ranges
 const drawinglayer::geometry::ViewInformation2D& 
rViewInformation2D(GetObjectContact().getViewInformation2D());
 const basegfx::B2DRange 
aObjectRange(xRetval.getB2DRange(rViewInformation2D));
-const basegfx::B2DRange 
aViewRange(rViewInformation2D.getViewport());
+const basegfx::B2DRange& 
aViewRange(rViewInformation2D.getViewport());
 
 // check geometrical visibility
 if(!aViewRange.isEmpty() && !aViewRange.overlaps(aObjectRange))
@@ -609,7 +609,7 @@ drawinglayer::primitive2d::Primitive2DContainer 
ViewObjectContactOfSdrPage::getP
 // get ranges
 const drawinglayer::geometry::ViewInformation2D& 
rViewInformation2D(GetObjectContact().getViewInformation2D());
 const basegfx::B2DRange 
aObjectRange(xRetval.getB2DRange(rViewInformation2D));
-const basegfx::B2DRange 
aViewRange(rViewInformation2D.getViewport());
+const basegfx::B2DRange& 
aViewRange(rViewInformation2D.getViewport());
 
 // check geometrical visibility
 if(!aViewRange.isEmpty() && !aViewRange.overlaps(aObjectRange))
diff --git a/svx/source/sdr/overlay/overlayobject.cxx 
b/svx/source/sdr/overlay/overlayobject.cxx
index 1be8b6f633cc..641ba16a041d 100644
--- a/svx/source/sdr/overlay/overlayobject.cxx
+++ b/svx/source/sdr/overlay/overlayobject.cxx
@@ -133,7 +133,7 @@ namespace sdr::overlay
 
 if(!rSequence.empty())
 {
-const drawinglayer::geometry::ViewInformation2D 
aViewInformation2D(getOverlayManager()->getCurrentViewInformation2D());
+const drawinglayer::geometry::ViewInformation2D & 
aViewInformation2D(getOverlayManager()->getCurrentViewInformation2D());
 
 const_cast< sdr::overlay::OverlayObject* 
>(this)->maBaseRange =
 rSequence.getB2DRange(aViewInformation2D);
diff --git 

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

2021-07-22 Thread Andrea Gelmini (via logerrit)
 svx/source/svdraw/svdopath.cxx |2 +-
 sw/source/uibase/shells/basesh.cxx |6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit ae3c5ef23b8b91c97cfe99adbcd831ee34f9dbf3
Author: Andrea Gelmini 
AuthorDate: Tue Jul 20 17:03:37 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Jul 22 20:35:50 2021 +0200

Fix typos

Change-Id: I38c7fda55f7d24f7265b58d56222187f2aa1e5d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119286
Tested-by: Adolfo Jayme Barrientos 
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index b13b586e707d..7f2b4f1fb77c 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -2065,7 +2065,7 @@ void SdrPathObj::AddToPlusHdlList(SdrHdlList& rHdlList, 
SdrHdl& rHdl) const
 // SdrObjCustomShape will still use a different version of this method that
 // does not consider the rotation. Otherwise, the rotated SdrObjCustomShape
 // would become mistakenly larger after save and reload (tdf#91687).
-// The invokation of the GetLogicRect() method that caused tdf#123321 was in
+// The invocation of the GetLogicRect() method that caused tdf#123321 was in
 // PlcDrawObj::WritePlc().
 const tools::Rectangle ::GetLogicRect() const
 {
diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index c327ad40c941..4a0691d36f99 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -1345,7 +1345,7 @@ void SwBaseShell::Execute(SfxRequest )
 case RES_SHADOW:
 {
 rSh.StartAllAction();
-// Tabele cell(s) selected?
+// Table cell(s) selected?
 if ( rSh.IsTableMode() )
 {
 SwFrameFormat *pFormat = rSh.GetTableFormat();
@@ -1377,7 +1377,7 @@ void SwBaseShell::Execute(SfxRequest )
 
 case SID_ATTR_BORDER_OUTER:
 {
-// Tabele cell(s) selected?
+// Table cell(s) selected?
 if ( rSh.IsTableMode() )
 {
 // Set border attributes Get/SetTabBorders()
@@ -2545,7 +2545,7 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
 void SwBaseShell::GetBorderState(SfxItemSet )
 {
 SwWrtShell  = GetShell();
-// Tabele cell(s) selected?
+// Table cell(s) selected?
 bool bPrepare = true;
 bool bTableMode = rSh.IsTableMode();
 if ( bTableMode )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-21 Thread Dennis Francis (via logerrit)
 svx/source/svdraw/svdmrkv.cxx  |2 +-
 sw/source/core/crsr/crsrsh.cxx |7 +--
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 4eaf7e4bf2bd1b1b3d3e7b0c987c472cdd836dc6
Author: Dennis Francis 
AuthorDate: Thu Jun 24 12:38:45 2021 +0530
Commit: Miklos Vajna 
CommitDate: Wed Jul 21 09:39:02 2021 +0200

lok: fix incorrect multi-view table selection updates

Use the correct writer shell to fetch selected table info, else the
active view's table selection data is sent to all views which is
incorrect.

Also avoid interference from draw empty table updates in
SdrMarkView::SetMarkHandlesForLOKit() if we are in writer.

[tml: In this branch, this commit also includes a fix from Miklos.]

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

diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 0d5b332592ad..d396b521f2c9 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -1088,7 +1088,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 boost::property_tree::write_json(aStream, aTableJsonTree);
 
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TABLE_SELECTED, 
aStream.str().c_str());
 }
-else
+else if (!getSdrModelFromSdrView().IsWriter())
 {
 
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TABLE_SELECTED, "{}");
 }
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 58a57fcd1df9..e68c91710f43 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -72,6 +72,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -2051,10 +2052,12 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, 
bool bIdleEnd )
 
 void SwCursorShell::sendLOKCursorUpdates()
 {
-SwWrtShell* pShell = GetDoc()->GetDocShell()->GetWrtShell();
-if (!pShell)
+SwView* pView = static_cast(GetSfxViewShell());
+if (!pView || !pView->GetWrtShellPtr())
 return;
 
+SwWrtShell* pShell = >GetWrtShell();
+
 SwFrame* pCurrentFrame = GetCurrFrame();
 SelectionType eType = pShell->GetSelectionType();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-30 Thread Luboš Luňák (via logerrit)
 svx/source/sidebar/nbdtmg.cxx   |2 +-
 sw/source/filter/html/htmlflywriter.cxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 8ed2142789b3db66c5ab28087040dee7c0ca6341
Author: Luboš Luňák 
AuthorDate: Tue Jun 15 15:24:15 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Jun 30 20:56:39 2021 +0200

fix a size warning

d7855213ae60d79f converted this incorrectly, the code right above
may set the size as (0,0), and before the commit the invalid size
was only negative.

Change-Id: I198d025f5c02780ae509f97782bc41ac77fa3407
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117376
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-by: Luboš Luňák 

diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index 76d1004e61dc..3c744fbf97b4 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -852,7 +852,7 @@ void OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum, 
sal_uInt16 nIndex, sal_uInt1
 const Graphic* pGrf = 
pLevelSettings->pBrushItem->GetGraphic();
 Size aSize = pLevelSettings->aSize;
 sal_Int16 eOrient = text::VertOrientation::LINE_CENTER;
-if (!isResetSize  && aFmt.GetGraphicSize()!=Size(0,0))\
+if (!isResetSize  && aFmt.GetGraphicSize()!=Size(0,0))
 aSize = aFmt.GetGraphicSize();
 else if (aSize.IsEmpty() && pGrf)
 aSize = SvxNumberFormat::GetGraphicSizeMM100( pGrf );
diff --git a/sw/source/filter/html/htmlflywriter.cxx 
b/sw/source/filter/html/htmlflywriter.cxx
index 472f406c28c6..bc065a7d64c0 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -685,7 +685,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const 
SwFrameFormat ,
   (nPercentHeight ? 0
   : pFSItem->GetHeight()-aTwipSpc.Height()) );
 
-OSL_ENSURE( !aTwipSz.IsEmpty(), "Frame size minus spacing  < 0!!!???" 
);
+OSL_ENSURE( aTwipSz.Width() >= 0 && aTwipSz.Height() >= 0, "Frame size 
minus spacing  < 0!!!???" );
 if( aTwipSz.Width() < 0 )
 aTwipSz.setWidth( 0 );
 if( aTwipSz.Height() < 0 )
@@ -964,7 +964,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& 
aHtml, const SwFrameForma
   (nPercentHeight ? 0
   : pFSItem->GetHeight()-aTwipSpc.Height()) );
 
-OSL_ENSURE( !aTwipSz.IsEmpty(), "Frame size minus spacing < 0!!!???" );
+OSL_ENSURE( aTwipSz.Width() >= 0 && aTwipSz.Height() >= 0, "Frame size 
minus spacing < 0!!!???" );
 if( aTwipSz.Width() < 0 )
 aTwipSz.setWidth( 0 );
 if( aTwipSz.Height() < 0 )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-04 Thread merttumer (via logerrit)
 svx/source/svdraw/svdmrkv.cxx  |   21 -
 sw/source/core/draw/dview.cxx  |6 --
 sw/source/uibase/shells/drawsh.cxx |   10 +-
 sw/source/uibase/uiview/view2.cxx  |7 ++-
 4 files changed, 35 insertions(+), 9 deletions(-)

New commits:
commit 6c879cd2dc4517c8ee9dbff0f228f95702e7f88b
Author: merttumer 
AuthorDate: Mon May 24 10:52:13 2021 +0300
Commit: Mert Tumer 
CommitDate: Fri Jun 4 10:39:44 2021 +0200

Extended MoveShapeHandle command for Anchors as well

Change-Id: I0e2811802f17831097a86103571b505a7557717a
Signed-off-by: merttumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116040
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116299
Tested-by: Jenkins

diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index eef111ce4103..5f368c04a4a3 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -982,6 +982,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 {
 boost::property_tree::ptree responseJSON;
 boost::property_tree::ptree others;
+boost::property_tree::ptree anchor;
 boost::property_tree::ptree rectangle;
 boost::property_tree::ptree poly;
 boost::property_tree::ptree custom;
@@ -1016,6 +1017,14 @@ void 
SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S
 {
 selectedNode = 
 }
+else if (kind == 
static_cast(SdrHdlKind::Anchor) || kind == 
static_cast(SdrHdlKind::Anchor_TR))
+{
+if (getSdrModelFromSdrView().IsWriter())
+selectedNode = 
+else
+// put it to others as we dont render them except 
in writer
+selectedNode = 
+}
 else
 {
 selectedNode = 
@@ -1034,6 +1043,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 nodes.add_child("rectangle", rectangle);
 nodes.add_child("poly", poly);
 nodes.add_child("custom", custom);
+nodes.add_child("anchor", anchor);
 nodes.add_child("others", others);
 responseJSON.add_child("kinds", nodes);
 std::stringstream aStream;
@@ -1391,11 +1401,6 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* 
pOtherShell)
 }
 }
 
-// moved it here to access all the handles for callback.
-if (bTiledRendering && pViewShell)
-{
-SetMarkHandlesForLOKit(aRect, pOtherShell);
-}
 // rotation point/axis of reflection
 if(!bLimitedRotation)
 {
@@ -1408,6 +1413,12 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* 
pOtherShell)
 // add custom handles (used by other apps, e.g. AnchorPos)
 AddCustomHdl();
 
+// moved it here to access all the handles for callback.
+if (bTiledRendering && pViewShell)
+{
+SetMarkHandlesForLOKit(aRect, pOtherShell);
+}
+
 // try to restore focus handle index from remembered values
 if(!bSaveOldFocus)
 return;
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index dfa884e80db5..b2ad0f39c14e 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -243,8 +243,10 @@ void SwDrawView::AddCustomHdl()
 }
 
 // add anchor handle:
-maHdlList.AddHdl( std::make_unique( aPos, ( pAnch->IsVertical() 
&& !pAnch->IsVertLR() ) ||
- pAnch->IsRightToLeft() ) );
+std::unique_ptr hdl = std::make_unique( aPos, ( 
pAnch->IsVertical() && !pAnch->IsVertLR() ) ||
+ pAnch->IsRightToLeft() );
+hdl->SetObjHdlNum(maHdlList.GetHdlCount());
+maHdlList.AddHdl(std::move(hdl));
 }
 
 SdrObject* SwDrawView::GetMaxToTopObj( SdrObject* pObj ) const
diff --git a/sw/source/uibase/shells/drawsh.cxx 
b/sw/source/uibase/shells/drawsh.cxx
index 9f0de0c2a0f1..bd1e50e26871 100644
--- a/sw/source/uibase/shells/drawsh.cxx
+++ b/sw/source/uibase/shells/drawsh.cxx
@@ -210,7 +210,15 @@ void SwDrawShell::Execute(SfxRequest )
 const sal_uLong handleNum = handleNumItem->GetValue();
 const sal_uLong newPosX = newPosXTwips->GetValue();
 const sal_uLong newPosY = newPosYTwips->GetValue();
-pSdrView->MoveShapeHandle(handleNum, Point(newPosX, newPosY), 
OrdNum ? OrdNum->GetValue() : -1);
+const Point mPoint(newPosX, newPosY);
+const SdrHdl* handle = 
pSdrView->GetHdlList().GetHdl(handleNum);
+if (handle->GetKind() == SdrHdlKind::Anchor || 
handle->GetKind() 

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

2021-05-20 Thread Caolán McNamara (via logerrit)
 svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx |5 
++---
 svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx |2 +-
 sw/source/ui/config/mailconfigpage.cxx|8 
+++-
 3 files changed, 6 insertions(+), 9 deletions(-)

New commits:
commit a69cc693fee8581d1612e79be13e0234ad72cd6e
Author: Caolán McNamara 
AuthorDate: Wed May 19 20:55:17 2021 +0100
Commit: Caolán McNamara 
CommitDate: Thu May 20 10:43:43 2021 +0200

use toggle instead of click for RadioButton

only listen for one toggle for the button grouping

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

diff --git 
a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx 
b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
index 33b8c27fa913..5a693a90cc76 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
@@ -391,8 +391,7 @@ 
ChineseDictionaryDialog::ChineseDictionaryDialog(weld::Window* pParent)
 m_xED_Mapping->connect_changed( LINK( this, ChineseDictionaryDialog, 
EditFieldsHdl ) );
 m_xLB_Property->connect_changed( LINK( this, ChineseDictionaryDialog, 
EditFieldsListBoxHdl ) );
 
-m_xRB_To_Simplified->connect_clicked( LINK( this, ChineseDictionaryDialog, 
DirectionHdl ) );
-m_xRB_To_Traditional->connect_clicked( LINK( this, 
ChineseDictionaryDialog, DirectionHdl ) );
+m_xRB_To_Simplified->connect_toggled( LINK( this, ChineseDictionaryDialog, 
DirectionHdl ) );
 
 m_xCT_DictionaryToSimplified->connect_changed( LINK( this, 
ChineseDictionaryDialog, MappingSelectHdl ));
 m_xCT_DictionaryToTraditional->connect_changed( LINK( this, 
ChineseDictionaryDialog, MappingSelectHdl ));
@@ -424,7 +423,7 @@ void 
ChineseDictionaryDialog::setDirectionAndTextConversionOptions( bool bDirect
 updateAfterDirectionChange();
 }
 
-IMPL_LINK_NOARG(ChineseDictionaryDialog, DirectionHdl, weld::Button&, void)
+IMPL_LINK_NOARG(ChineseDictionaryDialog, DirectionHdl, weld::ToggleButton&, 
void)
 {
 updateAfterDirectionChange();
 }
diff --git 
a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx 
b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx
index ee179dd92e58..f333545e479f 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx
@@ -108,7 +108,7 @@ public:
 virtual short run() override;
 
 private:
-DECL_LINK( DirectionHdl, weld::Button&, void );
+DECL_LINK( DirectionHdl, weld::ToggleButton&, void );
 DECL_LINK( EditFieldsHdl, weld::Entry&, void );
 DECL_LINK( EditFieldsListBoxHdl, weld::ComboBox&, void );
 DECL_LINK( MappingSelectHdl, weld::TreeView&, void );
diff --git a/sw/source/ui/config/mailconfigpage.cxx 
b/sw/source/ui/config/mailconfigpage.cxx
index e51d301951af..81bebf9c0253 100644
--- a/sw/source/ui/config/mailconfigpage.cxx
+++ b/sw/source/ui/config/mailconfigpage.cxx
@@ -94,7 +94,7 @@ class SwAuthenticationSettingsDialog : public 
SfxDialogController
 DECL_LINK(OKHdl_Impl, weld::Button&, void);
 DECL_LINK(CheckBoxHdl_Impl, weld::ToggleButton&, void);
 DECL_LINK(RadioButtonHdl_Impl, weld::ToggleButton&, void);
-DECL_LINK(InServerHdl_Impl, weld::Button&, void);
+DECL_LINK(InServerHdl_Impl, weld::ToggleButton&, void);
 
 public:
 SwAuthenticationSettingsDialog(weld::Window* pParent, 
SwMailMergeConfigItem& rItem);
@@ -391,9 +391,7 @@ 
SwAuthenticationSettingsDialog::SwAuthenticationSettingsDialog(
 m_xSeparateAuthenticationRB->connect_toggled( aRBLink );
 m_xSMTPAfterPOPRB->connect_toggled( aRBLink );
 m_xOKPB->connect_clicked( LINK( this, SwAuthenticationSettingsDialog, 
OKHdl_Impl));
-Link aInServerLink = LINK( this, 
SwAuthenticationSettingsDialog, InServerHdl_Impl );
-m_xPOP3RB->connect_clicked( aInServerLink );
-m_xIMAPRB->connect_clicked( aInServerLink );
+m_xPOP3RB->connect_toggled(LINK(this, SwAuthenticationSettingsDialog, 
InServerHdl_Impl));
 
 m_xAuthenticationCB->set_active(m_rConfigItem.IsAuthentication());
 if (m_rConfigItem.IsSMTPAfterPOP())
@@ -474,7 +472,7 @@ IMPL_LINK_NOARG(SwAuthenticationSettingsDialog, 
RadioButtonHdl_Impl, weld::Toggl
 m_xInPasswordED->set_sensitive(bNotSeparate);
 }
 
-IMPL_LINK_NOARG( SwAuthenticationSettingsDialog, InServerHdl_Impl, 
weld::Button&, void)
+IMPL_LINK_NOARG( SwAuthenticationSettingsDialog, InServerHdl_Impl, 
weld::ToggleButton&, void)
 {
 bool bPOP = m_xPOP3RB->get_active();
 m_rConfigItem.SetInServerPOP(bPOP);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

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

2021-03-25 Thread Jim Raykowski (via logerrit)
 svx/source/svdraw/svdedtv.cxx  |   12 +++
 svx/source/svdraw/svdobj.cxx   |   38 +
 sw/source/core/frmedt/feshview.cxx |2 -
 3 files changed, 43 insertions(+), 9 deletions(-)

New commits:
commit 50b731c84cb17d7f05a690d90588e90ee267d1c2
Author: Jim Raykowski 
AuthorDate: Thu Nov 12 13:18:16 2020 -0900
Commit: Noel Grandin 
CommitDate: Thu Mar 25 20:28:30 2021 +0100

tdf#34828 Give draw object a name when made

For Writer and Calc this patch sets a name to a newly created draw
object. The name is constructed from the defined singular name of the
object, followed by a space, followed by the first available whole number
begining with 1 that will provide name uniqueness.

For Draw/Impress names are not set for an object on creation. Unnamed
objects have unique names given only in the Navigator tree. The unnamed
object names shown in the tree are based on the order of shapes in the
document. This patch does not change any name behavior for Draw/Impress.

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

diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index 56cd41c700b1..c49474cf6c20 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 
+#include 
 
 using namespace com::sun::star;
 
@@ -1002,6 +1003,17 @@ bool SdrEditView::InsertObjectAtView(SdrObject* pObj, 
SdrPageView& rPV, SdrInser
 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pObj));
 }
 
+css::uno::Reference 
xServices(GetModel()->getUnoModel(),
+  css::uno::UNO_QUERY);
+if (xServices->supportsService("com.sun.star.sheet.SpreadsheetDocument") ||
+xServices->supportsService("com.sun.star.text.TextDocument"))
+{
+const bool bUndo(IsUndoEnabled());
+GetModel()->EnableUndo(false);
+pObj->MakeNameUnique();
+GetModel()->EnableUndo(bUndo);
+}
+
 if (!(nOptions & SdrInsertFlags::DONTMARK)) {
 if (!(nOptions & SdrInsertFlags::ADDMARK)) UnmarkAllObj();
 MarkObj(pObj,);
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 9413f5152d47..71272cb85a20 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -118,6 +118,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 using namespace ::com::sun::star;
 
 
@@ -3060,6 +3063,22 @@ bool SdrObject::IsTextBox() const
 
 void SdrObject::MakeNameUnique()
 {
+if (GetName().isEmpty())
+{
+if (const E3dScene* pE3dObj = dynamic_cast(this))
+{
+SdrObjList* pObjList = pE3dObj->GetSubList();
+if (pObjList)
+{
+SdrObject* pObj0 = pObjList->GetObj(0);
+if (pObj0)
+SetName(pObj0->TakeObjNameSingul());
+}
+}
+else
+SetName(TakeObjNameSingul());
+}
+
 std::unordered_set aNameSet;
 MakeNameUnique(aNameSet);
 }
@@ -3086,17 +3105,20 @@ void 
SdrObject::MakeNameUnique(std::unordered_set& rNameSet)
 }
 }
 
-OUString sName(GetName());
-OUString sRootName(GetName());
-sal_Int32 index = sName.lastIndexOf("_");
-if ( index > 0)
-sRootName = sRootName.copy(0, index);
+OUString sName(GetName().trim());
+OUString sRootName(sName);
 
-sal_uInt32 n = 0;
-while (rNameSet.find(sName) != rNameSet.end())
+if (!sName.isEmpty() && rtl::isAsciiDigit(sName[sName.getLength() - 1]))
 {
-sName = sRootName + "_" + OUString::number(n++);
+sal_Int32 nPos(sName.getLength() - 1);
+while (nPos > 0 && rtl::isAsciiDigit(sName[--nPos]));
+sRootName = sName.copy(0, nPos + 1).trim();
 }
+else
+sName += " 1";
+
+for (sal_uInt32 n = 1; rNameSet.find(sName) != rNameSet.end(); n++)
+sName = sRootName + " " + OUString::number(n);
 rNameSet.insert(sName);
 
 SetName(sName);
diff --git a/sw/source/core/frmedt/feshview.cxx 
b/sw/source/core/frmedt/feshview.cxx
index af1a729eb446..749a58439f0d 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -2038,7 +2038,7 @@ bool SwFEShell::ImpEndCreate()
 {
 bool bRestore = GetDoc()->GetIDocumentUndoRedo().DoesDrawUndo();
 GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false);
-rSdrObj.SetName(GetUniqueShapeName());
+rSdrObj.MakeNameUnique();
 GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(bRestore);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-06 Thread Szymon Kłos (via logerrit)
 svx/source/inc/StylesPreviewWindow.hxx  |   17 ++
 svx/source/tbxctrls/StylesPreviewWindow.cxx |   32 +---
 sw/source/uibase/app/docst.cxx  |4 +++
 3 files changed, 49 insertions(+), 4 deletions(-)

New commits:
commit 01d99c0005f67d6ecb139bae7463dc25d45884ef
Author: Szymon Kłos 
AuthorDate: Tue Mar 2 12:18:21 2021 +0100
Commit: Szymon Kłos 
CommitDate: Sat Mar 6 16:09:28 2021 +0100

Styles preview: use listener to trigger update

Do not render all styles on every selection change.
Use listener to detect styles modification.

Change-Id: I6d41acd7acad160d1477281d2b3d473233def4d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111833
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112013
Tested-by: Jenkins

diff --git a/svx/source/inc/StylesPreviewWindow.hxx 
b/svx/source/inc/StylesPreviewWindow.hxx
index 7c2c572708ef..533ff40601b4 100644
--- a/svx/source/inc/StylesPreviewWindow.hxx
+++ b/svx/source/inc/StylesPreviewWindow.hxx
@@ -28,6 +28,7 @@
 
 class StylesPreviewWindow_Base;
 
+/// Listener for style selection
 class StyleStatusListener : public SfxStatusListener
 {
 StylesPreviewWindow_Base* m_pPreviewControl;
@@ -40,6 +41,19 @@ public:
 void StateChanged(SfxItemState eState, const SfxPoolItem* pState) override;
 };
 
+/// Listener for styles creation or modification
+class StylePoolChangeListener : public SfxListener
+{
+StylesPreviewWindow_Base* m_pPreviewControl;
+SfxStyleSheetBasePool* m_pStyleSheetPool;
+
+public:
+StylePoolChangeListener(StylesPreviewWindow_Base* pPreviewControl);
+~StylePoolChangeListener();
+
+virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
+};
+
 class StyleItemController
 {
 static constexpr unsigned LEFT_MARGIN = 8;
@@ -70,6 +84,7 @@ protected:
 std::unique_ptr m_xStylesView;
 
 rtl::Reference m_xStatusListener;
+std::unique_ptr m_pStylePoolChangeListener;
 
 std::vector> m_aDefaultStyles;
 std::vector> m_aAllStyles;
@@ -87,10 +102,10 @@ public:
 ~StylesPreviewWindow_Base();
 
 void Select(const OUString& rStyleName);
+void UpdateStylesList();
 
 private:
 void Update();
-void UpdateStylesList();
 bool Command(const CommandEvent& rEvent);
 };
 
diff --git a/svx/source/tbxctrls/StylesPreviewWindow.cxx 
b/svx/source/tbxctrls/StylesPreviewWindow.cxx
index f392c2fc90de..59e86b7d2bd6 100644
--- a/svx/source/tbxctrls/StylesPreviewWindow.cxx
+++ b/svx/source/tbxctrls/StylesPreviewWindow.cxx
@@ -72,6 +72,32 @@ void StyleStatusListener::StateChanged(SfxItemState 
/*eState*/, const SfxPoolIte
 m_pPreviewControl->Select(pStateItem->GetStyleName());
 }
 
+StylePoolChangeListener::StylePoolChangeListener(StylesPreviewWindow_Base* 
pPreviewControl)
+: SfxListener()
+, m_pPreviewControl(pPreviewControl)
+{
+SfxObjectShell* pDocShell = SfxObjectShell::Current();
+
+if (pDocShell)
+m_pStyleSheetPool = pDocShell->GetStyleSheetPool();
+
+if (m_pStyleSheetPool)
+{
+StartListening(*m_pStyleSheetPool);
+}
+}
+
+StylePoolChangeListener::~StylePoolChangeListener()
+{
+if (m_pStyleSheetPool)
+EndListening(*m_pStyleSheetPool);
+}
+
+void StylePoolChangeListener::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& 
/*rHint*/)
+{
+m_pPreviewControl->UpdateStylesList();
+}
+
 StyleItemController::StyleItemController(const std::pair& 
aStyleName)
 : m_eStyleFamily(SfxStyleFamily::Para)
 , m_aStyleName(aStyleName)
@@ -335,6 +361,9 @@ StylesPreviewWindow_Base::StylesPreviewWindow_Base(
 
 m_xStatusListener = new StyleStatusListener(this, xDispatchProvider);
 
+m_pStylePoolChangeListener.reset(new StylePoolChangeListener(this));
+
+UpdateStylesList();
 Update();
 }
 
@@ -390,14 +419,11 @@ void StylesPreviewWindow_Base::Select(const OUString& 
rStyleName)
 {
 m_sSelectedStyle = rStyleName;
 
-UpdateStylesList();
 Update();
 }
 
 void StylesPreviewWindow_Base::Update()
 {
-UpdateStylesList();
-
 for (std::vector>::size_type i = 0; i < 
m_aAllStyles.size(); ++i)
 {
 if (m_aAllStyles[i].first == m_sSelectedStyle || 
m_aAllStyles[i].second == m_sSelectedStyle)
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index ff9ea4af3585..f2a414a88955 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -1317,6 +1317,8 @@ void SwDocShell::UpdateStyle(const OUString , 
SfxStyleFamily nFamily, SwWr
 break;
 default: break;
 }
+
+m_xDoc->BroadcastStyleOperation(rName, nFamily, 
SfxHintId::StyleSheetModified);
 }
 
 // NewByExample
@@ -1510,6 +1512,8 @@ void SwDocShell::MakeByExample( const OUString , 
SfxStyleFamily nFamily,
 
 default: break;
 }
+
+m_xDoc->BroadcastStyleOperation(rName, nFamily, 
SfxHintId::StyleSheetCreated);
 }
 
 

[Libreoffice-commits] core.git: svx/source sw/source vcl/osx vcl/source vcl/unx writerfilter/source

2021-02-10 Thread Andrea Gelmini (via logerrit)
 svx/source/dialog/ClassificationDialog.cxx  |1 -
 svx/source/items/grfitem.cxx|2 --
 svx/source/items/rotmodit.cxx   |2 --
 svx/source/sidebar/SelectionAnalyzer.cxx|1 -
 sw/source/core/bastyp/calc.cxx  |   18 --
 sw/source/core/txtnode/swfont.cxx   |   20 
 sw/source/core/unocore/unotbl.cxx   |2 --
 sw/source/filter/ww8/wrtw8nds.cxx   |2 --
 sw/source/filter/xml/xmlfmt.cxx |1 -
 sw/source/filter/xml/xmlimp.cxx |8 
 sw/source/filter/xml/xmltbli.cxx|1 -
 sw/source/uibase/config/viewopt.cxx |3 ---
 sw/source/uibase/dbui/mmconfigitem.cxx  |2 --
 sw/source/uibase/fldui/fldmgr.cxx   |1 -
 vcl/osx/salnativewidgets.cxx|4 
 vcl/source/bitmap/BitmapReadAccess.cxx  |1 -
 vcl/source/filter/ipdf/pdfdocument.cxx  |1 -
 vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx   |1 -
 writerfilter/source/rtftok/rtfdispatchvalue.cxx |1 -
 19 files changed, 72 deletions(-)

New commits:
commit 1eb05baf7cffe5ad747f6ab5ba65e07c7a9dcf80
Author: Andrea Gelmini 
AuthorDate: Tue Feb 9 22:43:17 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Feb 11 08:19:29 2021 +0100

Remove unneeded breaks

Extending this:
https://gerrit.libreoffice.org/c/core/+/110512

Change-Id: I1066aac690fe297a557352266f3405ae29ed4593
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110522
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/svx/source/dialog/ClassificationDialog.cxx 
b/svx/source/dialog/ClassificationDialog.cxx
index 79ebf7548805..412265fefc29 100644
--- a/svx/source/dialog/ClassificationDialog.cxx
+++ b/svx/source/dialog/ClassificationDialog.cxx
@@ -60,7 +60,6 @@ IMPL_STATIC_LINK(ClassificationDialog, KeyInput, const 
KeyEvent&, rKeyEvent, boo
 // Anything else is ignored
 default:
 return true;
-break;
 }
 }
 
diff --git a/svx/source/items/grfitem.cxx b/svx/source/items/grfitem.cxx
index 15625e983f61..2c0b678fbd3c 100644
--- a/svx/source/items/grfitem.cxx
+++ b/svx/source/items/grfitem.cxx
@@ -111,11 +111,9 @@ bool SvxGrfCrop::GetPresentation(
 " T: " + ::GetMetricText( GetTop(), eCoreUnit, MapUnit::MapMM, 
 ) +
 " B: " + ::GetMetricText( GetBottom(), eCoreUnit, 
MapUnit::MapMM,  );
 return true;
-break;
 
 default:
 return false;
-break;
 }
 }
 
diff --git a/svx/source/items/rotmodit.cxx b/svx/source/items/rotmodit.cxx
index a02bc658e447..abd29b2ca1a3 100644
--- a/svx/source/items/rotmodit.cxx
+++ b/svx/source/items/rotmodit.cxx
@@ -64,12 +64,10 @@ bool SvxRotateModeItem::GetPresentation(
 case SfxItemPresentation::Complete:
 rText += GetValueText(GetValue());
 return true;
-break;
 
 case SfxItemPresentation::Nameless:
 rText += OUString::number( GetValue() );
 return true;
-break;
 default: ;//prevent warning
 }
 
diff --git a/svx/source/sidebar/SelectionAnalyzer.cxx 
b/svx/source/sidebar/SelectionAnalyzer.cxx
index baeaffc20858..418940dc7334 100644
--- a/svx/source/sidebar/SelectionAnalyzer.cxx
+++ b/svx/source/sidebar/SelectionAnalyzer.cxx
@@ -231,7 +231,6 @@ EnumContext::Context 
SelectionAnalyzer::GetContextForObjectId_SC(const sal_uInt1
 
 case OBJ_MEDIA:
 return EnumContext::Context::Media;
-break;
 
 default:
 return EnumContext::Context::Unknown;
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index f22dda20ff50..652e269c32d9 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -1057,31 +1057,24 @@ SwSbxValue SwCalc::PrimFunc(bool )
 case CALC_SIN:
 SAL_INFO("sw.calc", "sin");
 return StdFunc(, false);
-break;
 case CALC_COS:
 SAL_INFO("sw.calc", "cos");
 return StdFunc(, false);
-break;
 case CALC_TAN:
 SAL_INFO("sw.calc", "tan");
 return StdFunc(, false);
-break;
 case CALC_ATAN:
 SAL_INFO("sw.calc", "atan");
 return StdFunc(, false);
-break;
 case CALC_ASIN:
 SAL_INFO("sw.calc", "asin");
 return StdFunc(, true);
-break;
 case CALC_ACOS:
 SAL_INFO("sw.calc", "acos");
 return StdFunc(, true);
-break;
 case CALC_ABS:
 SAL_INFO("sw.calc", "abs");
 return StdFunc(, false);
-break;
 case CALC_SIGN:
 {
 SAL_INFO("sw.calc", "sign");
@@ -1090,7 +1083,6 @@ SwSbxValue 

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

2020-10-30 Thread Caolán McNamara (via logerrit)
 svx/source/tbxctrls/tbcontrl.cxx|1 -
 svx/source/tbxctrls/tbunocontroller.cxx |2 +-
 sw/source/uibase/inc/navipi.hxx |1 -
 3 files changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 58dd58c37912396b0d6ebe21fcd73e2a4fffeb34
Author: Caolán McNamara 
AuthorDate: Thu Oct 29 21:09:20 2020 +
Commit: Caolán McNamara 
CommitDate: Fri Oct 30 15:06:55 2020 +0100

don't need to include sfx2/sidebar/SidebarToolBox.hxx

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

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 548aced8073c..9dcd11998461 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -57,7 +57,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/svx/source/tbxctrls/tbunocontroller.cxx 
b/svx/source/tbxctrls/tbunocontroller.cxx
index 57a58a583b70..ada0ada8c97e 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -35,13 +35,13 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
 #include 
 
 #include 
-#include 
 
 using namespace ::com::sun::star;
 
diff --git a/sw/source/uibase/inc/navipi.hxx b/sw/source/uibase/inc/navipi.hxx
index fee94525d577..af232add07a3 100644
--- a/sw/source/uibase/inc/navipi.hxx
+++ b/sw/source/uibase/inc/navipi.hxx
@@ -26,7 +26,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include "conttree.hxx"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-09 Thread Julien Nabet (via logerrit)
 svx/source/xoutdev/_xoutbmp.cxx |5 -
 sw/source/filter/html/htmlflywriter.cxx |2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 7272a2edf113f29edeb8987ce649f85b776d9d23
Author: Julien Nabet 
AuthorDate: Tue Jul 7 10:23:28 2020 +0200
Commit: Julien Nabet 
CommitDate: Thu Jul 9 09:10:54 2020 +0200

tdf#60684: graphic type content must correspond with graphic type extension

Change-Id: I8075b1b44aa400268b4022decb2a56770c81d83b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98239
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index 500a30375c62..15123e853484 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -187,7 +187,10 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, 
OUString& rFileName,
 break;
 }
 
-if( !aExt.isEmpty() )
+// tdf#60684: use native format if possible but it must 
correspond to filter name
+// or no specific format has been required
+// without this, you may save for example file with png 
extension but jpg content
+if( !aExt.isEmpty() && (aExt == rFilterName || 
rFilterName.isEmpty()) )
 {
 if( !(nFlags & XOutFlags::DontAddExtension) )
 aURL.setExtension( aExt );
diff --git a/sw/source/filter/html/htmlflywriter.cxx 
b/sw/source/filter/html/htmlflywriter.cxx
index b41568377580..55163aba520d 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -1825,7 +1825,7 @@ static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, 
const SwFrameFormat& rF
 aMM100Size = OutputDevice::LogicToLogic( rSize.GetSize(),
 MapMode( MapUnit::MapTwip ), MapMode( 
MapUnit::Map100thMM ));
 
-OUString aFilterName("JPG");
+OUString aFilterName("");
 
 if (rHTMLWrt.mbReqIF)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-08 Thread Shivam Kumar Singh (via logerrit)
 svx/source/sidebar/inspector/InspectorTextPanel.cxx   |7 ++-
 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |   10 --
 2 files changed, 6 insertions(+), 11 deletions(-)

New commits:
commit 9abeaaff50e9f6f15c0ef1be5fdabb6fbe1b7a5c
Author: Shivam Kumar Singh 
AuthorDate: Wed Jul 8 09:44:19 2020 +0530
Commit: Mike Kaganski 
CommitDate: Wed Jul 8 14:55:14 2020 +0200

tdf#134567 Show all properties in DPS

Change-Id: If2238a80fbc9fc803fc5e12904964bf4289ba2d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98310
Tested-by: Jenkins
Tested-by: Heiko Tietze 
Reviewed-by: Heiko Tietze 
Reviewed-by: Mike Kaganski 

diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx 
b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
index 906ca736a91a..652e63261713 100644
--- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx
+++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
@@ -44,7 +44,7 @@ InspectorTextPanel::InspectorTextPanel(vcl::Window* pParent,
 : PanelLayout(pParent, "InspectorTextPanel", 
"svx/ui/inspectortextpanel.ui", rxFrame)
 , mxListBoxStyles(m_xBuilder->weld_tree_view("listbox_fonts"))
 {
-mxListBoxStyles->set_size_request(-1, 
mxListBoxStyles->get_height_rows(27));
+mxListBoxStyles->set_size_request(-1, 
mxListBoxStyles->get_height_rows(25));
 }
 
 static void FillBox_Impl(weld::TreeView& rListBoxStyles, const TreeNode& 
current,
@@ -74,6 +74,11 @@ void InspectorTextPanel::updateEntries(const 
std::vector& rStore)
 pTreeDiagram->expand_row(rEntry);
 return false;
 });
+
+std::unique_ptr xEntry = mxListBoxStyles->make_iterator();
+mxListBoxStyles->get_iter_first(*xEntry);
+mxListBoxStyles->iter_next(*xEntry);
+mxListBoxStyles->collapse_row(*xEntry); // Collapse "Default Paragraph 
Style"
 }
 
 InspectorTextPanel::~InspectorTextPanel() { disposeOnce(); }
diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx 
b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
index b4733e0c1633..dbc22de258b5 100644
--- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
+++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
@@ -146,10 +146,8 @@ static void UpdateTree(SwDocShell* pDocSh, 
svx::sidebar::TreeNode& pParentNode,
 {
 uno::Reference xProp1;
 uno::Reference xProp1Set;
-uno::Reference xProp1State;
 xStyleFamily->getByName(sCurrentStyleName) >>= xProp1;
 xStyleFamily->getByName(sCurrentStyleName) >>= xProp1Set;
-xStyleFamily->getByName(sCurrentStyleName) >>= xProp1State;
 OUString aParentCharStyle = xProp1->getParentStyle();
 xProp1Set->getPropertyValue("DisplayName") >>= sDisplayName;
 svx::sidebar::TreeNode pCurrentChild;
@@ -170,10 +168,6 @@ static void UpdateTree(SwDocShell* pDocSh, 
svx::sidebar::TreeNode& pParentNode,
 for (const beans::Property& rProperty : aProperties)
 {
 OUString sPropName = rProperty.Name;
-// If property's current value equals default value
-if (xProp1Set->getPropertyValue(sPropName)
-== xProp1State->getPropertyDefault(sPropName))
-continue;
 
 if (maIsDefined[sPropName])
 continue;
@@ -204,9 +198,7 @@ static void UpdateTree(SwDocShell* pDocSh, 
svx::sidebar::TreeNode& pParentNode,
 }
 
 uno::Reference aProp1Set;
-uno::Reference aProp1State;
 xStyleFamily->getByName(sCurrentStyleName) >>= aProp1Set;
-xStyleFamily->getByName(sCurrentStyleName) >>= aProp1State;
 
 const uno::Sequence aProperties
 = aProp1Set->getPropertySetInfo()->getProperties();
@@ -216,8 +208,6 @@ static void UpdateTree(SwDocShell* pDocSh, 
svx::sidebar::TreeNode& pParentNode,
 for (const beans::Property& rProperty : aProperties)
 {
 OUString aPropertyValuePair, sPropName = rProperty.Name;
-if (aProp1Set->getPropertyValue(sPropName) == 
aProp1State->getPropertyDefault(sPropName))
-continue;
 if (maIsDefined[sPropName])
 continue;
 maIsDefined[sPropName] = true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-06-25 Thread Shivam Kumar Singh (via logerrit)
 svx/source/sidebar/inspector/InspectorTextPanel.cxx   |1 
 sw/source/uibase/sidebar/SwPanelFactory.cxx   |2 
 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |  182 +-
 sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx |   25 ++
 4 files changed, 197 insertions(+), 13 deletions(-)

New commits:
commit 006c65bbd472cb1d7d44e095714e28190b76be0d
Author: Shivam Kumar Singh 
AuthorDate: Fri May 29 13:10:52 2020 +0530
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 25 10:17:07 2020 +0200

Get the property dump of the text at the cursor

We need the property dump consisting of
1) Character Properties
2) Paragraph Properties
3) Character Style Properties
4) Paragraph Style Properties

This patch gives all the properties related to 'Character Styles'
at the cursor.
This patch manages inheritance features, which means, it lists
any property only at that level in which the property has been
redefined for the last time.

Change-Id: Ice2ae9ac92aec4af9d395885e06602753e636457
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95094
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx 
b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
index 68ac911a6408..07ab0ab38ca4 100644
--- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx
+++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
@@ -49,6 +49,7 @@ InspectorTextPanel::InspectorTextPanel(vcl::Window* pParent,
 
 void InspectorTextPanel::updateEntries(std::vector store)
 {
+mxListBoxStyles->clear();
 for (OUString& str : store)
 mxListBoxStyles->append_text(str);
 }
diff --git a/sw/source/uibase/sidebar/SwPanelFactory.cxx 
b/sw/source/uibase/sidebar/SwPanelFactory.cxx
index b073b2801733..b3d1bbf6932f 100644
--- a/sw/source/uibase/sidebar/SwPanelFactory.cxx
+++ b/sw/source/uibase/sidebar/SwPanelFactory.cxx
@@ -172,7 +172,7 @@ Reference SAL_CALL 
SwPanelFactory::createUIElement (
 }
 else if (rsResourceURL.endsWith("/WriterInspectorTextPanel"))
 {
-VclPtr pPanel = 
sw::sidebar::WriterInspectorTextPanel::Create( pParentWindow, xFrame);
+VclPtr pPanel = 
sw::sidebar::WriterInspectorTextPanel::Create( pParentWindow, xFrame, 
pBindings);
 xElement = sfx2::sidebar::SidebarPanelBase::Create(
 rsResourceURL,
 xFrame,
diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx 
b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
index c0fc42be0ac4..10277c7eabe4 100644
--- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
+++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
@@ -18,16 +18,24 @@
  */
 
 #include "WriterInspectorTextPanel.hxx"
-
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
 
-using namespace css;
+#include 
 
 namespace sw::sidebar
 {
-VclPtr
-WriterInspectorTextPanel::Create(vcl::Window* pParent,
- const 
css::uno::Reference& rxFrame)
+VclPtr WriterInspectorTextPanel::Create(vcl::Window* pParent,
+ const 
uno::Reference& rxFrame,
+ SfxBindings* pBindings)
 {
 if (pParent == nullptr)
 throw lang::IllegalArgumentException(
@@ -35,17 +43,175 @@ WriterInspectorTextPanel::Create(vcl::Window* pParent,
 if (!rxFrame.is())
 throw lang::IllegalArgumentException("no XFrame given to 
WriterInspectorTextPanel::Create",
  nullptr, 1);
+if (pBindings == nullptr)
+throw lang::IllegalArgumentException(
+"no SfxBindings given to WriterInspectorTextPanel::Create", 
nullptr, 2);
 
-return VclPtr::Create(pParent, rxFrame);
+return VclPtr::Create(pParent, rxFrame, 
pBindings);
 }
-WriterInspectorTextPanel::WriterInspectorTextPanel(
-vcl::Window* pParent, const css::uno::Reference& 
rxFrame)
+
+WriterInspectorTextPanel::WriterInspectorTextPanel(vcl::Window* pParent,
+   const 
uno::Reference& rxFrame,
+   SfxBindings* pBindings)
 : InspectorTextPanel(pParent, rxFrame)
+, maCharStyle(SID_STYLE_FAMILY1, *pBindings, *this)
+{
+}
+
+void WriterInspectorTextPanel::NotifyItemUpdate(const sal_uInt16 nSId,
+const SfxItemState /*eState*/,
+const SfxPoolItem* /*pState*/)
 {
+SwDocShell* pDocSh = static_cast(SfxObjectShell::Current());
 std::vector store;
+switch (nSId)
+{
+case SID_STYLE_FAMILY1:
+{
+if (pDocSh)
+{
+SwDoc* pDoc = pDocSh->GetDoc();
+SwPaM* pCursor = pDoc->GetEditShell()->GetCursor();
+
+uno::Reference 

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

2020-06-16 Thread Miklos Vajna (via logerrit)
 svx/source/dialog/signaturelinehelper.cxx |1 -
 sw/source/core/doc/textboxhelper.cxx  |1 -
 2 files changed, 2 deletions(-)

New commits:
commit 5199393c84fccc47c72810c061b757bd8167d4c0
Author: Miklos Vajna 
AuthorDate: Tue Jun 16 09:13:15 2020 +0200
Commit: Miklos Vajna 
CommitDate: Tue Jun 16 10:42:10 2020 +0200

Remove some unused includes

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

diff --git a/svx/source/dialog/signaturelinehelper.cxx 
b/svx/source/dialog/signaturelinehelper.cxx
index 066f368db797..91de79aa9478 100644
--- a/svx/source/dialog/signaturelinehelper.cxx
+++ b/svx/source/dialog/signaturelinehelper.cxx
@@ -11,7 +11,6 @@
 
 #include 
 #include 
-#include 
 
 #include 
 #include 
diff --git a/sw/source/core/doc/textboxhelper.cxx 
b/sw/source/core/doc/textboxhelper.cxx
index 51ee8c36e431..fb1a9f4bf764 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -35,7 +35,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-24 Thread Dennis Francis (via logerrit)
 svx/source/xoutdev/xattr.cxx|   13 +++
 sw/source/uibase/shells/drawdlg.cxx |   41 
 2 files changed, 54 insertions(+)

New commits:
commit f08bbb5648c06a387e69f3a0e0a6a9a1eda7fc37
Author: Dennis Francis 
AuthorDate: Sun Mar 22 19:43:03 2020 +0530
Commit: Dennis Francis 
CommitDate: Tue Mar 24 18:52:47 2020 +0100

lokit: unify fill transparency items

Online just listens to .uno:FillFloatTransparence but the set-item
in core it corresponds to, does not represent the fill-transparency
types like 'None' and 'Solid'. This is represented by another item
called XFillTransparencyItem. As a result the mobile wizard does not
show the correct transparency fill type always.
To solve this, this patch encodes the constant transparency percentage
in case of Solid and None(always 0%) as an intensity and stores this
info in the statechange message of .uno:FillFloatTransparence whenever
there is no gradient type and corrects the 'style' attribute of the
message appropriately.

More detailed information is provided as comments at appropriate
places in the patch.

Change-Id: I443ef4ce349badf28f6c2c702b1014868d9c6ed5
(cherry picked from commit 34969e9c04f9305d19826c72a29e38e26794cbe3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90986
Tested-by: Jenkins
Reviewed-by: Dennis Francis 

diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 4b11483e8e3a..2fc8ff28f861 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -2502,6 +2502,19 @@ boost::property_tree::ptree 
XFillFloatTransparenceItem::dumpAsJSON() const
 boost::property_tree::ptree aTree = XFillGradientItem::dumpAsJSON();
 aTree.put("commandName", ".uno:FillFloatTransparence");
 
+if (!bEnabled)
+{
+boost::property_tree::ptree& rState = aTree.get_child("state");
+// When gradient fill is disabled, the intensity fields contain the
+// constant encoded percent-transparency. However we use that here to 
just
+// distinguish between 'None' and 'Solid' types and correct the 'style'
+// property appropriately.
+if (GetGradientValue().GetStartIntens() == 100)
+rState.put("style", "NONE");
+else
+rState.put("style", "SOLID");
+}
+
 return aTree;
 }
 
diff --git a/sw/source/uibase/shells/drawdlg.cxx 
b/sw/source/uibase/shells/drawdlg.cxx
index 78c49e0e5488..9e5939697602 100644
--- a/sw/source/uibase/shells/drawdlg.cxx
+++ b/sw/source/uibase/shells/drawdlg.cxx
@@ -36,6 +36,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 using namespace com::sun::star::drawing;
 
@@ -314,6 +317,40 @@ void SwDrawShell::ExecDrawAttrArgs(SfxRequest const & rReq)
 pView->GetModel()->SetChanged();
 }
 
+static void lcl_unifyFillTransparencyItems(SfxItemSet& rSet)
+{
+// Transparent fill options are None, Solid, Linear, Axial, Radial, 
Elliptical, Quadratic, Square.
+// But this is represented across two items namely XFillTransparenceItem 
(for None and Solid)
+// and XFillFloatTransparenceItem (for the rest). To simplify the 
representation in LOKit case let's
+// use XFillFloatTransparenceItem to carry the information of 
XFillTransparenceItem when gradients
+// are disabled. When gradient transparency is disabled, all fields of 
XFillFloatTransparenceItem are invalid
+// and not used. So convert XFillTransparenceItem's constant transparency 
percentage as an intensity
+// and assign this to the XFillFloatTransparenceItem's start-intensity and 
end-intensity fields.
+// Now the LOK clients need only listen to statechange messages of 
XFillFloatTransparenceItem
+// to get fill-transparency settings instead of listening to two separate 
items.
+
+XFillFloatTransparenceItem* pFillFloatTranspItem =
+const_cast
+
(rSet.GetItem(XATTR_FILLFLOATTRANSPARENCE));
+if (!pFillFloatTranspItem || pFillFloatTranspItem->IsEnabled())
+return;
+
+const XFillTransparenceItem* pFillTranspItem =
+rSet.GetItem(XATTR_FILLTRANSPARENCE);
+
+if (!pFillTranspItem)
+return;
+
+XGradient aTmpGradient = pFillFloatTranspItem->GetGradientValue();
+sal_uInt16 nTranspPercent = pFillTranspItem->GetValue();
+// Encode transparancy percentage as intensity
+sal_uInt16 nIntensity = 100 - std::min
+(std::max(nTranspPercent, 0), 100);
+aTmpGradient.SetStartIntens(nIntensity);
+aTmpGradient.SetEndIntens(nIntensity);
+pFillFloatTranspItem->SetGradientValue(aTmpGradient);
+}
+
 void SwDrawShell::GetDrawAttrState(SfxItemSet& rSet)
 {
 SdrView* pSdrView = GetShell().GetDrawView();
@@ -323,7 +360,11 @@ void SwDrawShell::GetDrawAttrState(SfxItemSet& rSet)
 bool bDisable = Disable( rSet );
 
 if( !bDisable )
+{
 pSdrView->GetAttributes( rSet );

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

2020-02-17 Thread Justin Luth (via logerrit)
 svx/source/svdraw/svdotextdecomposition.cxx |2 +-
 sw/source/core/doc/DocumentStylePoolManager.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1e8c16d0487e366c31fb07a7503687eab92f0dcc
Author: Justin Luth 
AuthorDate: Mon Feb 17 12:32:59 2020 +0300
Commit: Justin Luth 
CommitDate: Tue Feb 18 07:45:30 2020 +0100

NFC tdf#120412 cleanup2: use DFLT_ESC_* more

Found in preparation for tdf#80194.
Lots of related bugfixes in LO6.4. tdf#99602, tdf#127316

Change-Id: I1effb71d0fceaad45d211ba20529457d3d7406b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88909
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 8424d21ac6f1..9744d4a524c7 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -196,7 +196,7 @@ namespace
 
 if(DFLT_ESC_AUTO_SUPER == nEsc)
 {
-nEsc = 33;
+nEsc = DFLT_ESC_SUPER;
 }
 else if(DFLT_ESC_AUTO_SUB == nEsc)
 {
diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx 
b/sw/source/core/doc/DocumentStylePoolManager.cxx
index 6aab632e2cff..b25a3cd2a6d5 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -1514,7 +1514,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( 
sal_uInt16 nId )
 case RES_POOLCHR_ENDNOTE_ANCHOR:// Endnote anchor
 case RES_POOLCHR_FOOTNOTE_ANCHOR:   // Footnote anchor
 {
-aSet.Put( SvxEscapementItem( DFLT_ESC_AUTO_SUPER, 58, 
RES_CHRATR_ESCAPEMENT ) );
+aSet.Put( SvxEscapementItem( DFLT_ESC_AUTO_SUPER, DFLT_ESC_PROP, 
RES_CHRATR_ESCAPEMENT ) );
 }
 break;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-10 Thread Pelin Kuran (via logerrit)
 svx/source/unodraw/unopool.cxx |   14 +--
 sw/source/core/layout/fly.cxx  |   55 ++-
 sw/source/core/layout/hffrm.cxx|   17 +---
 sw/source/core/layout/paintfrm.cxx |  133 +
 sw/source/core/layout/virtoutp.cxx |8 +-
 5 files changed, 87 insertions(+), 140 deletions(-)

New commits:
commit c3bdf60484298e1a42b5df28c2f2bc0c603510c4
Author: Pelin Kuran 
AuthorDate: Thu Jan 30 12:08:52 2020 +0300
Commit: Michael Stahl 
CommitDate: Mon Feb 10 11:19:39 2020 +0100

tdf#90834: Turn in-line version control comments into good comments

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

diff --git a/svx/source/unodraw/unopool.cxx b/svx/source/unodraw/unopool.cxx
index 4f0742bdce41..5b064ac6fe71 100644
--- a/svx/source/unodraw/unopool.cxx
+++ b/svx/source/unodraw/unopool.cxx
@@ -119,7 +119,6 @@ void SvxUnoDrawPool::getAny( SfxItemPool const * pPool, 
const comphelper::Proper
 if( eMapUnit == MapUnit::Map100thMM )
 nMemberId &= (~CONVERT_TWIPS);
 
-// DVO, OD 10.10.2003 #i18732#
 // Assure, that ID is a Which-ID (it could be a Slot-ID.)
 // Thus, convert handle to Which-ID.
 pPool->GetDefaultItem( pPool->GetWhich( 
static_cast(pEntry->mnHandle) ) ).QueryValue( rValue, nMemberId );
@@ -153,7 +152,6 @@ void SvxUnoDrawPool::putAny( SfxItemPool* pPool, const 
comphelper::PropertyMapEn
 SvxUnoConvertFromMM( eMapUnit, aValue );
 }
 
-// DVO, OD 10.10.2003 #i18732#
 // Assure, that ID is a Which-ID (it could be a Slot-ID.)
 // Thus, convert handle to Which-ID.
 const sal_uInt16 nWhich = pPool->GetWhich( 
static_cast(pEntry->mnHandle) );
@@ -231,8 +229,7 @@ void SvxUnoDrawPool::_getPropertyStates( const 
comphelper::PropertyMapEntry** pp
 {
 while( *ppEntries )
 {
-// OD 13.10.2003 #i18732#
-// Assure, that ID is a Which-ID (it could be a Slot-ID.)
+//Assure, that ID is a Which-ID (it could be a Slot-ID.)
 // Thus, convert handle to Which-ID.
 const sal_uInt16 nWhich = pPool->GetWhich( 
static_cast((*ppEntries)->mnHandle) );
 
@@ -254,7 +251,7 @@ void SvxUnoDrawPool::_getPropertyStates( const 
comphelper::PropertyMapEntry** pp
 }
 break;
 default:
-// OD 13.10.2003 #i18732# - correction:
+//#i18732# - correction:
 // use method  instead of using 
probably
 // incompatible item pool .
 const SfxPoolItem& r1 = pPool->GetDefaultItem( nWhich );
@@ -289,14 +286,12 @@ void SvxUnoDrawPool::_setPropertyToDefault( const 
comphelper::PropertyMapEntry*
 
 SfxItemPool* pPool = getModelPool( true );
 
-// OD 10.10.2003 #i18732#
 // Assure, that ID is a Which-ID (it could be a Slot-ID.)
 // Thus, convert handle to Which-ID.
 const sal_uInt16 nWhich = pPool->GetWhich( 
static_cast(pEntry->mnHandle) );
 if ( pPool && pPool != mpDefaultsPool )
 {
-// OD 13.10.2003 #i18732# - use method 
-// instead of using probably incompatible item pool .
+// use method  instead of using probably 
incompatible item pool .
 pPool->ResetPoolDefaultItem( nWhich );
 }
 }
@@ -304,8 +299,7 @@ void SvxUnoDrawPool::_setPropertyToDefault( const 
comphelper::PropertyMapEntry*
 uno::Any SvxUnoDrawPool::_getPropertyDefault( const 
comphelper::PropertyMapEntry* pEntry )
 {
 SolarMutexGuard aGuard;
-
-// OD 13.10.2003 #i18732# - use method  instead of
+//#i18732# - use method  instead of
 // using probably incompatible item pool 
 uno::Any aAny;
 SfxItemPool* pPool = getModelPool( true );
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 1540097ad5b1..f5974f053b86 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -278,10 +278,8 @@ void SwFlyFrame::DestroyImpl()
 {
 ClearTmpConsiderWrapInfluence(); // remove this from SwLayouter
 
-// OD 2004-01-19 #110582#
 Unchain();
 
-// OD 2004-01-19 #110582#
 DeleteCnt();
 
 if ( GetAnchorFrame() )
@@ -305,7 +303,6 @@ const IDocumentDrawModelAccess& 
SwFlyFrame::getIDocumentDrawModelAccess()
 return GetFormat()->getIDocumentDrawModelAccess();
 }
 
-// OD 2004-01-19 #110582#
 void SwFlyFrame::Unchain()
 {
 if ( GetPrevLink() )
@@ -314,7 +311,6 @@ void SwFlyFrame::Unchain()
 UnchainFrames( this, GetNextLink() );
 }
 
-// OD 2004-01-19 #110582#
 void SwFlyFrame::DeleteCnt()
 {
 SwFrame* pFrame = m_pLower;
@@ -329,7 +325,7 @@ void SwFlyFrame::DeleteCnt()
 }
 else if ( dynamic_cast( pAnchoredObj) 
!=  nullptr )
 {
-// OD 23.06.2003 #108784# - consider 'virtual' 

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

2019-12-09 Thread Caolán McNamara (via logerrit)
 svx/source/dialog/spacinglistbox.cxx |7 
 sw/source/uibase/sidebar/PageFooterPanel.cxx |   39 ---
 sw/source/uibase/sidebar/PageFooterPanel.hxx |6 
 sw/source/uibase/sidebar/PageFormatPanel.cxx |   11 +++
 sw/source/uibase/sidebar/PageFormatPanel.hxx |2 -
 sw/source/uibase/sidebar/PageHeaderPanel.cxx |   38 --
 sw/source/uibase/sidebar/PageHeaderPanel.hxx |6 
 7 files changed, 95 insertions(+), 14 deletions(-)

New commits:
commit fc280552a5ee0131a08aeea5ccfd8cb7b9a6225d
Author: Caolán McNamara 
AuthorDate: Mon Dec 9 20:16:23 2019 +
Commit: Caolán McNamara 
CommitDate: Mon Dec 9 22:25:34 2019 +0100

Related: tdf#129267 change spacing unit when measurement unit changes

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

diff --git a/svx/source/dialog/spacinglistbox.cxx 
b/svx/source/dialog/spacinglistbox.cxx
index e0a508e9830a..85ebc624931c 100644
--- a/svx/source/dialog/spacinglistbox.cxx
+++ b/svx/source/dialog/spacinglistbox.cxx
@@ -29,6 +29,11 @@ SpacingListBox::SpacingListBox(vcl::Window* pParent)
 
 void SpacingListBox::Init(SpacingType eType)
 {
+auto nSelected = GetSelectedEntryPos();
+if (nSelected == LISTBOX_ENTRY_NOTFOUND)
+nSelected = 0;
+Clear();
+
 const std::pair* pResources;
 switch (eType)
 {
@@ -57,7 +62,7 @@ void SpacingListBox::Init(SpacingType eType)
 }
 
 SetDropDownLineCount(8);
-SelectEntryPos(0);
+SelectEntryPos(nSelected);
 }
 
 VCL_BUILDER_FACTORY(SpacingListBox);
diff --git a/sw/source/uibase/sidebar/PageFooterPanel.cxx 
b/sw/source/uibase/sidebar/PageFooterPanel.cxx
index 08be58fa95c4..4cc0c62d0624 100644
--- a/sw/source/uibase/sidebar/PageFooterPanel.cxx
+++ b/sw/source/uibase/sidebar/PageFooterPanel.cxx
@@ -52,6 +52,12 @@ VclPtr PageFooterPanel::Create(
 return VclPtr::Create(pParent, rxFrame, pBindings);
 }
 
+void PageFooterPanel::SetMarginsAndSpacingFieldUnit()
+{
+mpFooterSpacingLB->Init(IsInch(meFUnit) ? SpacingType::SPACING_INCH : 
SpacingType::SPACING_CM);
+mpFooterMarginPresetLB->Init(IsInch(meFUnit) ? SpacingType::MARGINS_INCH : 
SpacingType::MARGINS_CM);
+}
+
 PageFooterPanel::PageFooterPanel(
 vcl::Window* pParent,
 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& 
rxFrame,
@@ -59,9 +65,11 @@ PageFooterPanel::PageFooterPanel(
 PanelLayout(pParent, "PageFooterPanel", 
"modules/swriter/ui/pagefooterpanel.ui", rxFrame),
 mpBindings( pBindings ),
 maHFToggleController(SID_ATTR_PAGE_FOOTER, *pBindings, *this),
+maMetricController(SID_ATTR_METRIC, *pBindings,*this),
 maFooterLRMarginController(SID_ATTR_PAGE_FOOTER_LRMARGIN, *pBindings, 
*this),
 maFooterSpacingController(SID_ATTR_PAGE_FOOTER_SPACING, *pBindings, *this),
 maFooterLayoutController(SID_ATTR_PAGE_FOOTER_LAYOUT, *pBindings, *this),
+meFUnit(GetModuleFieldUnit()),
 aCustomEntry(),
 mpFooterItem( new SfxBoolItem(SID_ATTR_PAGE_FOOTER) ),
 mpFooterLRMarginItem( new SvxLongLRSpaceItem(0, 0, 
SID_ATTR_PAGE_FOOTER_LRMARGIN)),
@@ -70,11 +78,8 @@ PageFooterPanel::PageFooterPanel(
 {
 get(mpFooterToggle, "footertoggle");
 get(mpFooterSpacingLB, "spacingpreset");
-FieldUnit eMetric = ::GetDfltMetric(false);
-mpFooterSpacingLB->Init(IsInch(eMetric) ? SpacingType::SPACING_INCH : 
SpacingType::SPACING_CM);
 get(mpFooterLayoutLB, "samecontentLB");
 get(mpFooterMarginPresetLB, "footermarginpreset");
-mpFooterMarginPresetLB->Init(IsInch(GetModuleFieldUnit()) ? 
SpacingType::MARGINS_INCH : SpacingType::MARGINS_CM);
 get(mpCustomEntry, "customlabel");
 
 Initialize();
@@ -88,6 +93,7 @@ PageFooterPanel::~PageFooterPanel()
 void PageFooterPanel::dispose()
 {
 mpFooterToggle.disposeAndClear();
+maMetricController.dispose();
 mpFooterSpacingLB.disposeAndClear();
 mpFooterLayoutLB.disposeAndClear();
 mpFooterMarginPresetLB.disposeAndClear();
@@ -96,14 +102,29 @@ void PageFooterPanel::dispose()
 PanelLayout::dispose();
 }
 
+FieldUnit PageFooterPanel::GetCurrentUnit(SfxItemState eState, const 
SfxPoolItem* pState)
+{
+FieldUnit eUnit;
+
+if (pState && eState >= SfxItemState::DEFAULT)
+eUnit = static_cast(static_cast(pState)->GetValue());
+else
+eUnit = GetModuleFieldUnit();
+
+return eUnit;
+}
+
 void PageFooterPanel::Initialize()
 {
+SetMarginsAndSpacingFieldUnit();
+
 aCustomEntry = mpCustomEntry->GetText();
 mpFooterToggle->SetClickHdl( LINK(this, PageFooterPanel, FooterToggleHdl) 
);
 mpFooterMarginPresetLB->SetSelectHdl( LINK(this, PageFooterPanel, 
FooterLRMarginHdl));
 mpFooterSpacingLB->SetSelectHdl( LINK(this, PageFooterPanel, 
FooterSpacingHdl));
 mpFooterLayoutLB->SetSelectHdl( LINK(this, PageFooterPanel, 

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

2019-02-28 Thread Libreoffice Gerrit user
 svx/source/dialog/hdft.cxx |2 -
 sw/source/uibase/docvw/HeaderFooterWin.cxx |   55 ++---
 2 files changed, 14 insertions(+), 43 deletions(-)

New commits:
commit 55042cb54fea5f7ad777c03af9bf8197127b6736
Author: Aditya 
AuthorDate: Sun Feb 24 21:17:14 2019 +0530
Commit: Jim Raykowski 
CommitDate: Thu Feb 28 22:04:28 2019 +0100

tdf#116382 Replace old dialog in header and footer drop-down menu

Remove the Background tabpage in "Border/Background" dialog accessed
from Border and Background menu item in Header/Footer drop-down list
and replace it with the tabpages "Area" and "Transparency" of the dialog
accessed from Page Style > Header > "More.." button.
 The old dialog does not have the tabpages "Area" and "Transparency".
In simpler words, the patch is to match both the dialogs
when accessed in two different ways.

Change-Id: Ib84435854389360eba41aecb8578a9a67a92ca1e
Reviewed-on: https://gerrit.libreoffice.org/67483
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 

diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index 2a32ca807f44..9fe7f811d9eb 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -88,7 +88,7 @@ namespace svx {
 {
 bool bRes = false;
 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-ScopedVclPtr 
pDlg(pFact->CreateSvxBorderBackgroundDlg(pParent, *pBBSet, false 
/*bEnableDrawingLayerFillStyles*/));
+ScopedVclPtr 
pDlg(pFact->CreateSvxBorderBackgroundDlg(pParent, *pBBSet, true 
/*bEnableDrawingLayerFillStyles*/));
 if ( pDlg->Execute() == RET_OK && pDlg->GetOutputItemSet() )
 {
 SfxItemIter aIter( *pDlg->GetOutputItemSet() );
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx 
b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 2d1fca27f4f3..307704b99362 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -11,6 +11,8 @@
 #include 
 #include 
 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -423,50 +425,19 @@ void SwHeaderFooterWin::ExecuteCommand(const OString& 
rIdent)
 SwFrameFormat* pHFFormat = const_cast< SwFrameFormat* >( 
rMaster.GetFooter().GetFooterFormat() );
 if ( m_bIsHeader )
 pHFFormat = const_cast< SwFrameFormat* >( 
rMaster.GetHeader().GetHeaderFormat() );
+SfxItemSet aSet( pHFFormat->GetAttrSet() );
 
-SfxItemPool* pPool = pHFFormat->GetAttrSet().GetPool();
-SfxItemSet aSet(
-*pPool,
-svl::Items<
-RES_BACKGROUND, RES_SHADOW,
-XATTR_FILL_FIRST, XATTR_FILL_LAST,
-SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{});
-
-aSet.Put( pHFFormat->GetAttrSet() );
-
-aSet.Put( pHFFormat->makeBackgroundBrushItem() );
-
-// Create a box info item... needed by the dialog
-SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
-const SfxPoolItem *pBoxInfo;
-if ( SfxItemState::SET == pHFFormat->GetAttrSet().GetItemState( 
SID_ATTR_BORDER_INNER,
-true, ) )
-aBoxInfo = *static_cast(pBoxInfo);
-
-aBoxInfo.SetTable( false );
-aBoxInfo.SetDist( true);
-aBoxInfo.SetMinDist( false );
-aBoxInfo.SetDefDist( MIN_BORDER_DIST );
-aBoxInfo.SetValid( SvxBoxInfoItemValidFlags::DISABLE );
-aSet.Put( aBoxInfo );
-
-if (svx::ShowBorderBackgroundDlg(GetFrameWeld(), ))
+// Items to hand over XPropertyList things like XColorList,
+// XHatchList, XGradientList, and XBitmapList to the Area TabPage:
+aSet.MergeRange( SID_COLOR_TABLE, SID_PATTERN_LIST );
+// create needed items for XPropertyList entries from the DrawModel so 
that
+// the Area TabPage can access them
+
rSh.GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()->PutAreaListItems( 
aSet );
+
+if (svx::ShowBorderBackgroundDlg( GetFrameWeld(),  ) )
 {
-const SfxPoolItem* pItem;
-if ( SfxItemState::SET == aSet.GetItemState( RES_BACKGROUND, 
false,  ) ) {
-pHFFormat->SetFormatAttr( *pItem );
-rView.GetDocShell()->SetModified();
-}
-
-if ( SfxItemState::SET == aSet.GetItemState( RES_BOX, false, 
 ) ) {
-pHFFormat->SetFormatAttr( *pItem );
-rView.GetDocShell()->SetModified();
-}
-
-if ( SfxItemState::SET == aSet.GetItemState( RES_SHADOW, false, 
 ) ) {
-pHFFormat->SetFormatAttr( *pItem );
-rView.GetDocShell()->SetModified();
-}
+pHFFormat->SetFormatAttr( aSet );
+rView.GetDocShell()->SetModified();
 }
 }
 else if (rIdent == "delete")
___
Libreoffice-commits 

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

2019-01-18 Thread Libreoffice Gerrit user
 svx/source/dialog/srchdlg.cxx|   19 +--
 sw/source/uibase/uiview/viewsrch.cxx |   24 +---
 2 files changed, 10 insertions(+), 33 deletions(-)

New commits:
commit dba14e6a75b56b75c32cb7f07a56cfc7f13112e5
Author: Mike Kaganski 
AuthorDate: Fri Jan 18 16:23:18 2019 +0300
Commit: Mike Kaganski 
CommitDate: Fri Jan 18 17:17:13 2019 +0100

Ensure itemset ranges are sorted

What used to create sorted range automatically in FID_SEARCH_SEARCHSET
handler in SwView::ExecSearch, over time turned into unsorted. this
prevents using MergeRange on the sets created from the range list; see
https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/24448/consoleFull

> svl/source/items/itemset.cxx:641:
> void SfxItemSet::MergeRange(sal_uInt16, sal_uInt16):
> Assertion `!pRange[2] || (pRange[2] > pRange[1] && pRange[2] - pRange[1] 
> 1)' failed.

So let's just use MergeRange in the SwView::ExecSearch itself, which
would ensure early detection if the initial list gets unsorted.

Change-Id: Id0232190f850e3feb463adfcb3153eafbaad7d9b
Reviewed-on: https://gerrit.libreoffice.org/66607
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 91f62a0eebae..d005a1f5869a 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -1999,23 +1999,14 @@ IMPL_LINK_NOARG(SvxSearchDialog, FormatHdl_Impl, 
Button*, void)
 if ( !pSh || !pImpl->pRanges )
 return;
 
-std::vector aWhRanges;
-
-const sal_uInt16* pPtr = pImpl->pRanges.get();
-while (*pPtr)
-{
-aWhRanges.push_back(*pPtr++);
-}
+SfxItemPool& rPool = pSh->GetPool();
+SfxItemSet aSet(rPool, pImpl->pRanges.get());
 
-aWhRanges.push_back(SID_ATTR_PARA_MODEL);
-aWhRanges.push_back(SID_ATTR_PARA_MODEL);
+aSet.MergeRange(SID_ATTR_PARA_MODEL, SID_ATTR_PARA_MODEL);
 
 sal_uInt16 nBrushWhich = pSh->GetPool().GetWhich(SID_ATTR_BRUSH);
-aWhRanges.push_back(nBrushWhich);
-aWhRanges.push_back(nBrushWhich);
-aWhRanges.push_back(0);
-SfxItemPool& rPool = pSh->GetPool();
-SfxItemSet aSet(rPool, aWhRanges.data());
+aSet.MergeRange(nBrushWhich, nBrushWhich);
+
 OUString aTxt;
 
 aSet.InvalidateAllItems();
diff --git a/sw/source/uibase/uiview/viewsrch.cxx 
b/sw/source/uibase/uiview/viewsrch.cxx
index a127c1a12241..94eb878621ef 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -442,7 +442,6 @@ void SwView::ExecSearch(SfxRequest& rReq)
 /*10 */ RES_CHRATR_ROTATE,  RES_CHRATR_ROTATE,
 /*12 */ RES_CHRATR_SCALEW,  RES_CHRATR_RELIEF,
 /*14 */ RES_CHRATR_OVERLINE,RES_CHRATR_OVERLINE,
-// insert position for CJK/CTL attributes!
 /*16 */ RES_PARATR_LINESPACING, RES_PARATR_HYPHENZONE,
 /*18 */ RES_PARATR_REGISTER,RES_PARATR_REGISTER,
 /*20 */ RES_PARATR_VERTALIGN,   RES_PARATR_VERTALIGN,
@@ -451,33 +450,20 @@ void SwView::ExecSearch(SfxRequest& rReq)
 /*26 */ 0
 };
 
-static const sal_uInt16 aCJKAttr[] =
-{
-RES_CHRATR_CJK_FONT,RES_CHRATR_CJK_WEIGHT,
-RES_CHRATR_EMPHASIS_MARK, RES_CHRATR_TWO_LINES,
-RES_PARATR_SCRIPTSPACE, RES_PARATR_FORBIDDEN_RULES
-};
-static const sal_uInt16 aCTLAttr[] =
-{
-RES_CHRATR_CTL_FONT,RES_CHRATR_CTL_WEIGHT
-};
+SfxItemSet aSet(m_pWrtShell->GetAttrPool(), aNormalAttr);
 
-std::vector aArr;
-aArr.insert( aArr.begin(), aNormalAttr,
-aNormalAttr + SAL_N_ELEMENTS( aNormalAttr ));
 if( SW_MOD()->GetCTLOptions().IsCTLFontEnabled() )
 {
-aArr.insert( aArr.begin() + 16, aCTLAttr,
-aCTLAttr + SAL_N_ELEMENTS( aCTLAttr ));
+aSet.MergeRange(RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_WEIGHT);
 }
 SvtCJKOptions aCJKOpt;
 if( aCJKOpt.IsAnyEnabled() )
 {
-aArr.insert( aArr.begin() + 16, aCJKAttr,
-aCJKAttr + SAL_N_ELEMENTS( aCJKAttr ));
+aSet.MergeRange(RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_WEIGHT);
+aSet.MergeRange(RES_CHRATR_EMPHASIS_MARK, 
RES_CHRATR_TWO_LINES);
+aSet.MergeRange(RES_PARATR_SCRIPTSPACE, 
RES_PARATR_FORBIDDEN_RULES);
 }
 
-SfxItemSet aSet( m_pWrtShell->GetAttrPool(), [0] );
 sal_uInt16 nWhich = SID_SEARCH_SEARCHSET;
 
 if ( FID_SEARCH_REPLACESET == nSlot )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-08-13 Thread Libreoffice Gerrit user
 svx/source/dialog/txencbox.cxx   |4 +++-
 sw/source/ui/dialog/ascfldlg.cxx |2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 9aada6df968b8148f659c5949a0c20fe9cfe69c1
Author: Caolán McNamara 
AuthorDate: Mon Aug 13 10:37:19 2018 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 13 14:12:32 2018 +0200

Reslves: tdf#119212 sort character sets

and save useritem

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

diff --git a/svx/source/dialog/txencbox.cxx b/svx/source/dialog/txencbox.cxx
index 9760215ff966..857dfe74e4c1 100644
--- a/svx/source/dialog/txencbox.cxx
+++ b/svx/source/dialog/txencbox.cxx
@@ -227,6 +227,7 @@ void SvxTextEncodingBox::SelectTextEncoding( const 
rtl_TextEncoding nEnc )
 TextEncodingBox::TextEncodingBox(weld::ComboBoxText* pControl)
 : m_xControl(pControl)
 {
+m_xControl->make_sorted();
 }
 
 TextEncodingBox::~TextEncodingBox()
@@ -236,6 +237,7 @@ TextEncodingBox::~TextEncodingBox()
 void TextEncodingBox::FillFromTextEncodingTable(
 bool bExcludeImportSubsets )
 {
+m_xControl->freeze();
 const sal_uInt32 nCount = SAL_N_ELEMENTS(RID_SVXSTR_TEXTENCODING_TABLE);
 for (sal_uInt32 j = 0; j < nCount; ++j)
 {
@@ -256,9 +258,9 @@ void TextEncodingBox::FillFromTextEncodingTable(
 if ( bInsert )
 InsertTextEncoding(nEnc, 
SvxResId(RID_SVXSTR_TEXTENCODING_TABLE[j].first));
 }
+m_xControl->thaw();
 }
 
-
 void TextEncodingBox::InsertTextEncoding( const rtl_TextEncoding nEnc,
 const OUString& rEntry )
 {
diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx
index 01a5f1139982..5c780926ae43 100644
--- a/sw/source/ui/dialog/ascfldlg.cxx
+++ b/sw/source/ui/dialog/ascfldlg.cxx
@@ -251,6 +251,8 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( weld::Window* pParent, 
SwDocShell& rDocSh,
 
 SwAsciiFilterDlg::~SwAsciiFilterDlg()
 {
+SvtViewOptions aDlgOpt(EViewType::Dialog, 
OStringToOUString(m_xDialog->get_help_id(), RTL_TEXTENCODING_UTF8));
+aDlgOpt.SetUserItem("UserItem", uno::makeAny(m_sExtraData));
 }
 
 void SwAsciiFilterDlg::FillOptions( SwAsciiOptions& rOptions )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-10-20 Thread Andrea Gelmini
 svx/source/svdraw/svddrgmt.cxx  |2 +-
 sw/source/core/draw/dflyobj.cxx |2 +-
 sw/source/core/inc/dflyobj.hxx  |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 68d45e54b02d5800e454a2c81c2692412e5c89bd
Author: Andrea Gelmini 
Date:   Fri Oct 20 17:48:49 2017 +0200

Fix typos

Change-Id: Ia61b174eb48e0cb80d4b7d404d3b815537ba7cb1
Reviewed-on: https://gerrit.libreoffice.org/43615
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index a00528f61af8..77107880917c 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -3770,7 +3770,7 @@ bool SdrDragCrop::EndSdrDrag(bool /*bCopy*/)
 // we call crop (virtual method) on pSdrObject which calls 
VirtFlyDrawObj
 // crop. aRef needs to be adapted to concrete Object's boundaries which
 // is different from Crop-Ranges. This is because the Graphic and it's
-// SdrObject representaion is inside the FlyFrame, but not identical
+// SdrObject representation is inside the FlyFrame, but not identical
 // with it.
 const tools::Rectangle& 
rOutRect(pExternalSdrObject->GetCurrentBoundRect());
 const basegfx::B2DHomMatrix aExternalTransform(
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 29e5e4a94715..1d824b2264e8 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -1037,7 +1037,7 @@ void SwVirtFlyDrawObj::addCropHandles(SdrHdlList& 
rTarget) const
 if(GetFlyFrame()->Frame().HasArea())
 {
 // Use InnerBound, OuterBound (same as GetFlyFrame()->Frame().SVRect())
-// may have a distance to InnerBound which needs to be taken into 
acocunt.
+// may have a distance to InnerBound which needs to be taken into 
account.
 // The Graphic is mapped to InnerBound, as is the rotated Graphic.
 const basegfx::B2DRange aTargetRange(getInnerBound());
 
diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx
index 8766b7980ebc..e2fcac536073 100644
--- a/sw/source/core/inc/dflyobj.hxx
+++ b/sw/source/core/inc/dflyobj.hxx
@@ -58,7 +58,7 @@ class SwVirtFlyDrawObj : public SdrVirtObj
 private:
 SwFlyFrame *m_pFlyFrame;
 
-// RotGrfFlyFrame: Helper to acces sthe rotation angle (in 10th degrees, 
left-handed)
+// RotGrfFlyFrame: Helper to access the rotation angle (in 10th degrees, 
left-handed)
 // of a GraphicFrame
 sal_uInt16 getPossibleRotationFromFraphicFrame(Size& rSize) const;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: svx/source sw/source ucb/source vcl/qa xmloff/source

2017-06-18 Thread Andrea Gelmini
 svx/source/dialog/docrecovery.cxx  |2 +-
 sw/source/filter/xml/xmlithlp.cxx  |2 +-
 ucb/source/ucp/file/prov.cxx   |2 +-
 vcl/qa/cppunit/pdfexport/pdfexport.cxx |4 ++--
 xmloff/source/style/bordrhdl.cxx   |2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit b9ec99ba26e78b9f47bf22a436da1dd0d4aa797b
Author: Andrea Gelmini 
Date:   Thu Jun 15 22:24:55 2017 +0200

Fix typos

Change-Id: If28e198b8e1a26660e07dce49db66a651de43d3f
Reviewed-on: https://gerrit.libreoffice.org/38850
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/svx/source/dialog/docrecovery.cxx 
b/svx/source/dialog/docrecovery.cxx
index 58f613d41480..1aa77acce4df 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -821,7 +821,7 @@ void RecovDocList::InitEntry(SvTreeListEntry* pEntry,
  SvLBoxButtonKind eButtonKind)
 {
 SvTabListBox::InitEntry(pEntry, rText, rImage1, rImage2, eButtonKind);
-DBG_ASSERT( TabCount() == 2, "*RecovDocList::InitEntry(): structure 
missmatch" );
+DBG_ASSERT( TabCount() == 2, "*RecovDocList::InitEntry(): structure 
mismatch" );
 
 SvLBoxString&   rCol = static_cast(pEntry->GetItem(2));
 pEntry->ReplaceItem(o3tl::make_unique(rCol.GetText()), 
2);
diff --git a/sw/source/filter/xml/xmlithlp.cxx 
b/sw/source/filter/xml/xmlithlp.cxx
index d1e46fd31ad0..0315e204dced 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -139,7 +139,7 @@ bool sw_frmitems_parseXMLBorder( const OUString& rValue,
 }
 else
 {
-// missformed
+// misformed
 return false;
 }
 }
diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx
index cd0d4b9e272f..82c2f7b9cf7f 100644
--- a/ucb/source/ucp/file/prov.cxx
+++ b/ucb/source/ucp/file/prov.cxx
@@ -462,7 +462,7 @@ sal_Int32 SAL_CALL
 FileProvider::getFileProviderLocality( const OUString& BaseURL )
 {
 // If the base URL is a 'file' URL, return 10 (very 'local'), otherwise
-// return -1 (missmatch).  What is missing is a fast comparison to ASCII,
+// return -1 (mismatch).  What is missing is a fast comparison to ASCII,
 // ignoring case:
 return BaseURL.getLength() >= 5
&& (BaseURL[0] == 'F' || BaseURL[0] == 'f')
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index d8ef29fe0ba2..3ded9b210f8b 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -631,7 +631,7 @@ void PdfExportTest::testTdf99680()
 // and ensure their amount is equal
 size_t nSaveCount = std::count(pStart, pEnd, 'q');
 size_t nRestoreCount = std::count(pStart, pEnd, 'Q');
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Save/restore graphic state operators count 
mistmatch!", nSaveCount, nRestoreCount);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Save/restore graphic state operators count 
mismatch!", nSaveCount, nRestoreCount);
 }
 
 void PdfExportTest::testTdf99680_2()
@@ -670,7 +670,7 @@ void PdfExportTest::testTdf99680_2()
 // and ensure their amount is equal
 size_t nSaveCount = std::count(pStart, pEnd, 'q');
 size_t nRestoreCount = std::count(pStart, pEnd, 'Q');
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Save/restore graphic state operators 
count mistmatch!", nSaveCount, nRestoreCount);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Save/restore graphic state operators 
count mismatch!", nSaveCount, nRestoreCount);
 }
 }
 
diff --git a/xmloff/source/style/bordrhdl.cxx b/xmloff/source/style/bordrhdl.cxx
index 3efaee4a0417..eab6e84a370d 100644
--- a/xmloff/source/style/bordrhdl.cxx
+++ b/xmloff/source/style/bordrhdl.cxx
@@ -216,7 +216,7 @@ bool XMLBorderHdl::importXML( const OUString& rStrImpValue, 
uno::Any& rValue, co
 }
 else
 {
-// missformed
+// misformed
 return false;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-12-21 Thread Tamás Zolnai
 svx/source/tbxctrls/bulletsnumbering.cxx  |   15 +--
 sw/source/ui/fmtui/tmpdlg.cxx |2 +-
 sw/source/ui/misc/num.cxx |2 +-
 sw/uiconfig/swriter/ui/bulletsandnumbering.ui |4 ++--
 sw/uiconfig/swriter/ui/templatedialog16.ui|4 ++--
 5 files changed, 7 insertions(+), 20 deletions(-)

New commits:
commit 584c745ea484e1f8047278fc83b41b30a90f884d
Author: Tamás Zolnai 
Date:   Wed Dec 21 01:15:45 2016 +

tdf#104737: Bullets and Numbering: inconsistent naming of last tab page

Change-Id: Id1d1d92933c110942fd232067620e8224686a915
Reviewed-on: https://gerrit.libreoffice.org/32256
Tested-by: Jenkins 
Reviewed-by: Maxim Monastirsky 
Reviewed-by: Tamás Zolnai 

diff --git a/svx/source/tbxctrls/bulletsnumbering.cxx 
b/svx/source/tbxctrls/bulletsnumbering.cxx
index 9da0da2..5671bf9 100644
--- a/svx/source/tbxctrls/bulletsnumbering.cxx
+++ b/svx/source/tbxctrls/bulletsnumbering.cxx
@@ -48,7 +48,6 @@ class NumberingToolBoxControl : public 
svt::PopupWindowController
 public:
 explicit NumberingToolBoxControl( const css::uno::Reference< 
css::uno::XComponentContext >& rxContext );
 virtual VclPtr createPopupWindow( vcl::Window* pParent ) 
override;
-bool IsInImpressDraw();
 
 // XStatusListener
 virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& 
rEvent )
@@ -189,14 +188,7 @@ void NumberingPopup::VSSelectHdl(void* pControl)
 }
 else if ( getSelectedEntryId() == 1 )
 {
-OUString aPageName;
-if ( mrController.IsInImpressDraw() )
-aPageName = "customize";
-else
-// Writer variants
-aPageName = "options";
-
-auto aArgs( comphelper::InitPropertySequence( { { "Page", 
css::uno::makeAny( aPageName ) } } ) );
+auto aArgs( comphelper::InitPropertySequence( { { "Page", 
css::uno::makeAny( OUString("customize") ) } } ) );
 mrController.dispatchCommand( ".uno:OutlineBullet", aArgs );
 }
 }
@@ -214,11 +206,6 @@ VclPtr 
NumberingToolBoxControl::createPopupWindow( vcl::Window* pPa
 return VclPtr::Create( *this, pParent, mePageType );
 }
 
-bool NumberingToolBoxControl::IsInImpressDraw()
-{
-return ( m_sModuleName == "com.sun.star.presentation.PresentationDocument" 
||
- m_sModuleName == "com.sun.star.drawing.DrawingDocument" );
-}
 
 void SAL_CALL NumberingToolBoxControl::statusChanged( const 
css::frame::FeatureStateEvent& rEvent )
 throw ( css::uno::RuntimeException, std::exception )
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index f1262f6..f5e4314 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -315,7 +315,7 @@ SwTemplateDlg::SwTemplateDlg(vcl::Window* pParent,
 m_nBulletId = AddTabPage("bullets", RID_SVXPAGE_PICK_BULLET);
 m_nNumId = AddTabPage("outline", RID_SVXPAGE_PICK_NUM);
 m_nBmpId = AddTabPage("graphics", RID_SVXPAGE_PICK_BMP);
-m_nNumOptId = AddTabPage("options", RID_SVXPAGE_NUM_OPTIONS );
+m_nNumOptId = AddTabPage("customize", RID_SVXPAGE_NUM_OPTIONS );
 m_nNumPosId = AddTabPage("position", RID_SVXPAGE_NUM_POSITION );
 }
 break;
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index 254d590..60a11be 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -959,7 +959,7 @@ 
SwSvxNumBulletTabDialog::SwSvxNumBulletTabDialog(vcl::Window* pParent,
 m_nBulletPageId = AddTabPage("bullets", RID_SVXPAGE_PICK_BULLET );
 AddTabPage("outlinenum", RID_SVXPAGE_PICK_NUM );
 AddTabPage("graphics", RID_SVXPAGE_PICK_BMP );
-m_nOptionsPageId = AddTabPage("options", RID_SVXPAGE_NUM_OPTIONS );
+m_nOptionsPageId = AddTabPage("customize", RID_SVXPAGE_NUM_OPTIONS );
 m_nPositionPageId = AddTabPage("position", RID_SVXPAGE_NUM_POSITION );
 }
 
diff --git a/sw/uiconfig/swriter/ui/bulletsandnumbering.ui 
b/sw/uiconfig/swriter/ui/bulletsandnumbering.ui
index 537e9ff..8d37037 100644
--- a/sw/uiconfig/swriter/ui/bulletsandnumbering.ui
+++ b/sw/uiconfig/swriter/ui/bulletsandnumbering.ui
@@ -177,10 +177,10 @@
   
 
 
-  
+  
 True
 False
-Options
+Customize
   
   
 5
diff --git a/sw/uiconfig/swriter/ui/templatedialog16.ui 
b/sw/uiconfig/swriter/ui/templatedialog16.ui
index 28bf3fb..a9cba6d 100644
--- a/sw/uiconfig/swriter/ui/templatedialog16.ui
+++ b/sw/uiconfig/swriter/ui/templatedialog16.ui
@@ -193,10 +193,10 @@
   
 
 
-  
+  
 True
 False
-Options
+Customize
   
   
  

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

2016-12-13 Thread Eike Rathke
 svx/source/dialog/numberingtype.src|1 +
 svx/source/dialog/pagenumberlistbox.cxx|2 ++
 sw/source/uibase/fldui/fldmgr.cxx  |3 ++-
 sw/source/uibase/misc/numberingtypelistbox.cxx |5 +
 4 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 3b4712c3969c705edcfc756492da6db7c0d2e018
Author: Eike Rathke 
Date:   Tue Dec 13 23:11:35 2016 +0100

add "Linked graphics" to RID_SVXSTRARY_NUMBERINGTYPE

... and exclude it at the relevant places that load this resource.
In preparation of eliminating another duplicated UI string definition
instance.

Change-Id: Ia500fffe5c044a76bce2d72e6ea22ff71bb1dfb1

diff --git a/svx/source/dialog/numberingtype.src 
b/svx/source/dialog/numberingtype.src
index f0702d84..4953411 100644
--- a/svx/source/dialog/numberingtype.src
+++ b/svx/source/dialog/numberingtype.src
@@ -26,6 +26,7 @@ StringArray RID_SVXSTRARY_NUMBERINGTYPE
 < "None" ;  5/*SVX_NUM_NUMBER_NONE 
*/; > ;
 < "Bullet" ;6/*SVX_NUM_CHAR_SPECIAL
*/; > ;
 < "Graphics" ;  8/*SVX_NUM_BITMAP  
*/; > ;
+< "Linked graphics" ; 136/*SVX_NUM_BITMAP|0x80 
*/; > ;
 < "1, 2, 3, ..." ;  4/*SVX_NUM_ARABIC  
*/; > ;
 < "A, B, C, ..." ;  
0/*SVX_NUM_CHARS_UPPER_LETTER  */; > ;
 < "a, b, c, ..." ;  
1/*SVX_NUM_CHARS_LOWER_LETTER  */; > ;
diff --git a/svx/source/dialog/pagenumberlistbox.cxx 
b/svx/source/dialog/pagenumberlistbox.cxx
index 2e333b3..9a68592 100644
--- a/svx/source/dialog/pagenumberlistbox.cxx
+++ b/svx/source/dialog/pagenumberlistbox.cxx
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -38,6 +39,7 @@ PageNumberListBox::PageNumberListBox(vcl::Window* pParent)
 // for Bullet and Graphics, ignore those here.
 case css::style::NumberingType::CHAR_SPECIAL:
 case css::style::NumberingType::BITMAP:
+case css::style::NumberingType::BITMAP | LINK_TOKEN:
 break;
 default:
 {
diff --git a/sw/source/uibase/fldui/fldmgr.cxx 
b/sw/source/uibase/fldui/fldmgr.cxx
index 38e8f16..f8b17da 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -603,7 +603,8 @@ OUString SwFieldMgr::GetFormatStr(sal_uInt16 nTypeId, 
sal_uLong nFormatId) const
 for(sal_Int32 nType = 0; nType < aTypes.getLength(); nType++)
 {
 sal_Int16 nCurrent = pTypes[nType];
-if(nCurrent > NumberingType::CHARS_LOWER_LETTER_N)
+if(nCurrent > NumberingType::CHARS_LOWER_LETTER_N &&
+(nCurrent != (NumberingType::BITMAP | LINK_TOKEN)))
 {
 if(nValidEntry == ((sal_Int32)nFormatId) - nOffset)
 {
diff --git a/sw/source/uibase/misc/numberingtypelistbox.cxx 
b/sw/source/uibase/misc/numberingtypelistbox.cxx
index b8a4114..81e5ad5 100644
--- a/sw/source/uibase/misc/numberingtypelistbox.cxx
+++ b/sw/source/uibase/misc/numberingtypelistbox.cxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -114,6 +115,10 @@ void SwNumberingTypeListBox::Reload(SwInsertNumTypes 
nTypeFlags)
 bInsert = bool(nTypeFlags & SwInsertNumTypes::Bitmap );
 
 break;
+case  style::NumberingType::BITMAP | LINK_TOKEN:
+bInsert = false;
+
+break;
 default:
 if (nValue >  style::NumberingType::CHARS_LOWER_LETTER_N)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-12-13 Thread Eike Rathke
 svx/source/dialog/pagenumbering.src|4 +++-
 svx/source/dialog/pagenumberlistbox.cxx|   18 +++---
 sw/source/uibase/fldui/fldmgr.cxx  |9 +
 sw/source/uibase/misc/numberingtypelistbox.cxx |   11 ++-
 4 files changed, 29 insertions(+), 13 deletions(-)

New commits:
commit b845be872cd3fc6b4dc0e6175675a9b31ef7fc42
Author: Eike Rathke 
Date:   Tue Dec 13 18:44:34 2016 +0100

use RID_SVXSTRARY_PAGE_NUMBERING StringArray also in Writer

... and add the two missing extra strings from
sw/source/ui/misc/numberingtypelistbox.src to
svx/source/dialog/pagenumbering.src and filter them out for the page number
dialog, so later we can get rid of yet a 3rd place where those strings are 
to
be translated and maintained.

Change-Id: If7d124692c752f341d4ea11a8914b099f711fa10

diff --git a/svx/source/dialog/pagenumbering.src 
b/svx/source/dialog/pagenumbering.src
index c3b8852..2c3a001 100644
--- a/svx/source/dialog/pagenumbering.src
+++ b/svx/source/dialog/pagenumbering.src
@@ -23,12 +23,14 @@ StringArray RID_SVXSTRARY_PAGE_NUMBERING
 {
 ItemList [ en-US ] =
 {
+< "None" ;  5/*SVX_NUM_NUMBER_NONE 
*/; > ;
+< "Bullet" ;6/*SVX_NUM_CHAR_SPECIAL
*/; > ;
+< "Graphics" ;  8/*SVX_NUM_BITMAP  
*/; > ;
 < "1, 2, 3, ..." ;  4/*SVX_NUM_ARABIC  
*/; > ;
 < "A, B, C, ..." ;  
0/*SVX_NUM_CHARS_UPPER_LETTER  */; > ;
 < "a, b, c, ..." ;  
1/*SVX_NUM_CHARS_LOWER_LETTER  */; > ;
 < "I, II, III, ..." ;   2/*SVX_NUM_ROMAN_UPPER 
*/; > ;
 < "i, ii, iii, ..." ;   3/*SVX_NUM_ROMAN_LOWER 
*/; > ;
-< "None" ;  5/*SVX_NUM_NUMBER_NONE 
*/; > ;
 < "A, .., AA, .., AAA, ..." ;   
9/*SVX_NUM_CHARS_UPPER_LETTER_N*/; > ;
 < "a, .., aa, .., aaa, ..." ;   
10/*SVX_NUM_CHARS_LOWER_LETTER_N*/; > ;
 < "Native Numbering" ;  12 /*NATIVE_NUMBERING  
 */; > ;
diff --git a/svx/source/dialog/pagenumberlistbox.cxx 
b/svx/source/dialog/pagenumberlistbox.cxx
index d02767a..94a9585 100644
--- a/svx/source/dialog/pagenumberlistbox.cxx
+++ b/svx/source/dialog/pagenumberlistbox.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 PageNumberListBox::PageNumberListBox(vcl::Window* pParent)
 : ListBox( pParent, WB_BORDER | WB_DROPDOWN)
@@ -30,10 +31,21 @@ PageNumberListBox::PageNumberListBox(vcl::Window* pParent)
 
 for ( sal_uInt32 i = 0; i < nCnt; ++i )
 {
-OUString aStr = aPaperAry.GetString(i);
 sal_uInt16 nData = aPaperAry.GetValue(i);
-sal_Int32 nPos = InsertEntry( aStr );
-SetEntryData( nPos, reinterpret_cast((sal_uLong)nData) );
+switch (nData)
+{
+// String list array is also used in Writer and contains strings
+// for Bullet and Graphics, ignore those here.
+case css::style::NumberingType::CHAR_SPECIAL:
+case css::style::NumberingType::BITMAP:
+break;
+default:
+{
+OUString aStr = aPaperAry.GetString(i);
+sal_Int32 nPos = InsertEntry( aStr );
+SetEntryData( nPos, 
reinterpret_cast((sal_uLong)nData) );
+}
+}
 }
 SetDropDownLineCount(6);
 }
diff --git a/sw/source/uibase/fldui/fldmgr.cxx 
b/sw/source/uibase/fldui/fldmgr.cxx
index 006b958..600b544 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -39,6 +39,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -592,8 +594,7 @@ OUString SwFieldMgr::GetFormatStr(sal_uInt16 nTypeId, 
sal_uLong nFormatId) const
 {
 if(xNumberingInfo.is())
 {
-SwOLENames aNames(SW_RES(STRRES_NUMTYPES));
-ResStringArray& rNames = aNames.GetNames();
+ResStringArray aNames( SVX_RES( RID_SVXSTRARY_PAGE_NUMBERING ));
 
 Sequence aTypes = 
xNumberingInfo->getSupportedNumberingTypes();
 const sal_Int16* pTypes = aTypes.getConstArray();
@@ -606,10 +607,10 @@ OUString SwFieldMgr::GetFormatStr(sal_uInt16 nTypeId, 
sal_uLong nFormatId) const
 {
 if(nValidEntry == ((sal_Int32)nFormatId) - nOffset)
 {
-sal_uInt32 n = rNames.FindIndex(pTypes[nType]);
+sal_uInt32 n = aNames.FindIndex(pTypes[nType]);
 if (n != RESARRAY_INDEX_NOTFOUND)
 {
-aRet = rNames.GetString(n);
+   

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

2016-11-07 Thread melikeyurtoglu
 svx/source/dialog/checklbx.cxx|9 +
 svx/source/dialog/connctrl.cxx|9 +
 svx/source/dialog/fntctrl.cxx |9 +
 svx/source/dialog/fontlb.cxx  |9 +
 svx/source/dialog/graphctl.cxx|9 +
 svx/source/dialog/measctrl.cxx|9 +
 svx/source/gallery2/galctrl.cxx   |9 +
 svx/source/tbxctrls/SvxColorValueSet.cxx  |   11 +--
 sw/source/ui/fldui/FldRefTreeListBox.cxx  |9 +
 sw/source/ui/index/cnttab.cxx |9 +
 sw/source/ui/table/tautofmt.cxx   |9 +
 sw/source/uibase/dbui/dbtree.cxx  |9 +
 sw/source/uibase/dbui/mailmergehelper.cxx |9 +
 13 files changed, 13 insertions(+), 106 deletions(-)

New commits:
commit 62e5010e5df379a26aa85ca9fd58bf872f020c36
Author: melikeyurtoglu 
Date:   Sun Nov 6 22:34:03 2016 +0200

tdf#91222 VclBuilder constructor cleanup

Change-Id: I2f7e2fd8b9ae45e1aa45cf97750a6107ed9f3036
Signed-off-by: melikeyurtoglu 
Reviewed-on: https://gerrit.libreoffice.org/30673
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/svx/source/dialog/checklbx.cxx b/svx/source/dialog/checklbx.cxx
index e2c2302..3e3789e 100644
--- a/svx/source/dialog/checklbx.cxx
+++ b/svx/source/dialog/checklbx.cxx
@@ -31,14 +31,7 @@ SvxCheckListBox::SvxCheckListBox( vcl::Window* pParent, 
WinBits nWinStyle ) :
 Init_Impl();
 }
 
-VCL_BUILDER_DECL_FACTORY(SvxCheckListBox)
-{
-WinBits nWinStyle = WB_TABSTOP;
-OString sBorder = VclBuilder::extractCustomProperty(rMap);
-if (!sBorder.isEmpty())
-nWinStyle |= WB_BORDER;
-rRet = VclPtr::Create(pParent, nWinStyle);
-}
+VCL_BUILDER_FACTORY_CONSTRUCTOR(SvxCheckListBox, WB_TABSTOP)
 
 void SvxCheckListBox::SetNormalStaticImage(const Image& rNormalStaticImage)
 {
diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx
index 807f361..a81710f 100644
--- a/svx/source/dialog/connctrl.cxx
+++ b/svx/source/dialog/connctrl.cxx
@@ -46,14 +46,7 @@ SvxXConnectionPreview::SvxXConnectionPreview( vcl::Window* 
pParent, WinBits nSty
 SetStyles();
 }
 
-VCL_BUILDER_DECL_FACTORY(SvxXConnectionPreview)
-{
-WinBits nWinStyle = 0;
-OString sBorder = VclBuilder::extractCustomProperty(rMap);
-if (!sBorder.isEmpty())
-nWinStyle |= WB_BORDER;
-rRet = VclPtr::Create(pParent, nWinStyle);
-}
+VCL_BUILDER_FACTORY_CONSTRUCTOR(SvxXConnectionPreview, 0)
 
 SvxXConnectionPreview::~SvxXConnectionPreview()
 {
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 1775785..744b9a1 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -511,14 +511,7 @@ SvxFontPrevWindow::SvxFontPrevWindow(vcl::Window* pParent, 
WinBits nStyle)
 Init();
 }
 
-VCL_BUILDER_DECL_FACTORY(SvxFontPrevWindow)
-{
-WinBits nWinStyle = 0;
-OString sBorder = VclBuilder::extractCustomProperty(rMap);
-if (!sBorder.isEmpty())
-nWinStyle |= WB_BORDER;
-rRet = VclPtr::Create(pParent, nWinStyle);
-}
+VCL_BUILDER_FACTORY_CONSTRUCTOR(SvxFontPrevWindow, 0)
 
 SvxFontPrevWindow::~SvxFontPrevWindow()
 {
diff --git a/svx/source/dialog/fontlb.cxx b/svx/source/dialog/fontlb.cxx
index 265e5c1..151329a 100644
--- a/svx/source/dialog/fontlb.cxx
+++ b/svx/source/dialog/fontlb.cxx
@@ -87,14 +87,7 @@ SvxFontListBox::SvxFontListBox(vcl::Window* pParent, WinBits 
nStyle)
 maEntryFont = maStdFont;
 }
 
-VCL_BUILDER_DECL_FACTORY(SvxFontListBox)
-{
-WinBits nWinStyle = WB_TABSTOP;
-OString sBorder = VclBuilder::extractCustomProperty(rMap);
-if (!sBorder.isEmpty())
-nWinStyle |= WB_BORDER;
-rRet = VclPtr::Create(pParent, nWinStyle);
-}
+VCL_BUILDER_FACTORY_CONSTRUCTOR(SvxFontListBox, WB_TABSTOP)
 
 void SvxFontListBox::InsertFontEntry( const OUString& rString, const 
vcl::Font& rFont, const Color* pColor )
 {
diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx
index 6cd7ca8..0ae7f1c 100644
--- a/svx/source/dialog/graphctl.cxx
+++ b/svx/source/dialog/graphctl.cxx
@@ -76,14 +76,7 @@ GraphCtrl::GraphCtrl( vcl::Window* pParent, WinBits nStyle ) 
:
 EnableRTL( false );
 }
 
-VCL_BUILDER_DECL_FACTORY(GraphCtrl)
-{
-WinBits nWinStyle = 0;
-OString sBorder = VclBuilder::extractCustomProperty(rMap);
-if (!sBorder.isEmpty())
-nWinStyle |= WB_BORDER;
-rRet = VclPtr::Create(pParent, nWinStyle);
-}
+VCL_BUILDER_FACTORY_CONSTRUCTOR(GraphCtrl, 0)
 
 GraphCtrl::~GraphCtrl()
 {
diff --git a/svx/source/dialog/measctrl.cxx b/svx/source/dialog/measctrl.cxx
index 37d005e..78e2a45 100644
--- a/svx/source/dialog/measctrl.cxx
+++ b/svx/source/dialog/measctrl.cxx
@@ -63,14 +63,7 @@ void SvxXMeasurePreview::Resize()
 pMeasureObj->SetPoint(aPt2, 1);
 }
 

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

2016-10-05 Thread Caolán McNamara
 svx/source/sidebar/area/AreaPropertyPanelBase.cxx |3 +--
 svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx |2 +-
 svx/source/sidebar/text/TextCharacterSpacingPopup.cxx |2 +-
 svx/source/sidebar/text/TextUnderlinePopup.cxx|2 +-
 sw/source/uibase/sidebar/PageColumnPopup.cxx  |2 +-
 sw/source/uibase/sidebar/PageMarginPopup.cxx  |2 +-
 sw/source/uibase/sidebar/PageOrientationPopup.cxx |2 +-
 sw/source/uibase/sidebar/PageSizePopup.cxx|2 +-
 8 files changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 43b13e9b73e425683977473ab171e1e140dba6cc
Author: Caolán McNamara 
Date:   Wed Oct 5 14:27:40 2016 +0100

NoAppFocusClose is for menus that have submenus

and don't want the parent menu to be auto popped down
when the submenu gains focus.

or floating windows that explicitly don't want to go away when they lose 
focus,
which all these popups aren't

Change-Id: I53f1f3ac586ff295597c4b9046032d3d976d053e

diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx 
b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index d65d2bd..a62d414 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -1325,8 +1325,7 @@ IMPL_LINK( AreaPropertyPanelBase, ClickTrGrHdl_Impl, 
ToolBox*, pToolBox, void )
 mxTrGrPopup = VclPtr::Create(pToolBox, 
*this);
 mxTrGrPopup->Rearrange(mpFloatTransparenceItem.get());
 OSL_ASSERT( pToolBox->GetItemCommand(pToolBox->GetCurItemId()) == 
UNO_SIDEBARGRADIENT);
-mxTrGrPopup->StartPopupMode(pToolBox, FloatWinPopupFlags::Down |
-  FloatWinPopupFlags::NoAppFocusClose);
+mxTrGrPopup->StartPopupMode(pToolBox, FloatWinPopupFlags::Down);
 }
 
 IMPL_LINK_NOARG(AreaPropertyPanelBase, ChangeTrgrTypeHdl_Impl, ListBox&, void)
diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx 
b/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx
index 14684e9..d8c549f 100644
--- a/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx
+++ b/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx
@@ -41,7 +41,7 @@ VclPtr 
ParaLineSpacingPopup::CreatePopupWindow()
 {
 VclPtr pControl = 
VclPtr::Create(GetSlotId());
 
-pControl->StartPopupMode((), 
FloatWinPopupFlags::GrabFocus|FloatWinPopupFlags::NoAppFocusClose);
+pControl->StartPopupMode((), FloatWinPopupFlags::GrabFocus);
 
 SetPopupWindow(pControl);
 
diff --git a/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx 
b/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx
index 266b9d3..7ce654f 100644
--- a/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx
+++ b/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx
@@ -40,7 +40,7 @@ VclPtr 
TextCharacterSpacingPopup::CreatePopupWindow()
 {
 VclPtr pControl = 
VclPtr::Create(GetSlotId());
 
-pControl->StartPopupMode((), 
FloatWinPopupFlags::GrabFocus|FloatWinPopupFlags::NoAppFocusClose);
+pControl->StartPopupMode((), FloatWinPopupFlags::GrabFocus);
 
 SetPopupWindow(pControl);
 
diff --git a/svx/source/sidebar/text/TextUnderlinePopup.cxx 
b/svx/source/sidebar/text/TextUnderlinePopup.cxx
index 975861cf..c8fdd69 100644
--- a/svx/source/sidebar/text/TextUnderlinePopup.cxx
+++ b/svx/source/sidebar/text/TextUnderlinePopup.cxx
@@ -45,7 +45,7 @@ void TextUnderlinePopup::initialize( const 
css::uno::Sequence< css::uno::Any >&
 VclPtr TextUnderlinePopup::CreatePopupWindow()
 {
 VclPtr pControl = 
VclPtr::Create(GetSlotId());
-pControl->StartPopupMode((), 
FloatWinPopupFlags::GrabFocus|FloatWinPopupFlags::NoAppFocusClose);
+pControl->StartPopupMode((), FloatWinPopupFlags::GrabFocus);
 SetPopupWindow(pControl);
 
 return pControl;
diff --git a/sw/source/uibase/sidebar/PageColumnPopup.cxx 
b/sw/source/uibase/sidebar/PageColumnPopup.cxx
index a07f712..f9e970c 100644
--- a/sw/source/uibase/sidebar/PageColumnPopup.cxx
+++ b/sw/source/uibase/sidebar/PageColumnPopup.cxx
@@ -36,7 +36,7 @@ PageColumnPopup::~PageColumnPopup()
 VclPtr PageColumnPopup::CreatePopupWindow()
 {
 VclPtr pControl = 
VclPtr::Create(GetSlotId());
-pControl->StartPopupMode((), 
FloatWinPopupFlags::GrabFocus|FloatWinPopupFlags::NoAppFocusClose);
+pControl->StartPopupMode((), FloatWinPopupFlags::GrabFocus);
 SetPopupWindow(pControl);
 
 return pControl;
diff --git a/sw/source/uibase/sidebar/PageMarginPopup.cxx 
b/sw/source/uibase/sidebar/PageMarginPopup.cxx
index 29bf801..e8e890d 100644
--- a/sw/source/uibase/sidebar/PageMarginPopup.cxx
+++ b/sw/source/uibase/sidebar/PageMarginPopup.cxx
@@ -36,7 +36,7 @@ PageMarginPopup::~PageMarginPopup()
 VclPtr PageMarginPopup::CreatePopupWindow()
 {
 VclPtr pControl = 
VclPtr::Create(GetSlotId());
-pControl->StartPopupMode((), 
FloatWinPopupFlags::GrabFocus|FloatWinPopupFlags::NoAppFocusClose);
+pControl->StartPopupMode((), FloatWinPopupFlags::GrabFocus);
 

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

2016-09-18 Thread Mark Hung
 svx/source/dialog/svxruler.cxx  |3 +--
 sw/source/uibase/uiview/viewtab.cxx |   11 ---
 2 files changed, 1 insertion(+), 13 deletions(-)

New commits:
commit 17d7ac5c1a06d29cbeeb3efd245ebf2e6725da12
Author: Mark Hung 
Date:   Sun Aug 28 00:17:08 2016 -0700

tdf#54860 make indention handles on the ruler movable inside the table.

Handle of the ruler is disabled when the last row of the table is split
across pages. ( i.e. SwTabCols.bLastRowAllowedToChange is true,
which is implied by SwTabFrame.m_bHasFollowFlowLine. )

m_bHasFollowFlowLine may restrict frame to grow its height in
SwRowFrame::GrowFrame(), but SvxProtectItem affects horizontal ruler,
so I removed it and it seems not harmful.

Change-Id: I519dead13c7124449bc39ed5eb9af38d235eec25
Reviewed-on: https://gerrit.libreoffice.org/28431
Tested-by: Jenkins 
Reviewed-by: Mark Hung 

diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 1d3e1a0..a46c459 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -2621,7 +2621,6 @@ void SvxRuler::CalcMinMax()
 {
 //top border is not moveable when table rows are displayed
 // protection of content means the margin is not moveable
-// - it's just a page break inside of a cell
 if(bHorz && !mxRulerImpl->aProtectItem.IsContentProtected())
 {
 nMaxLeft = mpBorders[0].nMinPos + lNullPix;
@@ -2712,7 +2711,7 @@ void SvxRuler::CalcMinMax()
 else if(mxRulerImpl->bIsTableRows)
 {
 // get the bottom move range from the last border position - 
only available for rows!
-// protection of content means the margin is not moveable - 
it's just a page break inside of a cell
+// protection of content means the margin is not moveable
 if(bHorz || mxRulerImpl->aProtectItem.IsContentProtected())
 {
 nMaxLeft = nMaxRight = mpBorders[mxColumnItem->Count() - 
1].nMaxPos + lNullPix;
diff --git a/sw/source/uibase/uiview/viewtab.cxx 
b/sw/source/uibase/uiview/viewtab.cxx
index a030f90..799a6d8 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -1211,7 +1211,6 @@ void SwView::StateTabWin(SfxItemSet& rSet)
 
 SfxWhichIter aIter( rSet );
 sal_uInt16 nWhich = aIter.FirstWhich();
-bool bPutContentProtection = false;
 
 while ( nWhich )
 {
@@ -1941,10 +1940,6 @@ void SwView::StateTabWin(SfxItemSet& rSet)
 nEnd = aTabCols.GetRight();
 else
 nEnd = aTabCols.GetLeft();
-// put a position protection when the last row cannot be moved
-// due to a page break inside of a row
-if(!aTabCols.IsLastRowAllowedToChange())
-bPutContentProtection = true;
 
 SvxColumnDescription aColDesc( nStart, nEnd,
 aTabCols.GetRight(),
@@ -2329,12 +2324,6 @@ void SwView::StateTabWin(SfxItemSet& rSet)
 }
 nWhich = aIter.NextWhich();
 }
-if(bPutContentProtection)
-{
-SvxProtectItem aProtect(SID_RULER_PROTECT);
-aProtect.SetContentProtect(true);
-rSet.Put(aProtect);
-}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-06-28 Thread Tor Lillqvist
 svx/source/src/errtxt.src  |2 +-
 sw/source/ui/app/error.src |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5263b653b360e140c94eefe6d1f758aacc07ca78
Author: Tor Lillqvist 
Date:   Tue Jun 28 11:41:38 2016 +0300

Drop the dash from "Read-Error"

Change-Id: I12c058bbb01df9c2aad794b5d500ab7ed0502d81

diff --git a/svx/source/src/errtxt.src b/svx/source/src/errtxt.src
index addbe5e..ab00f1b 100644
--- a/svx/source/src/errtxt.src
+++ b/svx/source/src/errtxt.src
@@ -124,7 +124,7 @@ Resource RID_ERRHDL
 };
 String ERRCODE_CLASS_READ
 {
-Text [ en-US ] = "Read-Error" ;
+Text [ en-US ] = "Read Error" ;
 };
 String ERRCODE_CLASS_WRITE
 {
diff --git a/sw/source/ui/app/error.src b/sw/source/ui/app/error.src
index cc5266d..67e4e8d 100644
--- a/sw/source/ui/app/error.src
+++ b/sw/source/ui/app/error.src
@@ -26,7 +26,7 @@
 
 String STR_COMCORE_READERROR
 {
-Text [ en-US ] = "Read-Error" ;
+Text [ en-US ] = "Read Error" ;
 };
 String STR_COMCORE_CANT_SHOW
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-06-27 Thread Miklos Vajna
 svx/source/xml/xmlgrhlp.cxx  |2 ++
 sw/source/core/graphic/ndgrf.cxx |3 +++
 vcl/source/gdi/impgraph.cxx  |4 
 3 files changed, 9 insertions(+)

New commits:
commit fda68426374ed915783fd306c2f56463c757774a
Author: Miklos Vajna 
Date:   Mon Jun 27 11:26:57 2016 +0200

ODT export: add embedded pdf support

Once a .pdf file is inserted in Writer using Insert -> Image, Writer now
advertises a replacement metafile for it (to make LO <= 5.2 and other
ODF readers still be able to read the graphic, where the replacement is
the same as the original metafile, but without .pdf data), and the ODF
export writes the .pdf data with the correct extension / mime type.

Also extend the checksum logic to take care of the pdf data, so on
export xmloff won't think that the full and the replacement graphic are
the same.

The import side is still missing, so no testcase yet.

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

diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 6422c16..66f2a18 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -473,6 +473,7 @@ OUString SvXMLGraphicHelper::ImplGetGraphicMimeType( const 
OUString& rFileName )
 { "jpg", "image/jpeg" },
 { "tif", "image/tiff" },
 { "svg", "image/svg+xml" },
+{ "pdf", "application/pdf" },
 { "wmf", "image/x-wmf" },
 { "eps", "image/x-eps" },
 { "bmp", "image/bmp" },
@@ -691,6 +692,7 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const 
OUString& rURLStr, sal_uInt
 else
 aExtension = ".svg";
 break;
+case GfxLinkType::NativePdf: aExtension = ".pdf"; 
break;
 
 default:
 aExtension = ".grf";
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 7b51313..97e1b6c 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -402,6 +402,9 @@ const GraphicObject* SwGrfNode::GetReplacementGrfObj() const
 {
 const_cast< SwGrfNode* >(this)->mpReplacementGraphic = new 
GraphicObject(rSvgDataPtr->getReplacement());
 }
+else if (GetGrfObj().GetGraphic().getPdfData().hasElements())
+// This returns the metafile, without the pdf data.
+const_cast(this)->mpReplacementGraphic = new 
GraphicObject(GetGrfObj().GetGraphic().GetGDIMetaFile());
 }
 
 return mpReplacementGraphic;
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 933a0a6..25d82d8 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -1406,6 +1406,10 @@ BitmapChecksum ImpGraphic::ImplGetChecksum() const
 
 default:
 nRet = maMetaFile.GetChecksum();
+if (maPdfData.hasElements())
+// Include the PDF data in the checksum, so a metafile with
+// and without PDF data is considered to be different.
+nRet = vcl_get_checksum(nRet, maPdfData.getConstArray(), 
maPdfData.getLength());
 break;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-06 Thread Dennis Roczek
 svx/source/dialog/framelink.cxx  |2 +-
 sw/source/core/text/itrform2.hxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4c57e8bb69ac727713a23a066ac6ed618eff28c8
Author: Dennis Roczek dennisroc...@libreoffice.org
Date:   Sat Jul 18 08:35:11 2015 +0200

fix typo: rectange -- rectangle

Change-Id: I24316edbf9fc95281b0bfdbcffbc670a3df4c853
Reviewed-on: https://gerrit.libreoffice.org/17550
Reviewed-by: Adolfo Jayme Barrientos fit...@ubuntu.com
Tested-by: Adolfo Jayme Barrientos fit...@ubuntu.com

diff --git a/svx/source/dialog/framelink.cxx b/svx/source/dialog/framelink.cxx
index e7e93b8..664d4f7 100644
--- a/svx/source/dialog/framelink.cxx
+++ b/svx/source/dialog/framelink.cxx
@@ -929,7 +929,7 @@ LinePoints lclGetDiagLineEnds( const Rectangle rRect, bool 
bTLBR, long nDiagOff
 
 // Clipping functions for diagonal frame borders.
 
-/** Limits the clipping region to the inner area of a rectange.
+/** Limits the clipping region to the inner area of a rectangle.
 
 Takes the values from the passed DiagLineResult struct into account. They
 may specify to not clip one or more borders of a rectangle.
diff --git a/sw/source/core/text/itrform2.hxx b/sw/source/core/text/itrform2.hxx
index 920d17f..ca31e5c 100644
--- a/sw/source/core/text/itrform2.hxx
+++ b/sw/source/core/text/itrform2.hxx
@@ -99,7 +99,7 @@ class SwTextFormatter : public SwTextPainter
 // Calculates the ascent and the height from the fontmetric
 void CalcAscent( SwTextFormatInfo rInf, SwLinePortion *pPor );
 
-// determines, if a optimized repaint rectange is allowed
+// determines, if a optimized repaint rectangle is allowed
 bool AllowRepaintOpt() const;
 
 // Is called by FormatLine
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: svx/source sw/source ucb/source vcl/source vcl/unx xmloff/source

2015-06-14 Thread Julien Nabet
 svx/source/svdraw/gradtrns.cxx |8 
 svx/source/svdraw/svdhdl.cxx   |2 +-
 svx/source/svdraw/svdotext.cxx |2 +-
 svx/source/tbxctrls/tbcontrl.cxx   |2 +-
 sw/source/core/doc/doclay.cxx  |5 +
 sw/source/core/doc/doctxm.cxx  |8 ++--
 sw/source/core/doc/htmltbl.cxx |2 +-
 sw/source/core/layout/layact.cxx   |2 +-
 sw/source/core/layout/trvlfrm.cxx  |3 +--
 sw/source/core/layout/wsfrm.cxx|4 ++--
 sw/source/filter/html/htmlatr.cxx  |3 +--
 sw/source/uibase/app/apphdl.cxx|2 +-
 sw/source/uibase/docvw/SidebarTxtControl.cxx   |6 ++
 sw/source/uibase/shells/textsh1.cxx|2 +-
 ucb/source/ucp/webdav-neon/webdavcontent.cxx   |2 +-
 ucb/source/ucp/webdav/webdavcontent.cxx|2 +-
 vcl/source/gdi/print2.cxx  |6 ++
 vcl/source/window/dialog.cxx   |2 +-
 vcl/source/window/stacking.cxx |2 +-
 vcl/unx/gtk/window/gtksalmenu.cxx  |2 +-
 xmloff/source/core/ProgressBarHelper.cxx   |2 +-
 xmloff/source/style/PageMasterExportPropMapper.cxx |4 ++--
 22 files changed, 30 insertions(+), 43 deletions(-)

New commits:
commit 4d8cccbdacc58ee2def5cc38a4ef92734414aac2
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sun Jun 14 14:04:07 2015 +0200

cppcheck: redundantCondition [part2]

Change-Id: I23e8a4834fa7858adb292ce0a4dfa5dab1ab5f00

diff --git a/svx/source/svdraw/gradtrns.cxx b/svx/source/svdraw/gradtrns.cxx
index 552ccb1..ba69570 100644
--- a/svx/source/svdraw/gradtrns.cxx
+++ b/svx/source/svdraw/gradtrns.cxx
@@ -335,7 +335,7 @@ void GradTransformer::VecToGrad(GradTransVector rV, 
GradTransGradient rG, Grad
 case css::awt::GradientStyle_RADIAL :
 case css::awt::GradientStyle_SQUARE :
 {
-if(!bMoveSingle || (bMoveSingle  !bMoveFirst))
+if(!bMoveSingle || !bMoveFirst)
 {
 const basegfx::B2DPoint aTopLeft(aRange.getMinX(), 
aRange.getMinY());
 const basegfx::B2DPoint aOffset(aEndPos - aTopLeft);
@@ -370,7 +370,7 @@ void GradTransformer::VecToGrad(GradTransVector rV, 
GradTransGradient rG, Grad
 aEndPos -= aOffset;
 }
 
-if(!bMoveSingle || (bMoveSingle  bMoveFirst))
+if(!bMoveSingle || bMoveFirst)
 {
 basegfx::B2DVector aFullVec(aStartPos - aEndPos);
 const basegfx::B2DPoint aBottomLeft(aRange.getMinX(), 
aRange.getMaximum().getY());
@@ -431,7 +431,7 @@ void GradTransformer::VecToGrad(GradTransVector rV, 
GradTransGradient rG, Grad
 case css::awt::GradientStyle_ELLIPTICAL :
 case css::awt::GradientStyle_RECT :
 {
-if(!bMoveSingle || (bMoveSingle  !bMoveFirst))
+if(!bMoveSingle || !bMoveFirst)
 {
 const basegfx::B2DPoint aTopLeft(aRange.getMinX(), 
aRange.getMinY());
 const basegfx::B2DPoint aOffset(aEndPos - aTopLeft);
@@ -466,7 +466,7 @@ void GradTransformer::VecToGrad(GradTransVector rV, 
GradTransGradient rG, Grad
 aEndPos -= aOffset;
 }
 
-if(!bMoveSingle || (bMoveSingle  bMoveFirst))
+if(!bMoveSingle || bMoveFirst)
 {
 basegfx::B2DVector aFullVec(aStartPos - aEndPos);
 const basegfx::B2DPoint aTopLeft(aRange.getMinX(), 
aRange.getMinY());
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 75575da..d0d6e70 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -2405,7 +2405,7 @@ void SdrCropViewHdl::CreateB2dIAObject()
 SdrMarkView* pView = pHdlList ? pHdlList-GetView() : 0;
 SdrPageView* pPageView = pView ? pView-GetSdrPageView() : 0;
 
-if(!pPageView || (pPageView  pView-areMarkHandlesHidden()))
+if(!pPageView || pView-areMarkHandlesHidden())
 {
 return;
 }
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 104f48b..fa8192b 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1339,7 +1339,7 @@ void SdrTextObj::ImpAutoFitText( SdrOutliner rOutliner, 
const Size rTextSize,
 if( std::find(aOldStretchXVals, aOldStretchXVals+i, nCurrStretchX) != 
aOldStretchXVals+i )
 break; // same value already attained once; algo is looping, exit
 
-if (fFactor  1.0 || (fFactor = 1.0  nCurrStretchX != 100))
+if (fFactor  1.0 || nCurrStretchX != 100)
 {
 nCurrStretchX = 
sal::static_int_castsal_uInt16(nCurrStretchX*fFactor);
 nCurrStretchY = 
sal::static_int_castsal_uInt16(nCurrStretchY*fFactor);
diff --git 

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

2015-05-11 Thread Michael Meeks
 svx/source/dialog/dlgctl3d.cxx|   12 +-
 svx/source/dialog/dlgctrl.cxx |   42 ++
 svx/source/dialog/fntctrl.cxx |4 +-
 svx/source/dialog/fontlb.cxx  |4 +-
 svx/source/dialog/frmdirlbox.cxx  |8 +---
 svx/source/dialog/frmsel.cxx  |5 +-
 svx/source/dialog/graphctl.cxx|3 +
 svx/source/dialog/imapdlg.cxx |6 +--
 svx/source/dialog/langbox.cxx |8 +---
 svx/source/dialog/measctrl.cxx|4 +-
 svx/source/dialog/pagectrl.cxx|9 +---
 svx/source/dialog/paraprev.cxx|7 +--
 svx/source/dialog/rubydialog.cxx  |   11 +
 svx/source/dialog/svxbmpnumvalueset.cxx   |   11 +
 svx/source/dialog/swframeexample.cxx  |7 +--
 svx/source/dialog/txencbox.cxx|4 +-
 svx/source/form/datanavi.cxx  |6 +--
 svx/source/gallery2/galctrl.cxx   |4 +-
 svx/source/sidebar/possize/SidebarDialControl.cxx |7 +--
 svx/source/tbxctrls/SvxColorValueSet.cxx  |4 +-
 svx/source/tbxctrls/itemwin.cxx   |   15 +--
 sw/source/ui/chrdlg/drpcps.cxx|6 +--
 sw/source/ui/config/optload.cxx   |6 +--
 sw/source/ui/config/optpage.cxx   |6 +--
 sw/source/ui/dbui/createaddresslistdialog.cxx |4 +-
 sw/source/ui/dbui/mmaddressblockpage.cxx  |   11 ++---
 sw/source/ui/envelp/envlop1.cxx   |7 +--
 sw/source/ui/envelp/labfmt.cxx|6 +--
 sw/source/ui/fldui/FldRefTreeListBox.cxx  |4 +-
 sw/source/ui/fldui/fldvar.cxx |3 +
 sw/source/ui/frmdlg/column.cxx|6 +--
 sw/source/ui/frmdlg/frmpage.cxx   |6 +--
 sw/source/ui/index/cnttab.cxx |8 +---
 sw/source/ui/misc/bookmark.cxx|6 +--
 sw/source/ui/misc/glosbib.cxx |   13 ++
 sw/source/ui/misc/glossary.cxx|6 +--
 sw/source/ui/misc/outline.cxx |6 +--
 sw/source/ui/table/tautofmt.cxx   |3 +
 sw/source/uibase/cctrl/actctrl.cxx|4 +-
 sw/source/uibase/dbui/dbtree.cxx  |4 +-
 sw/source/uibase/dbui/mailmergehelper.cxx |3 +
 sw/source/uibase/frmdlg/colex.cxx |   16 ++--
 sw/source/uibase/misc/numberingtypelistbox.cxx|4 +-
 sw/source/uibase/utlui/condedit.cxx   |4 +-
 sw/source/uibase/utlui/numfmtlb.cxx   |3 +
 45 files changed, 117 insertions(+), 209 deletions(-)

New commits:
commit ceb6f473837261f2a6e43e028ce9da3daccc2f6c
Author: Michael Meeks michael.me...@collabora.com
Date:   Mon May 11 13:42:10 2015 +0100

tdf#91052 - more macros for 'make' constructors.

Change-Id: Iece86485c52041b66cde91d7fbc772db16d90a93

diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx
index 2972abd..748c92a 100644
--- a/svx/source/dialog/dlgctl3d.cxx
+++ b/svx/source/dialog/dlgctl3d.cxx
@@ -28,7 +28,7 @@
 #include svx/sphere3d.hxx
 #include svx/cube3d.hxx
 #include vcl/svapp.hxx
-#include vcl/builder.hxx
+#include vcl/builderfactory.hxx
 #include svx/helperhittest3d.hxx
 #include basegfx/polygon/b2dpolygontools.hxx
 #include svx/polygn3d.hxx
@@ -62,10 +62,7 @@ Size Svx3DPreviewControl::GetOptimalSize() const
 return LogicToPixel(Size(80, 100), MAP_APPFONT);
 }
 
-extern C SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL 
makeSvx3DPreviewControl(vcl::Window *pParent, VclBuilder::stringmap )
-{
-return new Svx3DPreviewControl(pParent);
-}
+VCL_BUILDER_FACTORY(Svx3DPreviewControl)
 
 Svx3DPreviewControl::~Svx3DPreviewControl()
 {
@@ -962,10 +959,7 @@ Size SvxLightCtl3D::GetOptimalSize() const
 return LogicToPixel(Size(80, 100), MAP_APPFONT);
 }
 
-extern C SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL 
makeSvxLightCtl3D(vcl::Window *pParent, VclBuilder::stringmap )
-{
-return new SvxLightCtl3D(pParent);
-}
+VCL_BUILDER_FACTORY(SvxLightCtl3D)
 
 void SvxLightCtl3D::Init()
 {
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index 7f97061..ad7c410 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include vcl/builder.hxx
+#include vcl/builderfactory.hxx
 #include vcl/svapp.hxx
 #include vcl/settings.hxx
 #include sfx2/dialoghelper.hxx
@@ -97,12 +97,7 @@ Size SvxRectCtl::GetOptimalSize() const
 return LogicToPixel(Size(78, 39), MAP_APPFONT);
 }
 
-extern C SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL 
makeSvxRectCtl(vcl::Window *pParent, VclBuilder::stringmap )
-{
-return new 

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

2015-03-23 Thread Michael Dunphy
 svx/source/accessibility/svxrectctaccessiblecontext.cxx |3 +--
 svx/source/dialog/dlgctrl.cxx   |3 +--
 svx/source/svdraw/svdglev.cxx   |6 +++---
 svx/source/svdraw/svdotextdecomposition.cxx |4 ++--
 svx/source/svdraw/svdpage.cxx   |3 +--
 svx/source/table/tablecontroller.cxx|2 +-
 sw/source/core/doc/docchart.cxx |2 +-
 sw/source/core/docnode/ndtbl.cxx|3 +--
 sw/source/core/unocore/unocoll.cxx  |3 +--
 sw/source/filter/ww8/ww8par.cxx |2 +-
 10 files changed, 13 insertions(+), 18 deletions(-)

New commits:
commit da631972229389d40e0502e02ff4e2c0761ca3fc
Author: Michael Dunphy mdun...@uwaterloo.ca
Date:   Sun Mar 22 01:04:12 2015 +0100

fdo#39440 cppcheck cleanliness

Reduce scope of local variables.

Change-Id: I5f06dc0d9d16e92a7a0afb599eb3a93d9d5cc878
Reviewed-on: https://gerrit.libreoffice.org/14943
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx 
b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
index 16c07cd..0fd553d 100644
--- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx
+++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx
@@ -580,11 +580,10 @@ void SvxRectCtlAccessibleContext::FireChildFocus( 
RECT_POINT eButton )
 if( nNew  nNumOfChildren )
 {
 // select new child
-SvxRectCtlChildAccessibleContext*   pChild;
 mnSelectedChild = nNew;
 if( nNew != NOCHILDSELECTED )
 {
-pChild = mpChildren[ nNew ];
+SvxRectCtlChildAccessibleContext* pChild = mpChildren[ nNew ];
 if( pChild )
 {
 pChild-FireFocusEvent();
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index d673e2b..6606c64 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -1218,14 +1218,13 @@ void HatchingLB::Fill( const XHatchListRef pList )
 return;
 
 mpList = pList;
-XHatchEntry* pEntry;
 long nCount = pList-Count();
 
 SetUpdateMode( false );
 
 for( long i = 0; i  nCount; i++ )
 {
-pEntry = pList-GetHatch( i );
+XHatchEntry* pEntry = pList-GetHatch( i );
 const Bitmap aBitmap = pList-GetUiBitmap( i );
 if( !aBitmap.IsEmpty() )
 InsertEntry(pEntry-GetName(), Image(aBitmap));
diff --git a/svx/source/svdraw/svdglev.cxx b/svx/source/svdraw/svdglev.cxx
index c1b21ba..85affa6 100644
--- a/svx/source/svdraw/svdglev.cxx
+++ b/svx/source/svdraw/svdglev.cxx
@@ -89,10 +89,10 @@ void SdrGlueEditView::ImpDoMarkedGluePoints(PGlueDoFunc 
pDoFunc, bool bConst, co
 static void ImpGetEscDir(SdrGluePoint rGP, const SdrObject* /*pObj*/, const 
void* pbFirst, const void* pnThisEsc, const void* pnRet, const void*, const 
void*)
 {
 sal_uInt16 nRet=*(sal_uInt16*)pnRet;
-bool bFirst=*(bool*)pbFirst;
 if (nRet!=FUZZY) {
 sal_uInt16 nEsc = rGP.GetEscDir();
 bool bOn = (nEsc  *(sal_uInt16*)pnThisEsc) != 0;
+bool bFirst=*(bool*)pbFirst;
 if (bFirst) {
 nRet = bOn ? 1 : 0;
 bFirst = false;
@@ -131,9 +131,9 @@ void SdrGlueEditView::SetMarkedGluePointsEscDir(sal_uInt16 
nThisEsc, bool bOn)
 static void ImpGetPercent(SdrGluePoint rGP, const SdrObject* /*pObj*/, const 
void* pbFirst, const void* pnRet, const void*, const void*, const void*)
 {
 sal_uInt16 nRet=*(sal_uInt16*)pnRet;
-bool bFirst=*(bool*)pbFirst;
 if (nRet!=FUZZY) {
 bool bOn=rGP.IsPercent();
+bool bFirst=*(bool*)pbFirst;
 if (bFirst) { nRet=sal_uInt16(bOn); bFirst=false; }
 else if ((nRet!=0)!=bOn) nRet=FUZZY;
 }
@@ -168,7 +168,6 @@ void SdrGlueEditView::SetMarkedGluePointsPercent(bool bOn)
 static void ImpGetAlign(SdrGluePoint rGP, const SdrObject* /*pObj*/, const 
void* pbFirst, const void* pbDontCare, const void* pbVert, const void* pnRet, 
const void*)
 {
 sal_uInt16 nRet=*(sal_uInt16*)pnRet;
-bool bFirst=*(bool*)pbFirst;
 bool bDontCare=*(bool*)pbDontCare;
 bool bVert=*(bool*)pbVert;
 if (!bDontCare) {
@@ -178,6 +177,7 @@ static void ImpGetAlign(SdrGluePoint rGP, const SdrObject* 
/*pObj*/, const void
 } else {
 nAlg=rGP.GetHorzAlign();
 }
+bool bFirst=*(bool*)pbFirst;
 if (bFirst) { nRet=nAlg; bFirst=false; }
 else if (nRet!=nAlg) {
 if (bVert) {
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index fa2dc70..2f1003a 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -1194,7 +1194,6 @@ void 

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

2014-06-21 Thread Takeshi Abe
 svx/source/dialog/imapdlg.cxx |9 -
 svx/source/dialog/imapwnd.cxx |   10 --
 svx/source/dialog/measctrl.cxx|   12 ++--
 svx/source/dialog/srchdlg.cxx |   23 ++-
 svx/source/fmcomp/fmgridcl.cxx|4 ++--
 sw/source/uibase/wrtsh/wrtsh2.cxx |   10 +-
 6 files changed, 31 insertions(+), 37 deletions(-)

New commits:
commit c260abe39e0063a2e5ba4e0d22ff8a5ccd468c23
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Sat Jun 21 22:54:28 2014 +0900

Avoid possible memory leaks in case of exceptions

Change-Id: I27a0c3639c346720df471ffa3940783565c47f7d

diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx
index f062407..4b6fa84 100644
--- a/svx/source/dialog/imapdlg.cxx
+++ b/svx/source/dialog/imapdlg.cxx
@@ -54,6 +54,7 @@
 #include vcl/svapp.hxx
 #include vcl/settings.hxx
 #include dlgunit.hxx
+#include boost/scoped_ptr.hpp
 
 #define SELF_TARGET _self
 #define IMAP_ALL_FILTER OUString(Alle)
@@ -484,7 +485,7 @@ void SvxIMapDlg::DoOpen()
 {
 INetURLObject aURL( aDlg.GetPath() );
 DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, invalid URL );
-SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( 
aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ );
+boost::scoped_ptrSvStream 
pIStm(::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( 
INetURLObject::NO_DECODE ), STREAM_READ ));
 
 if( pIStm )
 {
@@ -497,8 +498,6 @@ void SvxIMapDlg::DoOpen()
 }
 else
 pIMapWnd-SetImageMap( aLoadIMap );
-
-delete pIStm;
 }
 
 pIMapWnd-Invalidate();
@@ -561,7 +560,7 @@ bool SvxIMapDlg::DoSave()
 if( aURL.getExtension().isEmpty() )
 aURL.setExtension( aExt );
 
-SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( 
aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_TRUNC );
+boost::scoped_ptrSvStream 
pOStm(::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( 
INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_TRUNC ));
 if( pOStm )
 {
 pIMapWnd-GetImageMap().Write( *pOStm, nFormat,  );
@@ -569,7 +568,7 @@ bool SvxIMapDlg::DoSave()
 if( pOStm-GetError() )
 ErrorHandler::HandleError( ERRCODE_IO_GENERAL );
 
-delete pOStm;
+pOStm.reset();
 pModel-SetChanged( bChanged );
 bRet = true;
 }
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index e591947..05e0e8b 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.cxx
@@ -48,6 +48,7 @@
 #include svx/svxdlg.hxx
 #include basegfx/point/b2dpoint.hxx
 #include basegfx/polygon/b2dpolygon.hxx
+#include boost/scoped_ptr.hpp
 
 using ::com::sun::star::frame::XFrame;
 using ::com::sun::star::uno::Reference;
@@ -643,7 +644,7 @@ void IMapWindow::DoMacroAssign()
 aSet.Put( aMacroItem, SID_ATTR_MACROITEM );
 
 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-SfxAbstractDialog* pMacroDlg = pFact-CreateSfxDialog( this, aSet, 
mxDocumentFrame, SID_EVENTCONFIG );
+boost::scoped_ptrSfxAbstractDialog pMacroDlg(pFact-CreateSfxDialog( 
this, aSet, mxDocumentFrame, SID_EVENTCONFIG ));
 
 if ( pMacroDlg  pMacroDlg-Execute() == RET_OK )
 {
@@ -652,8 +653,6 @@ void IMapWindow::DoMacroAssign()
 pModel-SetChanged( true );
 UpdateInfo( false );
 }
-
-delete pMacroDlg;
 }
 }
 
@@ -667,8 +666,8 @@ void IMapWindow::DoPropertyDialog()
 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
 if(pFact)
 {
-AbstractURLDlg* aDlg = pFact-CreateURLDialog( this, 
pIMapObj-GetURL(), pIMapObj-GetAltText(), pIMapObj-GetDesc(),
-pIMapObj-GetTarget(), 
pIMapObj-GetName(), aTargetList );
+boost::scoped_ptrAbstractURLDlg aDlg(pFact-CreateURLDialog( 
this, pIMapObj-GetURL(), pIMapObj-GetAltText(), pIMapObj-GetDesc(),
+pIMapObj-GetTarget(), 
pIMapObj-GetName(), aTargetList ));
 DBG_ASSERT(aDlg, Dialogdiet fail!);
 if ( aDlg-Execute() == RET_OK )
 {
@@ -690,7 +689,6 @@ void IMapWindow::DoPropertyDialog()
 pModel-SetChanged( true );
 UpdateInfo( true );
 }
-delete aDlg;
 }
 }
 }
diff --git a/svx/source/dialog/measctrl.cxx b/svx/source/dialog/measctrl.cxx
index 5d2910f..29b2c4b 100644
--- a/svx/source/dialog/measctrl.cxx
+++ b/svx/source/dialog/measctrl.cxx
@@ -25,6 +25,7 @@
 #include svx/dlgutil.hxx
 #include vcl/builder.hxx
 #include vcl/settings.hxx
+#include boost/scoped_ptr.hpp
 
 SvxXMeasurePreview::SvxXMeasurePreview( Window* pParent, WinBits nStyle)

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

2014-04-17 Thread Tor Lillqvist
 svx/source/svdraw/svdobj.cxx|4 
 svx/source/unodraw/unopage.cxx  |6 ++
 sw/source/core/uibase/shells/textsh.cxx |4 
 sw/source/core/uibase/uiview/view.cxx   |3 ++-
 4 files changed, 16 insertions(+), 1 deletion(-)

New commits:
commit c0b3d5be8fcec28190b1f25c9c0fd99916299249
Author: Tor Lillqvist t...@collabora.com
Date:   Thu Apr 17 18:39:33 2014 +0300

Try harder to bypass avmedia on non-desktop for now

Change-Id: I8a45f7436383cb904d375d0f0d86416f3ce56567

diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index eaf24ac..9b82f10 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include config_features.h
+
 #include sal/config.h
 
 #include com/sun/star/lang/XComponent.hpp
@@ -3394,7 +3396,9 @@ SdrObject* SdrObjFactory::MakeNewObject(sal_uInt32 
nInvent, sal_uInt16 nIdent, S
 case sal_uInt16(OBJ_PAGE   ): pObj=new SdrPageObj; 
 break;
 case sal_uInt16(OBJ_UNO): pObj=new SdrUnoObj(OUString());  
 break;
 case sal_uInt16(OBJ_CUSTOMSHAPE  ): pObj=new SdrObjCustomShape();  
 break;
+#if HAVE_FEATURE_DESKTOP
 case sal_uInt16(OBJ_MEDIA  ): pObj=new SdrMediaObj();  
 break;
+#endif
 case sal_uInt16(OBJ_TABLE  ): pObj=new 
::sdr::table::SdrTableObj(pModel);   break;
 case sal_uInt16(OBJ_OPENGL ): pObj=new SdrOpenGLObj;   
 break;
 }
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index 4352206..52c1fc9 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include config_features.h
+
 #include com/sun/star/document/EventObject.hpp
 #include com/sun/star/lang/DisposedException.hpp
 #include osl/mutex.hxx
@@ -536,11 +538,13 @@ void SvxDrawPage::GetTypeAndInventor( sal_uInt16 rType, 
sal_uInt32 rInventor,
 rInventor = SdrInventor;
 rType = OBJ_TABLE;
 }
+#if HAVE_FEATURE_DESKTOP
 else if ( aName == com.sun.star.presentation.MediaShape )
 {
 rInventor = SdrInventor;
 rType = OBJ_MEDIA;
 }
+#endif
 }
 else if(nTempType  E3D_INVENTOR_FLAG)
 {
@@ -732,9 +736,11 @@ SvxShape* SvxDrawPage::CreateShapeByTypeAndInventor( 
sal_uInt16 nType, sal_uInt3
 case OBJ_CUSTOMSHAPE:
 pRet = new SvxCustomShape( pObj );
 break;
+#if HAVE_FEATURE_DESKTOP
 case OBJ_MEDIA:
 pRet = new SvxMediaShape( pObj, referer );
 break;
+#endif
 case OBJ_TABLE:
 pRet = new SvxTableShape( pObj );
 break;
diff --git a/sw/source/core/uibase/shells/textsh.cxx 
b/sw/source/core/uibase/shells/textsh.cxx
index 635e21e..8db56d3 100644
--- a/sw/source/core/uibase/shells/textsh.cxx
+++ b/sw/source/core/uibase/shells/textsh.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include config_features.h
+
 #include hintids.hxx
 #include comphelper/string.hxx
 #include svl/globalnameitem.hxx
@@ -224,6 +226,7 @@ void SwTextShell::ExecInsert(SfxRequest rReq)
 rReq.Done();
 break;
 
+#if HAVE_FEATURE_DESKTOP
 case SID_INSERT_AVMEDIA:
 rReq.SetReturnValue(SfxBoolItem(nSlot, InsertMediaDlg( rReq )));
 break;
@@ -267,6 +270,7 @@ void SwTextShell::ExecInsert(SfxRequest rReq)
 }
 }
 break;
+#endif
 
 case SID_INSERT_OBJECT:
 case SID_INSERT_PLUGIN:
diff --git a/sw/source/core/uibase/uiview/view.cxx 
b/sw/source/core/uibase/uiview/view.cxx
index f9d28d8..a952671 100644
--- a/sw/source/core/uibase/uiview/view.cxx
+++ b/sw/source/core/uibase/uiview/view.cxx
@@ -337,13 +337,14 @@ void SwView::SelectShell()
 m_pShell = new SwBezierShell( *this );
 rDispatcher.Push( *m_pShell );
 }
+#if HAVE_FEATURE_DESKTOP
 else if( m_nSelectionType  nsSelectionType::SEL_MEDIA )
 {
 eShellMode = SHELL_MODE_MEDIA;
 m_pShell = new SwMediaShell( *this );
 rDispatcher.Push( *m_pShell );
 }
-
+#endif
 if (m_nSelectionType  nsSelectionType::SEL_EXTRUDED_CUSTOMSHAPE)
 {
 eShellMode = SHELL_MODE_EXTRUDED_CUSTOMSHAPE;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-02-14 Thread Norbert Thiebaud
 svx/source/sidebar/tools/ValueSetWithTextControl.cxx |5 -
 svx/source/stbctrls/modctrl.cxx  |3 ++-
 svx/source/stbctrls/pszctrl.cxx  |3 ++-
 svx/source/stbctrls/selctrl.cxx  |3 ++-
 svx/source/stbctrls/xmlsecctrl.cxx   |2 ++
 svx/source/stbctrls/zoomsliderctrl.cxx   |3 ++-
 svx/source/tbxctrls/tbcontrl.cxx |4 ++--
 sw/source/ui/utlui/content.cxx   |3 ++-
 sw/source/ui/utlui/viewlayoutctrl.cxx|2 ++
 9 files changed, 20 insertions(+), 8 deletions(-)

New commits:
commit 2a0a80a1385544cbb8d9f6b3ffc22f1c0afeb4ed
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Thu Feb 13 20:09:49 2014 -0600

protect macosx against the HiDPI hacks

Change-Id: Ie79abaffef72cbdf3006314c56590ca1e10cf949

diff --git a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx 
b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
index b897fac..5f3c763 100644
--- a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
+++ b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
@@ -100,6 +100,7 @@ void ValueSetWithTextControl::AddItem(
 ? *pSelectedItemImage
 : rItemImage;
 
+#ifndef MACOSX
 if ( GetDPIScaleFactor()  1 )
 {
 BitmapEx b = aItem.maItemImage.GetBitmapEx();
@@ -113,7 +114,7 @@ void ValueSetWithTextControl::AddItem(
 aItem.maSelectedItemImage = Image(b);
 }
 }
-
+#endif
 aItem.maItemText = rItemText;
 
 maItems.push_back( aItem );
@@ -167,6 +168,7 @@ void ValueSetWithTextControl::ReplaceItemImages(
  ? *pSelectedItemImage
  : rItemImage;
 
+#ifndef MACOSX
 if ( GetDPIScaleFactor()  1 )
 {
 BitmapEx b = maItems[nItemId-1].maItemImage.GetBitmapEx();
@@ -180,6 +182,7 @@ void ValueSetWithTextControl::ReplaceItemImages(
 maItems[nItemId-1].maSelectedItemImage = Image(b);
 }
 }
+#endif
 }
 
 
diff --git a/svx/source/stbctrls/modctrl.cxx b/svx/source/stbctrls/modctrl.cxx
index db94f49..542ec71 100644
--- a/svx/source/stbctrls/modctrl.cxx
+++ b/svx/source/stbctrls/modctrl.cxx
@@ -73,6 +73,7 @@ SvxModifyControl::SvxModifyControl( sal_uInt16 _nSlotId, 
sal_uInt16 _nId, Status
 SfxStatusBarControl( _nSlotId, _nId, rStb ),
 mpImpl(new ImplData)
 {
+#ifndef MACOSX
 if ( rStb.GetDPIScaleFactor()  1 )
 {
 for (int i = 0; i  mpImpl-MODIFICATION_STATE_SIZE; i++)
@@ -82,7 +83,7 @@ SvxModifyControl::SvxModifyControl( sal_uInt16 _nSlotId, 
sal_uInt16 _nId, Status
 mpImpl-maImages[i] = Image(b);
 }
 }
-
+#endif
 mpImpl-maTimer.SetTimeoutHdl( LINK(this, SvxModifyControl, OnTimer) );
 }
 
diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx
index 733b8e7..589f30d 100644
--- a/svx/source/stbctrls/pszctrl.cxx
+++ b/svx/source/stbctrls/pszctrl.cxx
@@ -177,6 +177,7 @@ SvxPosSizeStatusBarControl::SvxPosSizeStatusBarControl( 
sal_uInt16 _nSlotId,
 pImp-aPosImage = Image( ResId( RID_SVXBMP_POSITION, DIALOG_MGR() ) );
 pImp-aSizeImage = Image( ResId( RID_SVXBMP_SIZE, DIALOG_MGR() ) );
 
+#ifndef MACOSX
 if ( rStb.GetDPIScaleFactor()  1)
 {
 BitmapEx b = pImp-aPosImage.GetBitmapEx();
@@ -187,7 +188,7 @@ SvxPosSizeStatusBarControl::SvxPosSizeStatusBarControl( 
sal_uInt16 _nSlotId,
 b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), 
BMP_SCALE_FAST);
 pImp-aSizeImage = Image(b);
 }
-
+#endif
 addStatusListener( OUString( STR_POSITION )); // SID_ATTR_POSITION
 addStatusListener( OUString( STR_TABLECELL ));   // SID_TABLE_CELL
 addStatusListener( OUString( STR_FUNC ));// SID_PSZ_FUNCTION
diff --git a/svx/source/stbctrls/selctrl.cxx b/svx/source/stbctrls/selctrl.cxx
index 9b77972..6f31d48 100644
--- a/svx/source/stbctrls/selctrl.cxx
+++ b/svx/source/stbctrls/selctrl.cxx
@@ -80,13 +80,14 @@ SvxSelectionModeControl::SvxSelectionModeControl( 
sal_uInt16 _nSlotId,
 mnState( 0 ),
 maImage( SVX_RES( RID_SVXBMP_SELECTION ) )
 {
+#ifndef MACOSX
 if ( GetStatusBar().GetDPIScaleFactor()  1 )
 {
 BitmapEx b = maImage.GetBitmapEx();
 b.Scale(GetStatusBar().GetDPIScaleFactor(), 
GetStatusBar().GetDPIScaleFactor(), BMP_SCALE_FAST);
 maImage = Image(b);
 }
-
+#endif
 GetStatusBar().SetItemText( GetId(),  );
 }
 
diff --git a/svx/source/stbctrls/xmlsecctrl.cxx 
b/svx/source/stbctrls/xmlsecctrl.cxx
index 46ea35b..1ecfd52 100644
--- a/svx/source/stbctrls/xmlsecctrl.cxx
+++ b/svx/source/stbctrls/xmlsecctrl.cxx
@@ -61,6 +61,7 @@ XmlSecStatusBarControl::XmlSecStatusBarControl( sal_uInt16 
_nSlotId,  sal_uInt16
 mpImpl-maImageBroken   = Image( SVX_RES( RID_SVXBMP_SIGNET_BROKEN 
  ) );
 mpImpl-maImageNotValidated = Image( SVX_RES( 

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

2014-01-16 Thread Maxim Monastirsky
 svx/source/sidebar/text/TextPropertyPanel.cxx |   76 +++---
 sw/source/ui/shells/txtattr.cxx   |   12 ++--
 2 files changed, 16 insertions(+), 72 deletions(-)

New commits:
commit 75043c23c7d08fcc9b22a38fe08014d1381e2f90
Author: Maxim Monastirsky momonas...@gmail.com
Date:   Mon Jan 13 11:44:50 2014 +0200

fdo#73414 Remove Increase Font limits for Writer

and re-use the same code in sidebar.

Change-Id: Ic342be479f6f5b23ea2dd79b7cf6c77897b27dc1
Reviewed-on: https://gerrit.libreoffice.org/7398
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx 
b/svx/source/sidebar/text/TextPropertyPanel.cxx
index 0b8283e..8f29d2f 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.cxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.cxx
@@ -81,6 +81,8 @@ namespace svx { namespace sidebar {
 
 #undef HAS_IA2
 
+#define FN_GROW_FONT_SIZE   (FN_FORMAT + 3 )
+#define FN_SHRINK_FONT_SIZE (FN_FORMAT + 4 )
 
 PopupControl* TextPropertyPanel::CreateCharacterSpacingControl 
(PopupContainer* pParent)
 {
@@ -579,72 +581,14 @@ IMPL_LINK(TextPropertyPanel, ToolboxIncDecSelectHdl, 
ToolBox*, pToolBox)
 if(aCommand == UNO_GROW)
 {
 EndTracking();
-mbFocusOnFontSizeCtrl = false;
-sal_Int64 iValue = mpFontSizeBox-GetValue();
-int iPos = mpFontSizeBox-GetValuePos(iValue, FUNIT_NONE);
-long nSize = iValue;
-if(iPos != LISTBOX_ENTRY_NOTFOUND)
-nSize = mpFontSizeBox-GetValue(iPos+1 , FUNIT_NONE);
-else if(iValue = 100  iValue  105)
-nSize = 105;
-else if(iValue = 105  iValue  110)
-nSize = 110;
-else if(iValue  960)
-{
-nSize = (nSize / 10) * 10 + 10;
-while(nSize  960  mpFontSizeBox-GetValuePos(nSize, 
FUNIT_NONE) == LISTBOX_ENTRY_NOTFOUND)
-nSize += 10;
-}
-else
-{
-nSize = iValue;
-}
-
-float fSize = (float)nSize / 10;
-
-SfxMapUnit eUnit = maFontSizeControl.GetCoreMetric();
-SvxFontHeightItem aItem( CalcToUnit( fSize, eUnit ), 100, 
SID_ATTR_CHAR_FONTHEIGHT ) ;
-
-mpBindings-GetDispatcher()-Execute( 
SID_ATTR_CHAR_FONTHEIGHT, SFX_CALLMODE_RECORD, aItem, 0L );
-mpBindings-Invalidate(SID_ATTR_CHAR_FONTHEIGHT,true,false);
-mpFontSizeBox-SetValue( nSize );
+SfxVoidItem aItem(FN_GROW_FONT_SIZE);
+mpBindings-GetDispatcher()-Execute( FN_GROW_FONT_SIZE, 
SFX_CALLMODE_RECORD, aItem, 0L );
 }
 else if(aCommand == UNO_SHRINK)
 {
 EndTracking();
-mbFocusOnFontSizeCtrl = false;
-sal_Int64 iValue = mpFontSizeBox-GetValue();
-int iPos = mpFontSizeBox-GetValuePos(iValue, FUNIT_NONE);
-long nSize = iValue;
-if(iPos != LISTBOX_ENTRY_NOTFOUND)
-nSize = mpFontSizeBox-GetValue(iPos-1, FUNIT_NONE);
-else if(iValue  100  iValue = 105)
-nSize = 100;
-else if(iValue  105  iValue = 110)
-nSize = 105;
-else if(iValue  960)
-{
-nSize = 960;
-}
-else if(iValue  60)
-{
-nSize = (nSize / 10) * 10 ;
-while(nSize  60  mpFontSizeBox-GetValuePos(nSize, 
FUNIT_NONE) == LISTBOX_ENTRY_NOTFOUND)
-nSize -= 10;
-}
-else
-{
-nSize = iValue;
-}
-
-float fSize = (float)nSize / 10;
-
-SfxMapUnit eUnit = maFontSizeControl.GetCoreMetric();
-SvxFontHeightItem aItem( CalcToUnit( fSize, eUnit ), 100, 
SID_ATTR_CHAR_FONTHEIGHT ) ;
-
-mpBindings-GetDispatcher()-Execute( 
SID_ATTR_CHAR_FONTHEIGHT, SFX_CALLMODE_RECORD, aItem, 0L );
-mpBindings-Invalidate(SID_ATTR_CHAR_FONTHEIGHT,true,false);
-mpFontSizeBox-SetValue( nSize );
+SfxVoidItem aItem(FN_SHRINK_FONT_SIZE);
+mpBindings-GetDispatcher()-Execute( FN_SHRINK_FONT_SIZE, 
SFX_CALLMODE_RECORD, aItem, 0L );
 }
 }
 UpdateItem(SID_ATTR_CHAR_FONTHEIGHT);
@@ -805,8 +749,8 @@ void TextPropertyPanel::NotifyItemUpdate (
 
 default:
 {
-mpToolBoxIncDec-EnableItem(nIncreaseId, bIsEnabled  
nValue960);
-mpToolBoxIncDec-EnableItem(nDecreaseId, bIsEnabled  
nValue60);
+ 

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

2013-08-21 Thread Caolán McNamara
 svx/source/tbxctrls/tbunosearchcontrollers.cxx |2 +-
 sw/source/ui/index/swuiidxmrk.cxx  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 6c1dec39d95dcaaf30b96a5068762da3d522a63b
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Aug 21 16:04:27 2013 +0100

WaE: enumeral and non-enumeral type in conditional expression

Change-Id: I0b35ce3559acae739e810780832f6e275b493382

diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx 
b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 07cedc3..93c743b 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -103,7 +103,7 @@ void impl_executeSearch( const css::uno::Reference 
css::uno::XComponentContext
 lArgs[3].Name = OUString(SEARCHITEM_TRANSLITERATEFLAGS);
 SvtCTLOptions aCTLOptions;
 sal_Int32 nFlags = 0;
-nFlags |= (!aMatchCase ? 
com::sun::star::i18n::TransliterationModules_IGNORE_CASE : 0);
+nFlags |= (!aMatchCase ? 
static_castint(com::sun::star::i18n::TransliterationModules_IGNORE_CASE) : 0);
 nFlags |= (aCTLOptions.IsCTLFontEnabled() ? 
com::sun::star::i18n::TransliterationModulesExtra::ignoreDiacritics_CTL:0 );
 lArgs[3].Value = nFlags;
 lArgs[4].Name = OUString(SEARCHITEM_COMMAND);
diff --git a/sw/source/ui/index/swuiidxmrk.cxx 
b/sw/source/ui/index/swuiidxmrk.cxx
index 1421e2f..dffe955 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -442,7 +442,7 @@ static void lcl_SelectSameStrings(SwWrtShell rSh, sal_Bool 
bWordOnly, sal_Bool
 0, 0, 0,
 (bCaseSensitive
 ? 0
-: TransliterationModules_IGNORE_CASE) );
+: 
static_castint(TransliterationModules_IGNORE_CASE)) );
 
 rSh.ClearMark();
 sal_Bool bCancel;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits