[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2017-08-08 Thread Julien Nabet
 cui/source/tabpages/bbdlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7529bbb238e932a35e5790a038e3cb6af4493393
Author: Julien Nabet 
Date:   Sun Aug 6 01:20:13 2017 +0200

tdf#109863: use SID_PATTERN_LIST after bitmap tab converting

instead of SID_BITMAP_LIST

Regression from 
https://cgit.freedesktop.org/libreoffice/core/commit/?id=76585ae33f3ca75c05c0ccbf6a621b6e2d42bc00

Change-Id: I880ca149d5865ed5b80c57d7c5b390cc5606d66c
Reviewed-on: https://gerrit.libreoffice.org/40798
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 
Reviewed-on: https://gerrit.libreoffice.org/40806
Tested-by: Jenkins 
Reviewed-by: Katarina Behrens 

diff --git a/cui/source/tabpages/bbdlg.cxx b/cui/source/tabpages/bbdlg.cxx
index 23422c352118..8bbced32a2d2 100644
--- a/cui/source/tabpages/bbdlg.cxx
+++ b/cui/source/tabpages/bbdlg.cxx
@@ -75,7 +75,7 @@ void SvxBorderBackgroundDlg::PageCreated( sal_uInt16 nPageId, 
SfxTabPage& rTabPa
 {
 SfxItemSet aNew(
 *GetInputSetImpl()->GetPool(),
-SID_COLOR_TABLE, SID_BITMAP_LIST,
+SID_COLOR_TABLE, SID_PATTERN_LIST,
 SID_OFFER_IMPORT, SID_OFFER_IMPORT,
 0, 0);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source include/svx include/vcl svx/source vcl/source

2017-07-27 Thread Caolán McNamara
 cui/source/inc/textanim.hxx  |5 +
 cui/source/tabpages/textanim.cxx |   31 ---
 include/svx/colorbox.hxx |8 ++--
 include/vcl/button.hxx   |4 
 svx/source/tbxctrls/tbcontrl.cxx |   10 --
 vcl/source/control/button.cxx|1 -
 6 files changed, 27 insertions(+), 32 deletions(-)

New commits:
commit d747a00f550cc8556e29b29b08c57f84afb4078f
Author: Caolán McNamara 
Date:   Thu Jul 27 11:54:28 2017 +0100

Resolves: tdf#109289 add SvxColorListBox::IsValueChangedFromSaved

and remove PushButton::IsValueChangedFromSaved

(cherry picked from commit 39fd7e97c253153a10161ef3694b64e90e65e80a)

Related: tdf#109289 move PushButton::IsValueChangedFromSaved to consumer

inheriting the IsValueChangedFromSaved from PushButton has allowed
undesirable behaviour to be selected

(cherry picked from commit 247607727986df0fd0fef198459eb6646e056ea3)

Change-Id: Ib1c51e27fd708c5d4811c90ef5659b4d55dd8860
fccb1657d2565005e6f9e239c6118f2e5ae7970c
Reviewed-on: https://gerrit.libreoffice.org/40486
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/cui/source/inc/textanim.hxx b/cui/source/inc/textanim.hxx
index 8469f3601637..f4bd053d15b8 100644
--- a/cui/source/inc/textanim.hxx
+++ b/cui/source/inc/textanim.hxx
@@ -74,6 +74,11 @@ private:
 voidSelectDirection( SdrTextAniDirection nValue );
 sal_uInt16  GetSelectedDirection();
 
+TriState m_aUpState;
+TriState m_aLeftState;
+TriState m_aRightState;
+TriState m_aDownState;
+
 public:
 SvxTextAnimationPage( vcl::Window* pWindow, const SfxItemSet& rInAttrs );
 virtual ~SvxTextAnimationPage() override;
diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx
index 2dcc3d39e7f4..cb267984a943 100644
--- a/cui/source/tabpages/textanim.cxx
+++ b/cui/source/tabpages/textanim.cxx
@@ -89,13 +89,14 @@ void SvxTextTabDialog::PageCreated( sal_uInt16 nId, 
SfxTabPage  )
 |*
 \/
 
-SvxTextAnimationPage::SvxTextAnimationPage( vcl::Window* pWindow, const 
SfxItemSet& rInAttrs ) :
-SfxTabPage  ( pWindow
-  ,"TextAnimation"
-  ,"cui/ui/textanimtabpage.ui"
-  , ),
-rOutAttrs   ( rInAttrs ),
-eAniKind( SDRTEXTANI_NONE )
+SvxTextAnimationPage::SvxTextAnimationPage(vcl::Window* pWindow, const 
SfxItemSet& rInAttrs)
+: SfxTabPage(pWindow, "TextAnimation", "cui/ui/textanimtabpage.ui", 
)
+, rOutAttrs(rInAttrs)
+, eAniKind(SDRTEXTANI_NONE)
+, m_aUpState(TRISTATE_INDET)
+, m_aLeftState(TRISTATE_INDET)
+, m_aRightState(TRISTATE_INDET)
+, m_aDownState(TRISTATE_INDET)
 {
 get(m_pLbEffect, "LB_EFFECT");
 get(m_pBoxDirection,"boxDIRECTION");
@@ -201,10 +202,10 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* 
rAttrs )
 m_pBtnRight->Check( false );
 m_pBtnDown->Check( false );
 }
-m_pBtnUp->SaveValue();
-m_pBtnLeft->SaveValue();
-m_pBtnRight->SaveValue();
-m_pBtnDown->SaveValue();
+m_aUpState = m_pBtnUp->GetState();
+m_aLeftState = m_pBtnLeft->GetState();
+m_aRightState = m_pBtnRight->GetState();
+m_aDownState = m_pBtnDown->GetState();
 
 // Start inside
 pItem = GetItem( *rAttrs, SDRATTR_TEXT_ANISTARTINSIDE );
@@ -376,10 +377,10 @@ bool SvxTextAnimationPage::FillItemSet( SfxItemSet* 
rAttrs)
 }
 
 // animation direction
-if( m_pBtnUp->IsValueChangedFromSaved() ||
-m_pBtnLeft->IsValueChangedFromSaved() ||
-m_pBtnRight->IsValueChangedFromSaved() ||
-m_pBtnDown->IsValueChangedFromSaved() )
+if (m_aUpState != m_pBtnUp->GetState() ||
+m_aLeftState != m_pBtnLeft->GetState() ||
+m_aRightState != m_pBtnRight->GetState() ||
+m_aDownState != m_pBtnDown->GetState())
 {
 SdrTextAniDirection eValue = (SdrTextAniDirection) 
GetSelectedDirection();
 rAttrs->Put( SdrTextAniDirectionItem( eValue ) );
diff --git a/include/svx/colorbox.hxx b/include/svx/colorbox.hxx
index 4b7f2513a984..1d73b5fe1c66 100644
--- a/include/svx/colorbox.hxx
+++ b/include/svx/colorbox.hxx
@@ -34,6 +34,7 @@ private:
 Link m_aSelectedLink;
 SvxListBoxColorWrapper m_aColorWrapper;
 Color m_aAutoDisplayColor;
+Color m_aSaveColor;
 NamedColor m_aSelectedColor;
 sal_uInt16 m_nSlotId;
 bool m_bShowNoneButton;
@@ -57,8 +58,8 @@ public:
 
 void SetSlotId(sal_uInt16 nSlotId, bool bShowNoneButton = false);
 
-NamedColor GetSelectEntry() const;
-Color GetSelectEntryColor() const;
+Color GetSelectEntryColor() const { return m_aSelectedColor.first; }
+NamedColor GetSelectEntry() const 

[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2017-07-11 Thread Eike Rathke
 cui/source/inc/backgrnd.hxx  |1 +
 cui/source/tabpages/backgrnd.cxx |   12 ++--
 2 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 1096d1c237a2c4fc7497dd073d0f62bb01ffe925
Author: Eike Rathke 
Date:   Tue Jun 20 23:56:44 2017 +0200

Resolves: tdf#105740 select without selecting.. tdf#101588 b0rk

The initial color, if determined, must result in being selected. 
Differentiate
between pre-selected and user-selected.

Regression of

commit 429be969b39867d6d9f36978c9ac15b601e78ba6
Date:   Mon Dec 12 21:24:20 2016 +0100

Change-Id: I928af131d03c61a8e474e5cd356aea8b766112fa
(cherry picked from commit aee66aa85e75f67135e5c6079a281e18402d261a)
Reviewed-on: https://gerrit.libreoffice.org/39026
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx
index 18ec128078f7..d2663f3cd27e 100644
--- a/cui/source/inc/backgrnd.hxx
+++ b/cui/source/inc/backgrnd.hxx
@@ -107,6 +107,7 @@ private:
 boolbIsGraphicValid : 1;
 boolbLinkOnly   : 1;
 boolbHighlighting   : 1;
+boolm_bColorSelected: 1;
 Graphic aBgdGraphic;
 OUStringaBgdGraphicPath;
 OUStringaBgdGraphicFilter;
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 6f5d72bab35a..43d8fdd2eddb 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -330,6 +330,7 @@ SvxBackgroundTabPage::SvxBackgroundTabPage(vcl::Window* 
pParent, const SfxItemSe
 , bIsGraphicValid(false)
 , bLinkOnly(false)
 , bHighlighting(false)
+, m_bColorSelected(false)
 , pPageImpl(new SvxBackgroundPage_Impl)
 , pImportDlg(nullptr)
 , pTableBck_Impl(nullptr)
@@ -448,6 +449,8 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
 return;
 }
 
+m_bColorSelected = false;
+
 // condition of the preview button is persistent due to UserData
 OUString aUserData = GetUserData();
 m_pBtnPreview->Check( !aUserData.isEmpty() && '1' == aUserData[0] );
@@ -684,7 +687,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* 
rCoreSet )
 {
 // Brush-treatment:
 if ( rOldItem.GetColor() != aBgdColor ||
- (SfxItemState::DEFAULT >= eOldItemState && 
!m_pBackgroundColorSet->IsNoSelection()))
+ (SfxItemState::DEFAULT >= eOldItemState && 
m_bColorSelected))
 {
 bModified = true;
 rCoreSet->Put( SvxBrushItem( aBgdColor, nWhich ) );
@@ -1138,6 +1141,7 @@ IMPL_LINK_NOARG(SvxBackgroundTabPage, 
BackgroundColorHdl_Impl, ValueSet*, void)
 sal_uInt16 nItemId = m_pBackgroundColorSet->GetSelectItemId();
 Color aColor = nItemId ? ( m_pBackgroundColorSet->GetItemColor( nItemId ) 
) : Color( COL_TRANSPARENT );
 aBgdColor = aColor;
+m_bColorSelected = true;
 m_pPreviewWin1->NotifyChange( aBgdColor );
 }
 
@@ -1423,13 +1427,9 @@ void SvxBackgroundTabPage::FillControls_Impl( const 
SvxBrushItem& rBgdAttr,
 }
 else
 {
-bool bNoSelection = m_pBackgroundColorSet->IsNoSelection();
 m_pBackgroundColorSet->SelectItem( nCol );
-m_pBackgroundColorSet->SaveValue();
-// The actual selection is user set, not what we preset.
-if (bNoSelection)
-m_pBackgroundColorSet->SetNoSelection();
 }
+m_pBackgroundColorSet->SaveValue();
 
 m_pPreviewWin1->NotifyChange( aBgdColor );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source include/editeng sd/qa

2017-07-10 Thread Tamás Zolnai
 cui/source/tabpages/numpages.cxx  |1 +
 include/editeng/numitem.hxx   |5 -
 sd/qa/unit/data/odp/tdf108925.odp |binary
 sd/qa/unit/import-tests.cxx   |   19 +++
 4 files changed, 24 insertions(+), 1 deletion(-)

New commits:
commit 166d63036b57672a16d50663246c73750ef98ea7
Author: Tamás Zolnai 
Date:   Fri Jul 7 16:22:47 2017 +0200

tdf#108925: Too small bullet size confuses the user

Add a constraint for bullet relative size to avoid too small
bullets which are hardly recognizable. Use the same 25% lower
limit what MSO uses.

Reviewed-on: https://gerrit.libreoffice.org/39696
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 
(cherry picked from commit 11652be4071ef6d1d89b2c397aa1a32476e03bf6)

Change-Id: Id956ecf3ec831c569188b944be58da03bf30a55e
Reviewed-on: https://gerrit.libreoffice.org/39709
Tested-by: Jenkins 
Reviewed-by: Andras Timar 

diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 49564a9e1716..ded539a44714 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -1108,6 +1108,7 @@ SvxNumOptionsTabPage::SvxNumOptionsTabPage(vcl::Window* 
pParent,
 
 get(m_pBulRelSizeFT, "relsizeft");
 get(m_pBulRelSizeMF, "relsize");
+m_pBulRelSizeMF->SetMin(SVX_NUM_REL_SIZE_MIN);
 
 get(m_pAllLevelFT, "sublevelsft");
 get(m_pAllLevelNF, "sublevels");
diff --git a/include/editeng/numitem.hxx b/include/editeng/numitem.hxx
index 86d8b0591ede..b10056c70100 100644
--- a/include/editeng/numitem.hxx
+++ b/include/editeng/numitem.hxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class SvxBrushItem;
 namespace vcl { class Font; }
@@ -47,6 +48,8 @@ namespace com{namespace sun{ namespace star{
 
 #define SVX_NO_NUM  200 // Marker for no numbering
 #define SVX_NO_NUMLEVEL 0x20
+#define SVX_NUM_REL_SIZE_MIN25 // Lower limit for numbering relative size
+
 
 #define LINK_TOKEN  0x80 //indicate linked bitmaps - for use in dialog only
 class EDITENG_DLLPUBLIC SvxNumberType
@@ -168,7 +171,7 @@ public:
 const vcl::Font* GetBulletFont() const {return pBulletFont;}
 voidSetBulletChar(sal_Unicode cSet){cBullet = cSet;}
 sal_Unicode GetBulletChar()const {return cBullet;}
-voidSetBulletRelSize(sal_uInt16 nSet) {nBulletRelSize = nSet;}
+voidSetBulletRelSize(sal_uInt16 nSet) {nBulletRelSize = 
std::max(nSet, sal_uInt16(SVX_NUM_REL_SIZE_MIN));}
 sal_uInt16  GetBulletRelSize() const { return nBulletRelSize;}
 voidSetBulletColor(Color nSet){nBulletColor = nSet;}
 const Color&GetBulletColor()const {return nBulletColor;}
diff --git a/sd/qa/unit/data/odp/tdf108925.odp 
b/sd/qa/unit/data/odp/tdf108925.odp
new file mode 100755
index ..5b6dfc4ca4a2
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf108925.odp differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index b6f3462f7744..4e62c3479cf2 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -141,6 +141,7 @@ public:
 void testTdf104015();
 void testTdf104201();
 void testTdf104445();
+void testTdf108925();
 
 CPPUNIT_TEST_SUITE(SdImportTest);
 
@@ -200,6 +201,7 @@ public:
 CPPUNIT_TEST(testTdf104015);
 CPPUNIT_TEST(testTdf104201);
 CPPUNIT_TEST(testTdf104445);
+CPPUNIT_TEST(testTdf108925);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -1770,6 +1772,23 @@ void SdImportTest::testTdf104445()
 xDocShRef->DoClose();
 }
 
+void SdImportTest::testTdf108925()
+{
+// Test document contains bulleting with too small bullet size (1%) which 
breaks the lower constraint
+// So it should be converted to the lowest allowed value (25%).
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf108925.odp"), ODP);
+const SdrPage *pPage = GetPage(1, xDocShRef);
+SdrTextObj *pTxtObj = dynamic_cast(pPage->GetObj(0));
+CPPUNIT_ASSERT_MESSAGE("No text object", pTxtObj != nullptr);
+const EditTextObject& aEdit = 
pTxtObj->GetOutlinerParaObject()->GetTextObject();
+
+const SvxNumBulletItem *pNumFmt = dynamic_cast(aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET));
+CPPUNIT_ASSERT(pNumFmt);
+
CPPUNIT_ASSERT_EQUAL(pNumFmt->GetNumRule()->GetLevel(0).GetBulletRelSize(), 
sal_uInt16(25));
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2017-06-19 Thread Olivier Hallot
 cui/source/dialogs/screenshotannotationdlg.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 4be3f2b3a9294c22de68b586d84328ec08906b84
Author: Olivier Hallot 
Date:   Fri Jun 16 16:21:44 2017 -0300

Fix screenshot missing quotes in code snippet

The code snippet suggested has no quotes in atttributes values.

Change-Id: I604fb34827da3bebf3f6759b491d719a96854754
Reviewed-on: https://gerrit.libreoffice.org/38895
Tested-by: Jenkins 
Reviewed-by: Katarina Behrens 

diff --git a/cui/source/dialogs/screenshotannotationdlg.cxx 
b/cui/source/dialogs/screenshotannotationdlg.cxx
index 398458df5887..8913b871be41 100644
--- a/cui/source/dialogs/screenshotannotationdlg.cxx
+++ b/cui/source/dialogs/screenshotannotationdlg.cxx
@@ -54,7 +54,7 @@ namespace
 
 OUString lcl_AltDescr()
 {
-OUString aTempl = OUString(""
+OUString aTempl = OUString(""
" " //FIXME real dialog title or something
   "");
 aTempl = aTempl.replaceFirst( "%1", lcl_genRandom("alt_id") );
@@ -64,8 +64,8 @@ namespace
 
 OUString lcl_Image( const OUString& rScreenshotId, const Size& rSize )
 {
-OUString aTempl = OUString(""
+OUString aTempl = OUString(""
 "%5"
"");
 aTempl = aTempl.replaceFirst( "%1", lcl_genRandom("img_id") );
@@ -79,7 +79,7 @@ namespace
 
 OUString lcl_ParagraphWithImage( const OUString& rScreenshotId, const 
Size& rSize )
 {
-OUString aTempl = OUString( "%2"
+OUString aTempl = OUString( "%2"
 ""  SAL_NEWLINE_STRING );
 aTempl = aTempl.replaceFirst( "%1", lcl_genRandom("par_id") );
 aTempl = aTempl.replaceFirst( "%2", lcl_Image(rScreenshotId, rSize) );
@@ -90,7 +90,7 @@ namespace
 OUString lcl_Bookmark( const OUString& rWidgetId )
 {
 OUString aTempl = "" SAL_NEWLINE_STRING
-  "" SAL_NEWLINE_STRING;
+  "" SAL_NEWLINE_STRING;
 aTempl = aTempl.replaceFirst( "%1", rWidgetId );
 aTempl = aTempl.replaceFirst( "%2", rWidgetId );
 aTempl = aTempl.replaceFirst( "%3", lcl_genRandom("bm_id") );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2017-05-22 Thread Xisco Fauli
 cui/source/tabpages/tpbitmap.cxx |   32 
 1 file changed, 20 insertions(+), 12 deletions(-)

New commits:
commit 221de7cfdb6c6b6a4879162652bf842c4358f9eb
Author: Xisco Fauli 
Date:   Tue May 16 12:25:24 2017 +0200

tdf#107877: Don't crash if all bitmaps are deleted

Change-Id: Ie21f8cf1ead7c75017ee09436102f87f5d5dc04c
Reviewed-on: https://gerrit.libreoffice.org/37673
Reviewed-by: Julien Nabet 
Tested-by: Jenkins 
Reviewed-by: Katarina Behrens 
(cherry picked from commit 9d55ce72b69934d17360142f88a699397e0aa41f)
Reviewed-on: https://gerrit.libreoffice.org/37724
Reviewed-by: Miklos Vajna 

diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index a703aef8ede2..5f56ad4a487c 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -525,21 +525,29 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, 
ValueSet*, void)
 }
 }
 
-BitmapEx aBmpEx(pGraphicObject->GetGraphic().GetBitmapEx());
-Size aTempBitmapSize = aBmpEx.GetSizePixel();
-const double fUIScale = ( (mpView && mpView->GetModel()) ? 
double(mpView->GetModel()->GetUIScale()) : 1.0);
+if(pGraphicObject)
+{
+BitmapEx aBmpEx(pGraphicObject->GetGraphic().GetBitmapEx());
+Size aTempBitmapSize = aBmpEx.GetSizePixel();
+const double fUIScale = ( (mpView && mpView->GetModel()) ? 
double(mpView->GetModel()->GetUIScale()) : 1.0);
 
-rBitmapSize.Width() = 
((OutputDevice::LogicToLogic(static_cast(aTempBitmapSize.Width()),MapUnit::MapPixel,
 MapUnit::Map100thMM )) / fUIScale);
-rBitmapSize.Height() = 
((OutputDevice::LogicToLogic(static_cast(aTempBitmapSize.Height()),MapUnit::MapPixel,
 MapUnit::Map100thMM )) / fUIScale);
-CalculateBitmapPresetSize();
-ModifyBitmapStyleHdl( *m_pBitmapStyleLB );
-ModifyBitmapPositionHdl( *m_pPositionLB );
+rBitmapSize.Width() = 
((OutputDevice::LogicToLogic(static_cast(aTempBitmapSize.Width()),MapUnit::MapPixel,
 MapUnit::Map100thMM )) / fUIScale);
+rBitmapSize.Height() = 
((OutputDevice::LogicToLogic(static_cast(aTempBitmapSize.Height()),MapUnit::MapPixel,
 MapUnit::Map100thMM )) / fUIScale);
+CalculateBitmapPresetSize();
+ModifyBitmapStyleHdl( *m_pBitmapStyleLB );
+ModifyBitmapPositionHdl( *m_pPositionLB );
 
-m_rXFSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP));
-m_rXFSet.Put(XFillBitmapItem(OUString(), *pGraphicObject));
+m_rXFSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP));
+m_rXFSet.Put(XFillBitmapItem(OUString(), *pGraphicObject));
+
+m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
+m_pCtlBitmapPreview->Invalidate();
+}
+else
+{
+SAL_WARN("cui.tabpages", "SvxBitmapTabPage::ModifyBitmapHdl(): null 
pGraphicObject");
+}
 
-m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
-m_pCtlBitmapPreview->Invalidate();
 }
 
 IMPL_LINK_NOARG(SvxBitmapTabPage, ClickRenameHdl, SvxPresetListBox*, void)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2017-05-19 Thread Julien Nabet
 cui/source/options/optaboutconfig.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 24201323b6f25f62947d5e788e8444993920472c
Author: Julien Nabet 
Date:   Sat May 13 12:03:48 2017 +0200

tdf#107811: expert config, deal no parent case

bt part:
3  0x773c7ee2 in __GI___assert_fail (assertion=0x77ba5107 
"false", file=0x77ba4ef8 "/home/julien/lo/libreoffice/sal/rtl/strtmpl.cxx", 
line=1399,
function=0x77ba6d00 
 "void 
rtl_uString_newFromSubString(rtl_uString**, const rtl_uString*, sal_Int32, 
sal_Int32)")
at assert.c:101
4  0x77b6a28b in rtl_uString_newFromSubString 
(ppThis=0x7ffef1b0, pFrom=0x5e122230, beginIndex=1, count=-2)
at /home/julien/lo/libreoffice/sal/rtl/strtmpl.cxx:1399
5  0x7fffa6e69136 in rtl::OUString::copy (this=0x7ffef1f8, 
beginIndex=1, count=-2) at 
/home/julien/lo/libreoffice/include/rtl/ustring.hxx:2223
6  0x7fffa6fed67b in CuiAboutConfigTabPage::InsertEntry 
(this=0x5bda0b20, pEntry=0x5e13eb40)
at /home/julien/lo/libreoffice/cui/source/options/optaboutconfig.cxx:874
7  0x7fffa6fed415 in CuiAboutConfigTabPage::SearchHdl_Impl 
(this=0x5bda0b20) at 
/home/julien/lo/libreoffice/cui/source/options/optaboutconfig.cxx:848

Change-Id: Id9d1003a0e5e52abb878229e710e3fd4612789a1
Reviewed-on: https://gerrit.libreoffice.org/37568
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 
(cherry picked from commit 8aee79e35208dd263928d7f5daa3f931fd3de99d)
Reviewed-on: https://gerrit.libreoffice.org/37570
Tested-by: Jenkins 
Reviewed-by: Katarina Behrens 

diff --git a/cui/source/options/optaboutconfig.cxx 
b/cui/source/options/optaboutconfig.cxx
index bacba9e98b78..b848e5da2615 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -871,6 +871,12 @@ void CuiAboutConfigTabPage::InsertEntry( SvTreeListEntry 
*pEntry)
 {
 int prevIndex = index;
 index = sPath.indexOf("/", index+1);
+// deal with no parent case (tdf#107811)
+if (index < 0)
+{
+m_pPrefBox->Insert( pEntry, nullptr);
+return;
+}
 OUString sParentName = sPath.copy(prevIndex+1, index - prevIndex - 1);
 
 bool hasEntry = false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2017-05-15 Thread Julien Nabet
 cui/source/options/optchart.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6eb0df62aaa00f2c1508b1650e8df3145822f84f
Author: Julien Nabet 
Date:   Sun May 14 00:35:21 2017 +0200

fix gdi resource leak with unreleased virtual device

(copycat Markus 
https://cgit.freedesktop.org/libreoffice/core/commit/?id=289711c2a469bfbe06aef3b3870b65f9c788f56d)

Change-Id: I3974609559dd44257d7c3e9e9544348d622953f6
Reviewed-on: https://gerrit.libreoffice.org/37586
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 
(cherry picked from commit 11c4cc15fdd491e15ffd4e7d9fb5d4082898f926)
Reviewed-on: https://gerrit.libreoffice.org/37591
Reviewed-by: Markus Mohrhard 

diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx
index 060d3b0b6587..b4eb31b072d1 100644
--- a/cui/source/options/optchart.cxx
+++ b/cui/source/options/optchart.cxx
@@ -43,7 +43,7 @@ void SvxDefaultColorOptPage::InsertColorEntry(const 
XColorEntry& rEntry, sal_Int
 const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
 Size aImageSize = rStyleSettings.GetListBoxPreviewDefaultPixelSize();
 
-VclPtr xDevice = VclPtr::Create();
+ScopedVclPtrInstance xDevice;
 xDevice->SetOutputSize(aImageSize);
 const Rectangle aRect(Point(0, 0), aImageSize);
 xDevice->SetFillColor(rColor);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source cui/uiconfig officecfg/registry

2017-05-02 Thread Tor Lillqvist
 cui/source/inc/cuioptgenrl.hxx   |1 
 cui/source/options/optgenrl.cxx  |  104 +++
 cui/uiconfig/ui/optuserpage.ui   |  204 ++-
 officecfg/registry/schema/org/openoffice/UserProfile.xcs |8 
 4 files changed, 249 insertions(+), 68 deletions(-)

New commits:
commit dc19bd9224850e8dd8ca873bc86a7e7945f95b08
Author: Tor Lillqvist 
Date:   Fri Apr 28 14:07:56 2017 +0300

tdf#105841: Avoid REGRESSION!!!

Let's reinstate the name charade instead. Pitäkää tunkkinne.

This reverts commit 5941496601600269296dde3e4ff8b615a8bb45ca.

This reverts commit db231633af4667e24281e0be69ab63ad3081fdc3.

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

diff --git a/cui/source/inc/cuioptgenrl.hxx b/cui/source/inc/cuioptgenrl.hxx
index 5f1065ada287..0c56b6cdcde6 100644
--- a/cui/source/inc/cuioptgenrl.hxx
+++ b/cui/source/inc/cuioptgenrl.hxx
@@ -47,6 +47,7 @@ private:
 struct Field;
 std::vector vFields;
 // "name" fields
+unsigned nNameRow;
 unsigned nShortNameField;
 
 DECL_LINK( ModifyHdl_Impl, Edit&, void );
diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx
index 385f5805b462..a830fa1d1dad 100644
--- a/cui/source/options/optgenrl.cxx
+++ b/cui/source/options/optgenrl.cxx
@@ -41,6 +41,8 @@ enum RowType
 {
 Row_Company,
 Row_Name,
+Row_Name_Russian,
+Row_Name_Eastern,
 Row_Street,
 Row_Street_Russian,
 Row_City,
@@ -58,6 +60,7 @@ namespace Lang
 {
 unsigned const Others = 1;
 unsigned const Russian = 2;
+unsigned const Eastern = 4;
 unsigned const US = 8;
 unsigned const All = static_cast(-1);
 }
@@ -77,7 +80,9 @@ struct
 const vRowInfo[] =
 {
 { "companyft",   Lang::All },
-{ "nameft",  Lang::All },
+{ "nameft",  Lang::All & ~Lang::Russian & ~Lang::Eastern },
+{ "rusnameft",   Lang::Russian },
+{ "eastnameft",  Lang::Eastern },
 { "streetft",Lang::All & ~Lang::Russian },
 { "russtreetft", Lang::Russian },
 { "icityft", Lang::All & ~Lang::US },
@@ -108,8 +113,18 @@ const vFieldInfo[] =
 // Company
 { Row_Company, "company", UserOptToken::Company, EditPosition::COMPANY },
 // Name
+{ Row_Name, "firstname", UserOptToken::FirstName, EditPosition::FIRSTNAME 
},
 { Row_Name, "lastname", UserOptToken::LastName, EditPosition::LASTNAME  },
 { Row_Name, "shortname", UserOptToken::ID, EditPosition::SHORTNAME },
+// Name (russian)
+{ Row_Name_Russian, "ruslastname", UserOptToken::LastName, 
EditPosition::LASTNAME  },
+{ Row_Name_Russian, "rusfirstname", UserOptToken::FirstName, 
EditPosition::FIRSTNAME },
+{ Row_Name_Russian, "rusfathersname", UserOptToken::FathersName, 
EditPosition::UNKNOWN },
+{ Row_Name_Russian, "russhortname", UserOptToken::ID, 
EditPosition::SHORTNAME },
+// Name (eastern: reversed name ord
+{ Row_Name_Eastern, "eastlastname", UserOptToken::LastName, 
EditPosition::LASTNAME  },
+{ Row_Name_Eastern, "eastfirstname", UserOptToken::FirstName, 
EditPosition::FIRSTNAME },
+{ Row_Name_Eastern, "eastshortname", UserOptToken::ID, 
EditPosition::SHORTNAME },
 // Street
 { Row_Street, "street", UserOptToken::Street, EditPosition::STREET },
 // Street (russian)
@@ -211,7 +226,7 @@ void SvxGeneralTabPage::InitControls ()
 {
 // which language bit do we use? (see Lang and vRowInfo[] above)
 unsigned LangBit;
-switch (Application::GetSettings().GetUILanguageTag().getLanguageType())
+switch (LanguageType const eLang = 
Application::GetSettings().GetUILanguageTag().getLanguageType())
 {
 case LANGUAGE_ENGLISH_US:
 LangBit = Lang::US;
@@ -220,7 +235,10 @@ void SvxGeneralTabPage::InitControls ()
 LangBit = Lang::Russian;
 break;
 default:
-LangBit = Lang::Others;
+if (MsLangId::isFamilyNameFirst(eLang))
+LangBit = Lang::Eastern;
+else
+LangBit = Lang::Others;
 break;
 }
 
@@ -251,6 +269,7 @@ void SvxGeneralTabPage::InitControls ()
 // "short name" field?
 if (vFieldInfo[iField].nUserOptionsId == UserOptToken::ID)
 {
+nNameRow = vRows.size() - 1;
 nShortNameField = vFields.size() - 1;
 }
 }
@@ -263,7 +282,7 @@ void SvxGeneralTabPage::SetLinks ()
 {
 // link for updating the initials
 Link aLink = LINK( this, SvxGeneralTabPage, ModifyHdl_Impl );
-Row& rNameRow = *vRows[Row_Name];
+Row& rNameRow = *vRows[nNameRow];
 for (unsigned i = rNameRow.nFirstField; i != rNameRow.nLastField - 1; ++i)
 

[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2017-04-10 Thread Caolán McNamara
 cui/source/dialogs/postdlg.cxx |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 2e716c24a628b2da2de365eb338ccc5b72960f9e
Author: Caolán McNamara 
Date:   Wed Apr 5 15:44:50 2017 +0100

prev/next buttons start invisible in the .ui

Change-Id: Iec577adb469109a11188e83d95de6ed3960bc1c4
(cherry picked from commit 4a84cbaa3786e6ef9fa91c7eb3a6a49a9010456b)
Reviewed-on: https://gerrit.libreoffice.org/36157
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/cui/source/dialogs/postdlg.cxx b/cui/source/dialogs/postdlg.cxx
index 612e38221c68..057198527390 100644
--- a/cui/source/dialogs/postdlg.cxx
+++ b/cui/source/dialogs/postdlg.cxx
@@ -64,11 +64,8 @@ SvxPostItDialog::SvxPostItDialog(vcl::Window* pParent, const 
SfxItemSet& rCoreSe
 bool bNew = true;
 sal_uInt16 nWhich = 0;
 
-if ( !bPrevNext )
-{
-m_pPrevBtn->Hide();
-m_pNextBtn->Hide();
-}
+m_pPrevBtn->Show(bPrevNext);
+m_pNextBtn->Show(bPrevNext);
 
 nWhich = rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_AUTHOR );
 OUString aAuthorStr, aDateStr;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2017-04-10 Thread Gabor Kelemen
 cui/source/options/optjava.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 75c1af593e94c049972fd929c810a9b0be23cb20
Author: Gabor Kelemen 
Date:   Tue Apr 4 17:49:54 2017 +0200

tdf#106943 Lock down Experimental features and Macro recording

Visually disable these features if they are locked by
system administrators

Change-Id: Ib35840312ad9c506e689ec6c9d432a88c07a5c28
Reviewed-on: https://gerrit.libreoffice.org/36095
Reviewed-by: Stephan Bergmann 
Tested-by: Stephan Bergmann 
Reviewed-on: https://gerrit.libreoffice.org/36319
Tested-by: Jenkins 

diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index c8bb0cb241eb..a53fc4b46c20 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -192,6 +192,12 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( vcl::Window* 
pParent, const SfxItemSet&
 if (!officecfg::Office::Common::Security::EnableExpertConfiguration::get())
 m_pExpertConfigBtn->Disable();
 
+if (officecfg::Office::Common::Misc::MacroRecorderMode::isReadOnly())
+m_pMacroCB->Disable();
+
+if (officecfg::Office::Common::Misc::ExperimentalMode::isReadOnly())
+m_pExperimentalCB->Disable();
+
 xDialogListener->SetDialogClosedLink( LINK( this, SvxJavaOptionsPage, 
DialogClosedHdl ) );
 
 EnableHdl_Impl(m_pJavaEnableCB);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2017-04-05 Thread Caolán McNamara
 cui/source/dialogs/cuicharmap.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 7bb46f684ca939fbbbe67bdb1e427e37eec430a7
Author: Caolán McNamara 
Date:   Fri Mar 31 15:15:31 2017 +0100

Related: tdf#106515 show OpenSymbol if unavailable StarSymbol requested

Change-Id: I442df1c44839642bd1f91afedee577214032466b
(cherry picked from commit 011e1cdbf33e50626f1fefa8b7b4031fa368f3e8)
Reviewed-on: https://gerrit.libreoffice.org/35974
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/cui/source/dialogs/cuicharmap.cxx 
b/cui/source/dialogs/cuicharmap.cxx
index 5ac0bf270535..24a03364bd1f 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -380,6 +380,13 @@ void SvxCharacterMap::SetCharFont( const vcl::Font& rFont )
 // like "Times New Roman;Times" resolved
 vcl::Font aTmp( GetFontMetric( rFont ) );
 
+if (aTmp.GetFamilyName() == "StarSymbol" && 
m_pFontLB->GetEntryPos(aTmp.GetFamilyName()) == LISTBOX_ENTRY_NOTFOUND)
+{
+//if for some reason, like font in an old document, StarSymbol is 
requested and its not available, then
+//try OpenSymbol instead
+aTmp.SetFamilyName("OpenSymbol");
+}
+
 if ( m_pFontLB->GetEntryPos( aTmp.GetFamilyName() ) == 
LISTBOX_ENTRY_NOTFOUND )
 return;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2017-04-05 Thread Caolán McNamara
 cui/source/inc/chardlg.hxx  |3 +++
 cui/source/tabpages/chardlg.cxx |   25 ++---
 2 files changed, 21 insertions(+), 7 deletions(-)

New commits:
commit f75cf4c772279f680839e288b3f6104f9f98c13c
Author: Caolán McNamara 
Date:   Wed Mar 29 17:03:29 2017 +0100

Resolves: tdf#106080 fix explicitly setting automatic in search by format

this is still somewhat broken in that what you see is not what you get
if you don't explicitly set automatic, but clears the regression part
of things in that the old broken behavior is restored instead of the
new broken behavior

Change-Id: I8f53a276ee60f5c9f2f28d3b92a13990cc20314a
(cherry picked from commit d7f1a1689d70b2d66d0f727b6a898ef1a971da9d)
Reviewed-on: https://gerrit.libreoffice.org/35894
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/cui/source/inc/chardlg.hxx b/cui/source/inc/chardlg.hxx
index e537150d1c18..1d54b6890b0f 100644
--- a/cui/source/inc/chardlg.hxx
+++ b/cui/source/inc/chardlg.hxx
@@ -173,6 +173,9 @@ class SvxCharEffectsPage : public SvxCharBasePage
 
 private:
 static const sal_uInt16 pEffectsRanges[];
+bool   m_bOrigFontColor;
+bool   m_bNewFontColor;
+Color  m_aOrigFontColor;
 VclPtr  m_pFontColorFT;
 VclPtrm_pFontColorLB;
 
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index fb2d9a5b995b..b60619cf 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -1343,6 +1343,8 @@ void SvxCharNamePage::PageCreated(const SfxAllItemSet& 
aSet)
 
 SvxCharEffectsPage::SvxCharEffectsPage( vcl::Window* pParent, const 
SfxItemSet& rInSet )
 : SvxCharBasePage(pParent, "EffectsPage", "cui/ui/effectspage.ui", rInSet)
+, m_bOrigFontColor(false)
+, m_bNewFontColor(false)
 {
 get(m_pFontColorFT, "fontcolorft");
 get(m_pFontColorLB, "fontcolorlb");
@@ -1559,6 +1561,7 @@ void SvxCharEffectsPage::ResetColor_Impl( const 
SfxItemSet& rSet )
 sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_COLOR );
 SfxItemState eState = rSet.GetItemState( nWhich );
 
+m_bOrigFontColor = false;
 switch ( eState )
 {
 case SfxItemState::UNKNOWN:
@@ -1592,22 +1595,29 @@ void SvxCharEffectsPage::ResetColor_Impl( const 
SfxItemSet& rSet )
 m_pPreviewWin->Invalidate();
 
 m_pFontColorLB->SelectEntry(aColor);
+
+m_aOrigFontColor = aColor;
+m_bOrigFontColor = true;
 break;
 }
 }
+m_bNewFontColor = false;
 }
 
 bool SvxCharEffectsPage::FillItemSetColor_Impl( SfxItemSet& rSet )
 {
 sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_COLOR );
-const SvxColorItem* pOld = static_cast(GetOldItem( 
rSet, SID_ATTR_CHAR_COLOR ));
-bool bChanged = true;
 const SfxItemSet& rOldSet = GetItemSet();
 
-Color aSelectedColor = m_pFontColorLB->GetSelectEntryColor();
+Color aSelectedColor;
+bool bChanged = m_bNewFontColor;
 
-if (pOld && pOld->GetValue() == aSelectedColor)
-bChanged = false;
+if (bChanged)
+{
+aSelectedColor = m_pFontColorLB->GetSelectEntryColor();
+if (m_bOrigFontColor)
+bChanged = aSelectedColor != m_aOrigFontColor;
+}
 
 if (bChanged)
 rSet.Put( SvxColorItem( aSelectedColor, nWhich ) );
@@ -1677,8 +1687,10 @@ IMPL_LINK_NOARG(SvxCharEffectsPage, TristClickHdl_Impl, 
Button*, void)
 }
 
 
-IMPL_LINK_NOARG(SvxCharEffectsPage, ColorBoxSelectHdl_Impl, SvxColorListBox&, 
void)
+IMPL_LINK(SvxCharEffectsPage, ColorBoxSelectHdl_Impl, SvxColorListBox&, rBox, 
void)
 {
+if (m_pFontColorLB == )
+m_bNewFontColor = true;
 UpdatePreview_Impl();
 }
 
@@ -2113,7 +2125,6 @@ void SvxCharEffectsPage::ChangesApplied()
 m_pShadowBtn->SaveValue();
 m_pBlinkingBtn->SaveValue();
 m_pHiddenBtn->SaveValue();
-m_pFontColorLB->SaveValue();
 }
 
 bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source cui/uiconfig sw/source

2017-03-01 Thread Michael Stahl
 cui/source/inc/paragrph.hxx   |3 -
 cui/source/tabpages/paragrph.cxx  |   85 --
 cui/uiconfig/ui/textflowpage.ui   |   10 +++-
 sw/source/uibase/utlui/uitool.cxx |   21 -
 4 files changed, 90 insertions(+), 29 deletions(-)

New commits:
commit a5104f575a5acf8aea957cb79aa0fd67bc74f141
Author: Michael Stahl 
Date:   Wed Mar 1 12:39:54 2017 +0100

tdf#77111 cui,sw: fix page number offset on paragraph dialog "Text Flow"

Commit c2ccd20c0fd92bddfff76447754541705e3eb8f3 introduced 0 as a valid
value for page number offset in sw core.

Unfortunately the paragraph dialog was not changed then; previously
page number 0 would do automatic numbering, but since then 0 was set as
the offset, and once you have a 0 offset there's no easy way to remove
it, you have to remove the whole page break.

* change the label before the text number edit widget to a checkbox
  that disables the edit widget

* keep the id "labelPageNum" so that translations still work

* adapt SfxToSwPageDescAttr so it can not just set but also clear the
  page number

* set initial value to 1; 0 is a really bad default since we can't
  export it to ODF (see tdf#91306)

Change-Id: Ic4ca9e2562bb65ac359b305a2202f782e8598307
(cherry picked from commit d36fa0589ab822dc617c65b4d0d3bf68c092ad37)
Reviewed-on: https://gerrit.libreoffice.org/34745
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx
index c38f65a..abe414a 100644
--- a/cui/source/inc/paragrph.hxx
+++ b/cui/source/inc/paragrph.hxx
@@ -234,7 +234,7 @@ private:
 VclPtrm_pBreakPositionLB;
 VclPtrm_pApplyCollBtn;
 VclPtrm_pApplyCollBox;
-VclPtr  m_pPagenumText;
+VclPtrm_pPageNumBox;
 VclPtr   m_pPagenumEdit;
 
 // paragraph division
@@ -262,6 +262,7 @@ private:
 DECL_LINK(ApplyCollClickHdl_Impl, Button*, void);
 DECL_LINK( PageBreakPosHdl_Impl, ListBox&, void );
 DECL_LINK( PageBreakTypeHdl_Impl, ListBox&, void );
+DECL_LINK(PageNumBoxClickHdl_Impl, Button*, void);
 
 virtual voidPageCreated(const SfxAllItemSet& aSet) override;
 };
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 2f63044..5a26a65 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -1402,18 +1402,27 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* 
rOutSet )
 }
 }
 
-if (m_pPagenumEdit->IsEnabled() && m_pPagenumEdit->IsValueModified())
+if (m_pPageNumBox->IsEnabled()
+&& (m_pPageNumBox->IsValueChangedFromSaved() || 
m_pPagenumEdit->IsValueModified()))
 {
-SfxUInt16Item aPageNum( SID_ATTR_PARA_PAGENUM,
-(sal_uInt16)m_pPagenumEdit->GetValue() );
-
 pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_PAGENUM );
 
-if ( !pOld || static_cast(pOld)->GetValue() != 
aPageNum.GetValue() )
+if (TRISTATE_TRUE == m_pPageNumBox->GetState()
+&& (!pOld || IsInvalidItem(pOld)
+|| static_cast(pOld)->GetValue() != 
m_pPagenumEdit->GetValue()))
 {
+SfxUInt16Item aPageNum(SID_ATTR_PARA_PAGENUM,
+static_cast(m_pPagenumEdit->GetValue()));
 rOutSet->Put( aPageNum );
 bModified = true;
 }
+else if (TRISTATE_FALSE == m_pPageNumBox->GetState()
+&& (pOld || IsInvalidItem(pOld)))
+{
+// need to tell sw to remove the item
+rOutSet->DisableItem(SID_ATTR_PARA_PAGENUM);
+bModified = true;
+}
 }
 
 // pagebreak
@@ -1605,11 +1614,34 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* 
rSet )
 
 _nWhich = GetWhich( SID_ATTR_PARA_PAGENUM );
 
-if (rSet->GetItemState(_nWhich) >= SfxItemState::SET)
+switch (rSet->GetItemState(_nWhich))
 {
-const sal_uInt16 nPageNum =
-static_cast(rSet->Get( _nWhich ) 
).GetValue();
-m_pPagenumEdit->SetValue( nPageNum );
+case SfxItemState::SET:
+{
+m_pPageNumBox->EnableTriState(false);
+m_pPageNumBox->SetState(TRISTATE_TRUE);
+SfxUInt16Item const*const pItem(static_cast(rSet->GetItem(_nWhich)));
+const sal_uInt16 nPageNum(pItem->GetValue());
+m_pPagenumEdit->SetValue( nPageNum );
+break;
+}
+case SfxItemState::DONTCARE:
+{
+m_pPageNumBox->EnableTriState();
+m_pPageNumBox->SetState(TRISTATE_INDET);
+break;
+}
+case SfxItemState::UNKNOWN:
+case SfxItemState::DEFAULT:
+case SfxItemState::DISABLED:
+{
+

[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2017-02-02 Thread Caolán McNamara
 cui/source/dialogs/SpellDialog.cxx |9 -
 1 file changed, 9 deletions(-)

New commits:
commit 38e7b2db19b85088cdf98dc1a8080e54f92c8714
Author: Caolán McNamara 
Date:   Wed Feb 1 10:28:58 2017 +

Resolves: tdf#100438 focus trapped in disabled toolbar

lets just leave the toolbar active the whole time, seems
to make more sense anyway wrt being allowed to keyboard
into it to paste/insert special character

Change-Id: I174fb707c4c7fd21d95461cc93323eb6d8970818
(cherry picked from commit 4bd53cd880ecfa9af27735344bf57fb45de20c25)
Reviewed-on: https://gerrit.libreoffice.org/33785
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/cui/source/dialogs/SpellDialog.cxx 
b/cui/source/dialogs/SpellDialog.cxx
index e0bdeb0..a4e83e5 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -436,7 +436,6 @@ void SpellDialog::SpellContinue_Impl(bool 
bUseSavedSentence, bool bIgnoreCurrent
  */
 IMPL_LINK_NOARG( SpellDialog, InitHdl, void*, void)
 {
-m_pToolbar->Disable();
 SetUpdateMode( false );
 //show or hide AutoCorrect depending on the modules abilities
 m_pAutoCorrPB->Show(rParent.HasAutoCorrection());
@@ -1523,14 +1522,6 @@ bool SentenceEditWindow_Impl::PreNotify( NotifyEvent& 
rNEvt )
 else
 bChange = false;
 }
-else if (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS && m_xToolbar)
-{
-m_xToolbar->Enable();
-}
-else if(rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS && m_xToolbar)
-{
-m_xToolbar->Disable();
-}
 return bChange || VclMultiLineEdit::PreNotify(rNEvt);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2017-02-01 Thread Caolán McNamara
 cui/source/factory/init.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 132b61d2a72515d36767e72cc4b9d08b846d66fc
Author: Caolán McNamara 
Date:   Mon Jan 30 14:46:21 2017 +

crash on exit from undisposed insert special character dialog

right click on style combobox in writer toolbar, insert character, esc,
ctrl+f4 and crash

Change-Id: I83c88584c6d772bf629121a2bcdc16076bee8003
(cherry picked from commit cfdfe1be91101654456bdf1f16d92461e1e5dbfa)
Reviewed-on: https://gerrit.libreoffice.org/33700
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/cui/source/factory/init.cxx b/cui/source/factory/init.cxx
index 5f53852..fd7cbc6 100644
--- a/cui/source/factory/init.cxx
+++ b/cui/source/factory/init.cxx
@@ -27,7 +27,7 @@ extern "C"
 SAL_DLLPUBLIC_EXPORT bool GetSpecialCharsForEdit(vcl::Window* i_pParent, const 
vcl::Font& i_rFont, OUString& o_rResult)
 {
 bool bRet = false;
-VclPtrInstance< SvxCharacterMap > aDlg( i_pParent );
+ScopedVclPtrInstance aDlg(i_pParent);
 aDlg->DisableFontSelection();
 aDlg->SetCharFont(i_rFont);
 if ( aDlg->Execute() == RET_OK )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2017-01-26 Thread Caolán McNamara
 cui/source/tabpages/border.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit b8b744a4ea46a4e68383f9283e00f4de5fa8a1cf
Author: Caolán McNamara 
Date:   Tue Jan 24 16:11:46 2017 +

Resolves: tdf#104552 table properties dialog drops previous border color

Change-Id: Ie39ea17fe56cc88efc65f6916aaeb1bd1b77c51f
(cherry picked from commit e2eaaa8a578fff5770a99e3f8ee2a7c95c460891)
Reviewed-on: https://gerrit.libreoffice.org/33502
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index f989a7c..9a6e7d6 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -542,6 +542,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
 
 // set the current style and color (caches style in control even if 
nothing is selected)
 SelStyleHdl_Impl(*m_pLbLineStyle);
+SelColHdl_Impl(*m_pLbLineColor);
 }
 
 bool bEnable = m_pWndShadows->GetSelectItemId() > 1 ;
@@ -832,6 +833,7 @@ IMPL_LINK_NOARG(SvxBorderTabPage, SelPreHdl_Impl, 
ValueSet*, void)
 
 // set current style to all previously selected lines
 SelStyleHdl_Impl(*m_pLbLineStyle);
+SelColHdl_Impl(*m_pLbLineColor);
 }
 
 // Presets ValueSet does not show a selection (used as push buttons).
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2017-01-18 Thread Muhammet Kara
 cui/source/customize/cfg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b35ea66a9381c4ddee52bb9aa94b51ecaff98605
Author: Muhammet Kara 
Date:   Thu Jan 12 11:17:11 2017 +0300

tdf#105014: Disable related buttons when there is no menu to edit

Clicking the "Add Separator" or the "Add Submenu" button, when there is
no menu edit, causes LibreOffice to crash. So disable them properly.

Change-Id: Ibf685145a87c9e4343d83e1bb5ef6f08136c8f31
Reviewed-on: https://gerrit.libreoffice.org/32987
Tested-by: Jenkins 
Reviewed-by: Katarina Behrens 
(cherry picked from commit ce0f9962d1d1d5a4f6301be18c23b2d14efd9d6b)
Reviewed-on: https://gerrit.libreoffice.org/33246
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index cf734f7..93139ca 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -2546,7 +2546,6 @@ void SvxMenuConfigPage::UpdateButtonStates()
 m_pMoveUpButton->Enable( false );
 m_pMoveDownButton->Enable( false );
 m_pDeleteCommandButton->Enable(false);
-m_pAddSeparatorButton->Enable();
 
 pPopup->EnableItem( "modrename", false );
 
@@ -2655,6 +2654,7 @@ IMPL_LINK_NOARG( SvxMenuConfigPage, SelectMenu, ListBox&, 
void )
 m_pModifyCommandButton->Enable( pMenuData != nullptr );
 m_pAddCommandsButton->Enable( pMenuData != nullptr );
 m_pAddSeparatorButton->Enable( pMenuData != nullptr );
+m_pAddSubmenuButton->Enable( pMenuData != nullptr );
 
 PopupMenu* pPopup = m_pModifyTopLevelButton->GetPopupMenu();
 if ( pMenuData )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2017-01-13 Thread Tomaž Vajngerl
 cui/source/tabpages/tparea.cxx |   29 +
 1 file changed, 29 insertions(+)

New commits:
commit 9157ae95d4861c545b01e1d9df67932c86a3c640
Author: Tomaž Vajngerl 
Date:   Fri Jan 13 13:55:01 2017 +0100

tdf#105259 calculate sizes of all area tab pages on construction

When we open dialog that contains the area tab, we need to
calculate the size of area tab pages (that are triggered by
clicking on a button) and set the page area to the appropriate
combined size. Otherwise we don't account for the needed space
correctly and some page will be squished or have overlapping
controls.

This change creates all pages at dialog construction, gets
all the optimal sizes and sets the size of the page container box
to the combined (minimal) size.

Change-Id: Ie04a121810b96973f6e4502a52af675b2baacf25
Reviewed-on: https://gerrit.libreoffice.org/33040
Reviewed-by: Tomaž Vajngerl 
Tested-by: Tomaž Vajngerl 
(cherry picked from commit e6d7d737522124350a17a3cfdee055f03200a274)
Reviewed-on: https://gerrit.libreoffice.org/33048
Tested-by: Jenkins 
Reviewed-by: Heiko Tietze 

diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 9972ca5..f2a054d 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -66,6 +66,19 @@ const sal_uInt16 SvxAreaTabPage::pAreaRanges[] =
 0
 };
 
+namespace
+{
+
+void lclExtendSize(Size& rSize, const Size& rInputSize)
+{
+if (rSize.Width() < rInputSize.Width())
+rSize.Width() = rInputSize.Width();
+if (rSize.Height() < rInputSize.Height())
+rSize.Height() = rInputSize.Height();
+}
+
+} // end anonymous namespace
+
 /*
 |*
 |*  Dialog to modify fill-attributes
@@ -125,6 +138,22 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, 
const SfxItemSet& rInAttrs
 m_pBtnPattern->SetClickHdl(aLink);
 
 SetExchangeSupport();
+
+// Calculate optimal size of all pages..
+m_pFillTabPage.disposeAndReset(SvxColorTabPage::Create(m_pFillTab, 
_rXFSet));
+Size aSize = m_pFillTabPage->GetOptimalSize();
+m_pFillTabPage.disposeAndReset(SvxGradientTabPage::Create(m_pFillTab, 
_rXFSet));
+lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize());
+m_pFillTabPage.disposeAndReset(SvxBitmapTabPage::Create(m_pFillTab, 
_rXFSet));
+lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize());
+m_pFillTabPage.disposeAndReset(SvxHatchTabPage::Create(m_pFillTab, 
_rXFSet));
+lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize());
+m_pFillTabPage.disposeAndReset(SvxPatternTabPage::Create(m_pFillTab, 
_rXFSet));
+lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize());
+m_pFillTabPage.disposeAndClear();
+
+m_pFillTab->set_width_request(aSize.Width());
+m_pFillTab->set_height_request(aSize.Height());
 }
 
 SvxAreaTabPage::~SvxAreaTabPage()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2017-01-09 Thread Tomaž Vajngerl
 cui/source/tabpages/tparea.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit 5dbeccbe96f1cace62665523e49b5e693839d265
Author: Tomaž Vajngerl 
Date:   Mon Jan 9 22:59:29 2017 +0100

tdf#103225 revert setting of a fixed size for the dialog

Setting fixed size of a dialog causes a mess with HiDPI and could
also cause problems with certain languages because the translated
strings could streach the dialog size. It is better to let the
dialog calculate its ideal size depending on the content, which
in some cases is not ideal but at least it shouldn't create a
mess.

The decision to revert this was done in design hangout on
2016-12-22.

Change-Id: I0ad1e38e1625cdbbf65b846118995bd5d3ebb47e
Reviewed-on: https://gerrit.libreoffice.org/32912
Reviewed-by: Tomaž Vajngerl 
Tested-by: Tomaž Vajngerl 
(cherry picked from commit 62a94dcf0c750e335d6ce272d8a5df9813910d5a)
Reviewed-on: https://gerrit.libreoffice.org/32913
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 22bb3c9..9972ca5 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -125,9 +125,6 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const 
SfxItemSet& rInAttrs
 m_pBtnPattern->SetClickHdl(aLink);
 
 SetExchangeSupport();
-
-m_pFillTab->set_width_request(750);
-m_pFillTab->set_height_request(550);
 }
 
 SvxAreaTabPage::~SvxAreaTabPage()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2017-01-03 Thread David Tardon
 cui/source/options/optgenrl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1f193d90ec3d14fac01dbb573bd4ed0269b8620e
Author: David Tardon 
Date:   Mon Jan 2 09:02:53 2017 +0100

WaE: unused variable

Change-Id: Ib701d3adf1e79554e2ddcefb5943092e3a886041
(cherry picked from commit 99f3f180034b78900e9ff6953b9866fde3da01d6)
Reviewed-on: https://gerrit.libreoffice.org/32694
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx
index 559e569..385f580 100644
--- a/cui/source/options/optgenrl.cxx
+++ b/cui/source/options/optgenrl.cxx
@@ -211,7 +211,7 @@ void SvxGeneralTabPage::InitControls ()
 {
 // which language bit do we use? (see Lang and vRowInfo[] above)
 unsigned LangBit;
-switch (LanguageType const eLang = 
Application::GetSettings().GetUILanguageTag().getLanguageType())
+switch (Application::GetSettings().GetUILanguageTag().getLanguageType())
 {
 case LANGUAGE_ENGLISH_US:
 LangBit = Lang::US;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2016-12-19 Thread Katarina Behrens
 cui/source/tabpages/tparea.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 28ffaf79b993d05dd0775d0a14e83dc476c93bf1
Author: Katarina Behrens 
Date:   Thu Dec 15 16:36:00 2016 +0100

tdf#104221: Make up for non-existent FillItemSet

for fill:none option

Change-Id: I12ada9276a613f157976650148f2389126d16f08
Reviewed-on: https://gerrit.libreoffice.org/32050
Reviewed-by: Katarina Behrens 
Tested-by: Katarina Behrens 
(cherry picked from commit 4c5079791f5d985151ebc090c5a07705e76a728e)
Reviewed-on: https://gerrit.libreoffice.org/32053
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index fdbcfc9..22bb3c9 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -205,6 +205,14 @@ DeactivateRC SvxAreaTabPage::DeactivatePage( SfxItemSet* 
_pSet )
 FillType eFillType = static_cast(maBox.GetCurrentButtonPos());
 switch( eFillType )
 {
+case TRANSPARENT:
+{
+// Fill: None doesn't have its own tabpage and thus
+// implementation of FillItemSet, so we supply it here
+XFillStyleItem aStyleItem( drawing::FillStyle_NONE );
+_pSet->Put( aStyleItem );
+break;
+}
 case SOLID:
 return DeactivatePage_Impl(_pSet);
 case GRADIENT:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2016-12-16 Thread Caolán McNamara
 cui/source/options/optlingu.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e88cd210690b9d14101d5800bbbf8422a9e12d3e
Author: Caolán McNamara 
Date:   Thu Dec 15 21:17:58 2016 +

coverity#1397204 Dereference null return value

Change-Id: Ief4b455b316b55ebf012a8650c96da037df0135c
(cherry picked from commit f74cad45681cc0ea5706a112a0e17f14a3197e39)

diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 5990721..511c3c8 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -222,7 +222,7 @@ static void lcl_SetCheckButton( SvTreeListEntry* pEntry, 
bool bCheck )
 SvLBoxButton* pItem = 
static_cast(pEntry->GetFirstItem(SvLBoxItemType::Button));
 
 DBG_ASSERT(pItem,"SetCheckButton:Item not found");
-if (pItem->GetType() == SvLBoxItemType::Button)
+if (pItem && pItem->GetType() == SvLBoxItemType::Button)
 {
 if (bCheck)
 pItem->SetStateChecked();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2016-12-14 Thread Julien Nabet
 cui/source/tabpages/tpbitmap.cxx |   25 +
 1 file changed, 17 insertions(+), 8 deletions(-)

New commits:
commit b8cb82eaeab9f0f36dc6dae1009d9e97108a90c3
Author: Julien Nabet 
Date:   Mon Dec 12 21:44:59 2016 +0100

tdf#104615: there's no mpView when opening odc directly

2 parts changed for these bts:
0  SdrEditView::GetGeoAttrFromMarked (this=0x0) at 
/home/julien/lo/libreoffice/svx/source/svdraw/svdedtv1.cxx:1278
1  0x2aaadf70ae97 in SvxBitmapTabPage::Reset (this=0x5b2eb8b0, 
rAttrs=0x5afa0310) at 
/home/julien/lo/libreoffice/cui/source/tabpages/tpbitmap.cxx:278
See https://bugs.documentfoundation.org//show_bug.cgi?id=104615#c1

0  SdrPaintView::GetModel (this=0x0) at 
/home/julien/lo/libreoffice/include/svx/svdpntv.hxx:256
1  0x2aaadf90ba0f in SvxBitmapTabPage::ModifyBitmapHdl 
(this=this@entry=0x5b2e7950) at 
/home/julien/lo/libreoffice/cui/source/tabpages/tpbitmap.cxx:526
2  0x2aaadf90bcc7 in SvxBitmapTabPage::ClickBitmapHdl_Impl 
(this=this@entry=0x5b2e7950) at 
/home/julien/lo/libreoffice/cui/source/tabpages/tpbitmap.cxx:457
3  0x2aaadf90c9d8 in SvxBitmapTabPage::Reset (this=0x5b2e7950, 
rAttrs=) at 
/home/julien/lo/libreoffice/cui/source/tabpages/tpbitmap.cxx:441
See https://bugs.documentfoundation.org//show_bug.cgi?id=104615#c2

Thank you to Katarina Behrens for her help on this.
See 
http://nabble.documentfoundation.org/About-opening-odc-file-and-mpView-null-td4202317.html

Change-Id: Ibbca868f33ca3292e0d3f787df87876bc9464e0b
Reviewed-on: https://gerrit.libreoffice.org/31924
Reviewed-by: Katarina Behrens 
Tested-by: Katarina Behrens 
(cherry picked from commit d543d66a4ee34d3b0088f45951b56c150f7206ec)
Reviewed-on: https://gerrit.libreoffice.org/32008
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index ec7b6d5..a703aef 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -275,17 +275,26 @@ bool SvxBitmapTabPage::FillItemSet( SfxItemSet* rAttrs )
 
 void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
 {
-SfxItemSet rGeoAttr(mpView->GetGeoAttrFromMarked());
-const SfxPoolItem* pItem = nullptr;
-const double fUIScale(double(mpView->GetModel()->GetUIScale()));
+const SfxPoolItem* pItemTransfWidth = nullptr;
+const SfxPoolItem* pItemTransfHeight = nullptr;
+double fUIScale  = 1.0;
+if (mpView)
+{
+fUIScale  = ( mpView->GetModel() ? 
double(mpView->GetModel()->GetUIScale()) : 1.0);
+
 
-pItem = GetItem( rGeoAttr, SID_ATTR_TRANSFORM_WIDTH );
-m_fObjectWidth = std::max( pItem ? (double)static_cast(pItem)->GetValue() : 0.0, 1.0 );
+if (mpView->AreObjectsMarked())
+{
+SfxItemSet rGeoAttr(mpView->GetGeoAttrFromMarked());
+pItemTransfWidth = GetItem( rGeoAttr, SID_ATTR_TRANSFORM_WIDTH );
+pItemTransfHeight= GetItem( rGeoAttr, SID_ATTR_TRANSFORM_HEIGHT );
+}
+}
+m_fObjectWidth = std::max( pItemTransfWidth ? (double)static_cast(pItemTransfWidth)->GetValue() : 0.0, 1.0 );
+m_fObjectHeight = std::max( pItemTransfHeight ? (double)static_cast(pItemTransfHeight)->GetValue() : 0.0, 1.0 );
 double 
fTmpWidth((OutputDevice::LogicToLogic(static_cast(m_fObjectWidth), 
mePoolUnit, MapUnit::Map100thMM )) / fUIScale);
 m_fObjectWidth = fTmpWidth;
 
-pItem = GetItem( rGeoAttr, SID_ATTR_TRANSFORM_HEIGHT );
-m_fObjectHeight = std::max( pItem ? (double)static_cast(pItem)->GetValue() : 0.0, 1.0 );
 double 
fTmpHeight((OutputDevice::LogicToLogic(static_cast(m_fObjectHeight), 
mePoolUnit, MapUnit::Map100thMM )) / fUIScale);
 m_fObjectHeight = fTmpHeight;
 
@@ -518,7 +527,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, 
ValueSet*, void)
 
 BitmapEx aBmpEx(pGraphicObject->GetGraphic().GetBitmapEx());
 Size aTempBitmapSize = aBmpEx.GetSizePixel();
-const double fUIScale(double(mpView->GetModel()->GetUIScale()));
+const double fUIScale = ( (mpView && mpView->GetModel()) ? 
double(mpView->GetModel()->GetUIScale()) : 1.0);
 
 rBitmapSize.Width() = 
((OutputDevice::LogicToLogic(static_cast(aTempBitmapSize.Width()),MapUnit::MapPixel,
 MapUnit::Map100thMM )) / fUIScale);
 rBitmapSize.Height() = 
((OutputDevice::LogicToLogic(static_cast(aTempBitmapSize.Height()),MapUnit::MapPixel,
 MapUnit::Map100thMM )) / fUIScale);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2016-12-13 Thread Eike Rathke
 cui/source/tabpages/backgrnd.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 638f40d16c9e0b01e3cb0f53d9d5703a361b2100
Author: Eike Rathke 
Date:   Mon Dec 12 21:24:20 2016 +0100

Resolves: tdf#101588, do not prevent color de-selection tdf#96382 follow-up

Comparing colors to determine whether to set one in the result item set does
not work if the color previously was set before SaveValue() was called
unconditionally even for the "undetermined" color state. Actually we want to
know whether the user selected a color instead.

Change-Id: I508f791684ebd79ba4af9cb654f9aa0bb25bff5d
(cherry picked from commit 429be969b39867d6d9f36978c9ac15b601e78ba6)
Reviewed-on: https://gerrit.libreoffice.org/31922
Reviewed-by: Eike Rathke 
Tested-by: Jenkins 

diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 41e525d..6f5d72b 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -684,7 +684,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* 
rCoreSet )
 {
 // Brush-treatment:
 if ( rOldItem.GetColor() != aBgdColor ||
- (SfxItemState::DEFAULT >= eOldItemState && 
m_pBackgroundColorSet->GetSavedValue() != 
m_pBackgroundColorSet->GetSelectItemId()))
+ (SfxItemState::DEFAULT >= eOldItemState && 
!m_pBackgroundColorSet->IsNoSelection()))
 {
 bModified = true;
 rCoreSet->Put( SvxBrushItem( aBgdColor, nWhich ) );
@@ -1423,9 +1423,13 @@ void SvxBackgroundTabPage::FillControls_Impl( const 
SvxBrushItem& rBgdAttr,
 }
 else
 {
+bool bNoSelection = m_pBackgroundColorSet->IsNoSelection();
 m_pBackgroundColorSet->SelectItem( nCol );
+m_pBackgroundColorSet->SaveValue();
+// The actual selection is user set, not what we preset.
+if (bNoSelection)
+m_pBackgroundColorSet->SetNoSelection();
 }
-m_pBackgroundColorSet->SaveValue();
 
 m_pPreviewWin1->NotifyChange( aBgdColor );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source svx/source

2016-11-27 Thread Stephan Bergmann
 cui/source/tabpages/tpcolor.cxx  |6 --
 svx/source/tbxctrls/tbcontrl.cxx |5 -
 2 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 5db3eff8bea4b4d907251c46bc30d1114daba3bc
Author: Stephan Bergmann 
Date:   Fri Nov 25 17:29:09 2016 +0100

Handle cases where last-used palette disappeared

...so PaletteManager::SetPalette(LISTBOX_ENTRY_NOTFOUND) would set
PaletteManager::mnCurrentPalette to 65535, and
PaletteManager::GetSelectedPalettePath would do out-of-bounds access into
PaletteManage::m_Palettes.

That the last-used palette (as stored under in the configuration under
/org.openoffice.Office.Common/UserColors/PaletteName) may become more common
with pending changes like 
"tdf#104047 Remove dispensable palettes".

Change-Id: I5641bae04f50fea8aa69027a75de08c22394c281
(cherry picked from commit 8b718e3774f1ffb69f9aad565216556c798e95f4)
Reviewed-on: https://gerrit.libreoffice.org/31209
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index c31f57f..e4545b4 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -220,7 +220,10 @@ void SvxColorTabPage::FillPaletteLB()
 }
 OUString aPaletteName( 
officecfg::Office::Common::UserColors::PaletteName::get() );
 m_pSelectPalette->SelectEntry(aPaletteName);
-SelectPaletteLBHdl( *m_pSelectPalette );
+if (m_pSelectPalette->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND)
+{
+SelectPaletteLBHdl( *m_pSelectPalette );
+}
 }
 
 void SvxColorTabPage::Construct()
@@ -228,7 +231,6 @@ void SvxColorTabPage::Construct()
 if (pColorList.is())
 {
 FillPaletteLB();
-SelectPaletteLBHdl( *m_pSelectPalette );
 ImpColorCountChanged();
 }
 }
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index aa725a7..36b57a8 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1354,7 +1354,10 @@ SvxColorWindow::SvxColorWindow(const OUString&   
 rCommand,
 }
 OUString aPaletteName( 
officecfg::Office::Common::UserColors::PaletteName::get() );
 mpPaletteListBox->SelectEntry( aPaletteName );
-SelectPaletteHdl( *mpPaletteListBox );
+if (mpPaletteListBox->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND)
+{
+SelectPaletteHdl( *mpPaletteListBox );
+}
 
 mpButtonAutoColor->SetClickHdl( LINK( this, SvxColorWindow, 
AutoColorClickHdl ) );
 mpButtonNoneColor->SetClickHdl( LINK( this, SvxColorWindow, 
AutoColorClickHdl ) );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source

2016-11-26 Thread Andras Timar
 cui/source/options/optsave.cxx |   20 +++-
 1 file changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 5f9bd7677047abfc9d3bde0db78f74ff23204f0d
Author: Andras Timar 
Date:   Sat Nov 26 17:00:43 2016 +0100

respect read-only config items in Options - Load/Save - General dialog

Change-Id: I110e8eb2b858c8b86b01d46bec40873939ae53d8
Reviewed-on: https://gerrit.libreoffice.org/31237
Tested-by: Jenkins 
Reviewed-by: Andras Timar 

diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index 09d5a92..8ca666b 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -397,8 +397,10 @@ void SvxSaveTabPage::Reset( const SfxItemSet* )
 SvtSaveOptions aSaveOpt;
 aLoadUserSettingsCB->Check(aSaveOpt.IsLoadUserSettings());
 aLoadUserSettingsCB->SaveValue();
+
aLoadUserSettingsCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_USEUSERDATA));
 aLoadDocPrinterCB->Check( aSaveOpt.IsLoadDocumentPrinter() );
 aLoadDocPrinterCB->SaveValue();
+
aLoadDocPrinterCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_LOADDOCPRINTER));
 
 if ( !pImpl->bInitialized )
 {
@@ -471,25 +473,33 @@ void SvxSaveTabPage::Reset( const SfxItemSet* )
 }
 
 aDocInfoCB->Check(aSaveOpt.IsDocInfoSave());
+aDocInfoCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_DOCINFSAVE));
 
 aBackupCB->Check(aSaveOpt.IsBackup());
-bool bBackupRO = aSaveOpt.IsReadOnly(SvtSaveOptions::E_BACKUP);
-aBackupCB->Enable(!bBackupRO);
+aBackupCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_BACKUP));
 
 aAutoSaveCB->Check(aSaveOpt.IsAutoSave());
+aAutoSaveCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_AUTOSAVE));
+
 aUserAutoSaveCB->Check(aSaveOpt.IsUserAutoSave());
+
aUserAutoSaveCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_USERAUTOSAVE));
+
 aWarnAlienFormatCB->Check(aSaveOpt.IsWarnAlienFormat());
 
aWarnAlienFormatCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_WARNALIENFORMAT));
 
-aAutoSaveEdit->SetValue( aSaveOpt.GetAutoSaveTime() );
+aAutoSaveEdit->SetValue(aSaveOpt.GetAutoSaveTime());
+
aAutoSaveEdit->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_AUTOSAVETIME));
 
 // save relatively
-aRelativeFsysCB->Check( aSaveOpt.IsSaveRelFSys() );
+aRelativeFsysCB->Check(aSaveOpt.IsSaveRelFSys());
+
aRelativeFsysCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_SAVERELFSYS));
 
-aRelativeInetCB->Check( aSaveOpt.IsSaveRelINet() );
+aRelativeInetCB->Check(aSaveOpt.IsSaveRelINet());
+
aRelativeInetCB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_SAVERELINET));
 
 void* pDefaultVersion = reinterpret_cast( 
aSaveOpt.GetODFDefaultVersion() );
 aODFVersionLB->SelectEntryPos( aODFVersionLB->GetEntryPos( pDefaultVersion 
) );
+
aODFVersionLB->Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_ODFDEFAULTVERSION));
 
 AutoClickHdl_Impl( aAutoSaveCB );
 ODFVersionHdl_Impl( *aODFVersionLB );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits