[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - include/svx svx/source sw/CppunitTest_sw_odfexport.mk sw/qa sw/source
include/svx/unobrushitemhelper.hxx|3 + svx/source/unodraw/unobrushitemhelper.cxx |6 +-- sw/CppunitTest_sw_odfexport.mk|3 + sw/qa/extras/odfexport/data/tdf92379.fodt | 58 ++ sw/qa/extras/odfexport/odfexport.cxx | 13 ++ sw/source/core/unocore/unostyle.cxx |4 +- 6 files changed, 81 insertions(+), 6 deletions(-) New commits: commit 89e2e2f59738adee91282c19e7d43e98784fdacb Author: Michael Stahl Date: Fri Aug 21 18:28:23 2015 +0200 tdf#92379: svx: don't overwrite fo:background-color on ODF import getSvxBrushItemFromSourceSet() is called once for each property of a frame style that is set, and the "solid" fill-style is set by first applying the BackColorRGB and then BackTransparency property. So there is an intermediate state that has fill-style NONE but a XFillColorItem set - don't reset the color to white in that case! Apparently writerfilter generally relies on the current reset-to-AUTO implementation (loads of test failures), so for now limit the fix for when we know that a frame style is imported from ODF. (regression from 3d399b0e45720354fc64dc3d121ee486e01eff89) (cherry picked from commit 79fb61efb847405fa47235002b52ee8efad5e339) tdf#92379: sw: unit test for frame style background color (cherry picked from commit 982537d77c2db463cc053cfdcd522530a3834c9e) Change-Id: Ia987fe586ec819a1f3cd85acdbfb03c74ca0ec2c Reviewed-on: https://gerrit.libreoffice.org/18042 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/svx/unobrushitemhelper.hxx b/include/svx/unobrushitemhelper.hxx index eea95b6..4055c45 100644 --- a/include/svx/unobrushitemhelper.hxx +++ b/include/svx/unobrushitemhelper.hxx @@ -46,7 +46,8 @@ SVX_DLLPUBLIC void setSvxBrushItemAsFillAttributesToTargetSet( SVX_DLLPUBLIC SvxBrushItem getSvxBrushItemFromSourceSet( const SfxItemSet& rSourceSet, sal_uInt16 nBackgroundID, -bool bSearchInParents = true); +bool bSearchInParents = true, +bool bXMLImportHack = false); #endif // _UNOBRUSHITEMHELPER_HXX diff --git a/svx/source/unodraw/unobrushitemhelper.cxx b/svx/source/unodraw/unobrushitemhelper.cxx index d10aab6..fb6728d 100644 --- a/svx/source/unodraw/unobrushitemhelper.cxx +++ b/svx/source/unodraw/unobrushitemhelper.cxx @@ -192,7 +192,7 @@ SvxBrushItem getSvxBrushItemForSolid(const SfxItemSet& rSourceSet, bool bSearchI } // -SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt16 nBackgroundID, bool bSearchInParents) +SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt16 nBackgroundID, bool bSearchInParents, bool bXMLImportHack) { const XFillStyleItem* pXFillStyleItem(static_cast< const XFillStyleItem* >(rSourceSet.GetItem(XATTR_FILLSTYLE, bSearchInParents))); @@ -201,8 +201,8 @@ SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt // no fill, still need to rescue the evtl. set RGB color, but use as transparent color (we have drawing::FillStyle_NONE) Color aFillColor(static_cast< const XFillColorItem& >(rSourceSet.Get(XATTR_FILLCOLOR, bSearchInParents)).GetColorValue()); -// when fill style is none, then don't allow anything other than 0 or auto. -if (aFillColor.GetColor() != 0) +// for writerfilter: when fill style is none, then don't allow anything other than 0 or auto. +if (!bXMLImportHack && aFillColor.GetColor() != 0) aFillColor.SetColor(COL_AUTO); aFillColor.SetTransparency(0xff); diff --git a/sw/CppunitTest_sw_odfexport.mk b/sw/CppunitTest_sw_odfexport.mk index 7bc7ed8..c6ec626 100644 --- a/sw/CppunitTest_sw_odfexport.mk +++ b/sw/CppunitTest_sw_odfexport.mk @@ -56,6 +56,9 @@ $(eval $(call gb_CppunitTest_use_components,sw_odfexport,\ embeddedobj/util/embobj \ filter/source/config/cache/filterconfig1 \ filter/source/storagefilterdetect/storagefd \ + filter/source/odfflatxml/odfflatxml \ + filter/source/xmlfilterdetect/xmlfd \ + filter/source/xmlfilteradaptor/xmlfa \ framework/util/fwk \ i18npool/util/i18npool \ linguistic/source/lng \ diff --git a/sw/qa/extras/odfexport/data/tdf92379.fodt b/sw/qa/extras/odfexport/data/tdf92379.fodt new file mode 100644 index 000..280dc5a --- /dev/null +++ b/sw/qa/extras/odfexport/data/tdf92379.fodt @@ -0,0 +1,58 @@ + + +http://www.w3.org/1999/xlink"; xmlns:dc="http://purl.org/dc/elements/1.1/"; xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML"; xmlns:form="urn:oasis:
[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - include/svx svx/source
include/svx/zoomsliderctrl.hxx |1 + svx/source/stbctrls/zoomsliderctrl.cxx | 15 +-- 2 files changed, 14 insertions(+), 2 deletions(-) New commits: commit 0bc37cf20044fe8fee0cc7dd5af3ee58304a3a0f Author: Rodolfo Ribeiro Gomes Date: Sat Jan 31 19:08:05 2015 -0200 tdf#47577 Zoom slider should only react to full click Change-Id: If859754c956a634a96066ac407b70d6dd2759d53 Signed-off-by: Rodolfo Ribeiro Gomes Reviewed-on: https://gerrit.libreoffice.org/14265 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 53740bd71a0ae569da36b9293ef22842a0b53f1e) Signed-off-by: Michael Stahl diff --git a/include/svx/zoomsliderctrl.hxx b/include/svx/zoomsliderctrl.hxx index 7af69db..f35f825 100644 --- a/include/svx/zoomsliderctrl.hxx +++ b/include/svx/zoomsliderctrl.hxx @@ -49,6 +49,7 @@ public: virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) SAL_OVERRIDE; virtual void Paint( const UserDrawEvent& rEvt ) SAL_OVERRIDE; virtual bool MouseButtonDown( const MouseEvent & ) SAL_OVERRIDE; +virtual bool MouseButtonUp( const MouseEvent & ) SAL_OVERRIDE; virtual bool MouseMove( const MouseEvent & rEvt ) SAL_OVERRIDE; }; diff --git a/svx/source/stbctrls/zoomsliderctrl.cxx b/svx/source/stbctrls/zoomsliderctrl.cxx index 8ea241b..1379321 100644 --- a/svx/source/stbctrls/zoomsliderctrl.cxx +++ b/svx/source/stbctrls/zoomsliderctrl.cxx @@ -45,6 +45,7 @@ struct SvxZoomSliderControl::SvxZoomSliderControl_Impl ImagemaDecreaseButton; bool mbValuesSet; bool mbOmitPaint; +bool mbDraggingStarted; SvxZoomSliderControl_Impl() : mnCurrentZoom( 0 ), @@ -57,7 +58,8 @@ struct SvxZoomSliderControl::SvxZoomSliderControl_Impl maIncreaseButton(), maDecreaseButton(), mbValuesSet( false ), -mbOmitPaint( false ) {} +mbOmitPaint( false ), +mbDraggingStarted( false ) {} }; const long nSliderXOffset = 20; @@ -330,7 +332,10 @@ bool SvxZoomSliderControl::MouseButtonDown( const MouseEvent & rEvt ) mpImpl->mnCurrentZoom = basegfx::zoomtools::zoomIn( static_cast(mpImpl->mnCurrentZoom) ); // click to slider else if( nXDiff >= nSliderXOffset && nXDiff <= aControlRect.GetWidth() - nSliderXOffset ) +{ mpImpl->mnCurrentZoom = Offset2Zoom( nXDiff ); +mpImpl->mbDraggingStarted = true; +} if ( mpImpl->mnCurrentZoom < mpImpl->mnMinZoom ) mpImpl->mnCurrentZoom = mpImpl->mnMinZoom; @@ -345,6 +350,12 @@ bool SvxZoomSliderControl::MouseButtonDown( const MouseEvent & rEvt ) return true; } +bool SvxZoomSliderControl::MouseButtonUp( const MouseEvent & ) +{ +mpImpl->mbDraggingStarted = false; +return true; +} + bool SvxZoomSliderControl::MouseMove( const MouseEvent & rEvt ) { if ( !mpImpl->mbValuesSet ) @@ -356,7 +367,7 @@ bool SvxZoomSliderControl::MouseMove( const MouseEvent & rEvt ) const sal_Int32 nXDiff = aPoint.X() - aControlRect.Left(); // check mouse move with button pressed -if ( 1 == nButtons ) +if ( 1 == nButtons && mpImpl->mbDraggingStarted ) { if ( nXDiff >= nSliderXOffset && nXDiff <= aControlRect.GetWidth() - nSliderXOffset ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - include/svx svx/source
include/svx/dialogs.hrc|4 svx/source/tbxctrls/PaletteManager.cxx | 11 --- svx/source/tbxctrls/tbcontrl.src | 17 - 3 files changed, 24 insertions(+), 8 deletions(-) New commits: commit 6ad09bbfcdbb1e184bfbafcfc9bbe5af73ef1ae4 Author: Andras Timar Date: Sat Nov 22 19:49:14 2014 +0100 fdo#86517 make predefined palette names localizable Change-Id: I3930757c02f9f976fb52cd75c9edab7cf75078c6 (cherry picked from commit 08d876b6b0b52d882350aa64eda784da56856166) diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc index 495cae8..519de01 100644 --- a/include/svx/dialogs.hrc +++ b/include/svx/dialogs.hrc @@ -253,6 +253,10 @@ #define RID_SVXSTR_MORENUMBERING(RID_SVX_START + 204) #define RID_SVXSTR_MOREBULLETS (RID_SVX_START + 205) +#define RID_SVXSTR_DEFAULT_PAL (RID_SVX_START + 206) +#define RID_SVXSTR_DOC_COLORS (RID_SVX_START + 207) +#define RID_SVXSTR_DOC_COLOR_PREFIX (RID_SVX_START + 208) + // Strings for insert/overwrite mode #define RID_SVXSTR_INSERT_HELPTEXT (RID_SVX_START + 210) #define RID_SVXSTR_OVERWRITE_HELPTEXT (RID_SVX_START + 211) diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx index b6d3cb7..33f346e 100644 --- a/svx/source/tbxctrls/PaletteManager.cxx +++ b/svx/source/tbxctrls/PaletteManager.cxx @@ -23,14 +23,11 @@ #include #include #include +#include #include #include #include -#define STR_DEFAULT_PAL "Default palette" -#define STR_DOC_COLORS "Document colors" -#define STR_DOC_COLOR_PREFIX"Document Color " - PaletteManager::PaletteManager() : mnMaxRecentColors(Application::GetSettings().GetStyleSettings().GetColorValueSetColumnCount()), mnNumOfPalettes(2), @@ -110,7 +107,7 @@ void PaletteManager::ReloadColorSet(SvxColorValueSet &rColorSet) std::vector aColors = pDocSh->GetDocColors(); mnColorCount = aColors.size(); rColorSet.Clear(); -rColorSet.addEntriesForColorVector(aColors, STR_DOC_COLOR_PREFIX ); +rColorSet.addEntriesForColorVector(aColors, SVX_RESSTR( RID_SVXSTR_DOC_COLOR_PREFIX ) + " " ); } else { @@ -135,7 +132,7 @@ std::vector PaletteManager::GetPaletteList() { std::vector aPaletteNames; -aPaletteNames.push_back( STR_DEFAULT_PAL ); +aPaletteNames.push_back( SVX_RESSTR( RID_SVXSTR_DEFAULT_PAL ) ); for( boost::ptr_vector::iterator it = maPalettes.begin(); it != maPalettes.end(); @@ -144,7 +141,7 @@ std::vector PaletteManager::GetPaletteList() aPaletteNames.push_back( (*it).GetName() ); } -aPaletteNames.push_back( STR_DOC_COLORS ); +aPaletteNames.push_back( SVX_RESSTR ( RID_SVXSTR_DOC_COLORS ) ); return aPaletteNames; } diff --git a/svx/source/tbxctrls/tbcontrl.src b/svx/source/tbxctrls/tbcontrl.src index 0e250c3..6e0add7 100644 --- a/svx/source/tbxctrls/tbcontrl.src +++ b/svx/source/tbxctrls/tbcontrl.src @@ -21,7 +21,7 @@ #include /* - * Bitmaps f"ur SvxFrameWindow + * Bitmaps for SvxFrameWindow */ #define MASKCOLOR MaskColor = Color { Red = 0x ; Green = 0x ; Blue = 0x ; }; @@ -207,4 +207,19 @@ String RID_SVXSTR_CHARFONTNAME_NOTAVAILABLE Text [ en-US ] = "Font Name. The current font is not available and will be substituted."; }; +String RID_SVXSTR_DEFAULT_PAL +{ +Text [ en-US ] = "Default palette"; +}; + +String RID_SVXSTR_DOC_COLORS +{ +Text [ en-US ] = "Document colors"; +}; + +String RID_SVXSTR_DOC_COLOR_PREFIX +{ +Text [ en-US ] = "Document Color"; +}; + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - include/svx svx/source
include/svx/sdmetitm.hxx |2 +- svx/source/svdraw/svdfmtf.cxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit eef61f54285c718ea78da631ebdd2d806d153fea Author: Stephan Bergmann Date: Fri Nov 21 11:05:46 2014 +0100 More fixes after SdrMetricItem changes ...like e0c2ea6bde31bd68e1794154b72fddcd40dda7f9 "Consistency around SdrMetricItem in svx/sderitm.hxx," similar to recent c3a9a9542b018f781ee12e6c8c943d4f19641afe "that's not right anyway, using the Distance as a which-id." Should all be found and fixed now with the removal of the unnecessary but harmful default value from the two-argument SdrMetricItem ctor. Change-Id: I6eaeb6633c9a350b18e02d476d2c8794a733cea8 (cherry picked from commit 226e0abd2c5ebd9fd591966b584d04e4ab5cd171) diff --git a/include/svx/sdmetitm.hxx b/include/svx/sdmetitm.hxx index ece56a6..0e2766f 100644 --- a/include/svx/sdmetitm.hxx +++ b/include/svx/sdmetitm.hxx @@ -32,7 +32,7 @@ class SVX_DLLPUBLIC SdrMetricItem: public SfxInt32Item { public: TYPEINFO_OVERRIDE(); SdrMetricItem(): SfxInt32Item() {} -SdrMetricItem(sal_uInt16 nId, sal_Int32 nVal=0): SfxInt32Item(nId,nVal) {} +SdrMetricItem(sal_uInt16 nId, sal_Int32 nVal): SfxInt32Item(nId,nVal) {} SdrMetricItem(sal_uInt16 nId, SvStream& rIn): SfxInt32Item(nId,rIn) {} virtual SfxPoolItem* Clone(SfxItemPool* pPool=NULL) const SAL_OVERRIDE; virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const SAL_OVERRIDE; diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index a457b22..12c19db 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -735,7 +735,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaRoundRectAction& rAct) long nRad=(rAct.GetHorzRound()+rAct.GetVertRound())/2; if (nRad!=0) { SfxItemSet aSet(*mpLineAttr->GetPool(), SDRATTR_ECKENRADIUS, SDRATTR_ECKENRADIUS, 0, 0); -aSet.Put(SdrMetricItem(nRad)); +aSet.Put(SdrMetricItem(SDRATTR_ECKENRADIUS, nRad)); pRect->SetMergedItemSet(aSet); } InsertObj(pRect); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits