include/svx/svdxcgv.hxx | 1 include/vcl/layout.hxx | 11 + starmath/UIConfig_smath.mk | 1 starmath/inc/starmath.hrc | 1 starmath/source/dialog.cxx | 39 ++---- starmath/source/smres.src | 7 - starmath/uiconfig/smath/ui/savedefaultsdialog.ui | 34 +++++ svx/source/svdraw/svdxcgv.cxx | 146 ++++++++++++++--------- sw/source/core/doc/doctxm.cxx | 2 vcl/source/window/layout.cxx | 43 +++++- 10 files changed, 189 insertions(+), 96 deletions(-)
New commits: commit 680f375476a2dc51e496bfbfbdaea4163a2f58b2 Author: Caolán McNamara <caol...@redhat.com> Date: Wed May 29 17:16:06 2013 +0100 valgrind: fix leak Change-Id: I3c8fdc00c3d4c6adaf6f1f790ed0549676e76772 diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 4ed21ab..d56cf61 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -708,6 +708,8 @@ SwTOXBaseSection::SwTOXBaseSection(SwTOXBase const& rBase, SwSectionFmt & rFmt) SwTOXBaseSection::~SwTOXBaseSection() { + for (SwTOXSortTabBases::const_iterator it = aSortArr.begin(); it != aSortArr.end(); ++it) + delete *it; } bool SwTOXBaseSection::SetPosAtStartEnd( SwPosition& rPos, bool bAtStart ) const commit 1d53996334db8850ff7a1bbfa8fa22b230b1c40e Author: Caolán McNamara <caol...@redhat.com> Date: Wed May 29 16:13:49 2013 +0100 convert save defaults to .ui format Change-Id: I7843598761cf95b04d9c3741cd8b0612b9b059ce diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx index 2b8fa8a..ede844e 100644 --- a/include/vcl/layout.hxx +++ b/include/vcl/layout.hxx @@ -657,10 +657,19 @@ enum VclButtonsType VCL_BUTTONS_OK_CANCEL }; +enum VclMessageType +{ + VCL_MESSAGE_INFO, + VCL_MESSAGE_WARNING, + VCL_MESSAGE_QUESTION, + VCL_MESSAGE_ERROR +}; + class VCL_DLLPUBLIC MessageDialog : public Dialog { private: - VclButtonsType m_eType; + VclButtonsType m_eButtonsType; + VclMessageType m_eMessageType; VclGrid* m_pGrid; FixedImage* m_pImage; VclMultiLineEdit* m_pPrimaryMessage; diff --git a/starmath/UIConfig_smath.mk b/starmath/UIConfig_smath.mk index d72ae83..d64abe8 100644 --- a/starmath/UIConfig_smath.mk +++ b/starmath/UIConfig_smath.mk @@ -27,6 +27,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/smath,\ starmath/uiconfig/smath/ui/alignmentdialog \ starmath/uiconfig/smath/ui/catalogdialog \ starmath/uiconfig/smath/ui/printeroptions \ + starmath/uiconfig/smath/ui/savedefaultsdialog \ starmath/uiconfig/smath/ui/spacingdialog \ )) diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc index 7cb9f4f..f233fa4 100644 --- a/starmath/inc/starmath.hrc +++ b/starmath/inc/starmath.hrc @@ -90,7 +90,6 @@ #define RID_MATH_TOOLBOX (RID_APP_START + 50) -#define RID_DEFAULTSAVEQUERY (RID_APP_START + 102) #define RID_NOMATHTYPEFACEWARNING (RID_APP_START + 204) #define RID_OBJECTNAME (RID_APP_START + 501) // free diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 149cf10..86e2340 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -24,6 +24,7 @@ #include <svl/stritem.hxx> #include <sfx2/app.hxx> #include <vcl/builder.hxx> +#include <vcl/layout.hxx> #include <vcl/msgbox.hxx> #include <svtools/ctrltool.hxx> #include <sfx2/printer.hxx> @@ -421,22 +422,25 @@ void SmFontDialog::DataChanged( const DataChangedEvent& rDCEvt ) ModalDialog::DataChanged( rDCEvt ); } -/**************************************************************************/ - +class SaveDefaultsQuery : public MessageDialog +{ +public: + SaveDefaultsQuery(Window *pParent) + : MessageDialog(pParent, "SaveDefaultsDialog", + "modules/smath/ui/savedefaultsdialog.ui") + { + } +}; IMPL_LINK( SmFontSizeDialog, DefaultButtonClickHdl, Button *, EMPTYARG /*pButton*/ ) { - QueryBox *pQueryBox = new QueryBox(this, SmResId(RID_DEFAULTSAVEQUERY)); - - if (pQueryBox->Execute() == RET_YES) + if (SaveDefaultsQuery(this).Execute() == RET_YES) { SmModule *pp = SM_MOD(); SmFormat aFmt( pp->GetConfig()->GetStandardFormat() ); WriteTo( aFmt ); pp->GetConfig()->SetStandardFormat( aFmt ); } - - delete pQueryBox; return 0; } @@ -546,16 +550,13 @@ IMPL_LINK( SmFontTypeDialog, MenuSelectHdl, Menu *, pMenu ) IMPL_LINK_INLINE_START( SmFontTypeDialog, DefaultButtonClickHdl, Button *, EMPTYARG /*pButton*/ ) { - QueryBox *pQueryBox = new QueryBox(this, SmResId(RID_DEFAULTSAVEQUERY)); - if (pQueryBox->Execute() == RET_YES) + if (SaveDefaultsQuery(this).Execute() == RET_YES) { SmModule *pp = SM_MOD(); SmFormat aFmt( pp->GetConfig()->GetStandardFormat() ); WriteTo( aFmt ); pp->GetConfig()->SetStandardFormat( aFmt, true ); } - - delete pQueryBox; return 0; } IMPL_LINK_INLINE_END( SmFontTypeDialog, DefaultButtonClickHdl, Button *, pButton ) @@ -755,16 +756,13 @@ IMPL_LINK( SmDistanceDialog, MenuSelectHdl, Menu *, pMenu ) IMPL_LINK( SmDistanceDialog, DefaultButtonClickHdl, Button *, EMPTYARG /*pButton*/ ) { - QueryBox *pQueryBox = new QueryBox(this, SmResId(RID_DEFAULTSAVEQUERY)); - - if (pQueryBox->Execute() == RET_YES) + if (SaveDefaultsQuery(this).Execute() == RET_YES) { SmModule *pp = SM_MOD(); SmFormat aFmt( pp->GetConfig()->GetStandardFormat() ); WriteTo( aFmt ); pp->GetConfig()->SetStandardFormat( aFmt ); } - delete pQueryBox; return 0; } @@ -1044,27 +1042,18 @@ void SmDistanceDialog::WriteTo(SmFormat &rFormat) /*const*/ rFormat.RequestApplyChanges(); } - -/**************************************************************************/ - - IMPL_LINK( SmAlignDialog, DefaultButtonClickHdl, Button *, EMPTYARG /*pButton*/ ) { - QueryBox *pQueryBox = new QueryBox(this, SmResId(RID_DEFAULTSAVEQUERY)); - - if (pQueryBox->Execute() == RET_YES) + if (SaveDefaultsQuery(this).Execute() == RET_YES) { SmModule *pp = SM_MOD(); SmFormat aFmt( pp->GetConfig()->GetStandardFormat() ); WriteTo( aFmt ); pp->GetConfig()->SetStandardFormat( aFmt ); } - - delete pQueryBox; return 0; } - SmAlignDialog::SmAlignDialog(Window * pParent) : ModalDialog(pParent, "AlignmentDialog", "modules/smath/ui/alignmentdialog.ui") diff --git a/starmath/source/smres.src b/starmath/source/smres.src index 805b290..f5c36b4 100644 --- a/starmath/source/smres.src +++ b/starmath/source/smres.src @@ -793,13 +793,6 @@ WarningBox RID_NOMATHTYPEFACEWARNING Message [ en-US ] = "The 'StarMath' font has not been installed.\nWithout this font %PRODUCTNAME Math cannot function correctly.\nPlease install this font and restart %PRODUCTNAME Math." ; }; -QueryBox RID_DEFAULTSAVEQUERY -{ - Buttons = WB_YES_NO ; - DefButton = WB_DEF_YES ; - Message [ en-US ] = "Should the changes be saved as defaults?\n\nThese changes will apply for all new formulas." ; -}; - String RID_FONTREGULAR { Text [ en-US ] = "Standard" ; diff --git a/starmath/uiconfig/smath/ui/savedefaultsdialog.ui b/starmath/uiconfig/smath/ui/savedefaultsdialog.ui new file mode 100644 index 0000000..bcf7108 --- /dev/null +++ b/starmath/uiconfig/smath/ui/savedefaultsdialog.ui @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkMessageDialog" id="SaveDefaultsDialog"> + <property name="can_focus">False</property> + <property name="border_width">12</property> + <property name="title" translatable="yes">Save defaults</property> + <property name="type_hint">dialog</property> + <property name="skip_taskbar_hint">True</property> + <property name="message_type">question</property> + <property name="buttons">yes-no</property> + <property name="text" translatable="yes">Should the changes be saved as defaults?</property> + <property name="secondary_text" translatable="yes">These changes will apply for all new formulas.</property> + <child internal-child="vbox"> + <object class="GtkBox" id="messagedialog-vbox"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">24</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="messagedialog-action_area"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + </object> + </child> + </object> +</interface> diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index a476099..dfd1098 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -1672,7 +1672,8 @@ bool VclSizeGroup::set_property(const OString &rKey, const OString &rValue) MessageDialog::MessageDialog(Window* pParent, WinBits nStyle) : Dialog(pParent, nStyle) - , m_eType(VCL_BUTTONS_NONE) + , m_eButtonsType(VCL_BUTTONS_NONE) + , m_eMessageType(VCL_MESSAGE_INFO) , m_pGrid(NULL) , m_pImage(NULL) , m_pPrimaryMessage(NULL) @@ -1683,7 +1684,8 @@ MessageDialog::MessageDialog(Window* pParent, WinBits nStyle) MessageDialog::MessageDialog(Window* pParent, const OString& rID, const OUString& rUIXMLDescription) : Dialog(pParent, rID, rUIXMLDescription, WINDOW_MESSBOX) - , m_eType(VCL_BUTTONS_NONE) + , m_eButtonsType(VCL_BUTTONS_NONE) + , m_eMessageType(VCL_MESSAGE_INFO) , m_pGrid(NULL) , m_pImage(NULL) , m_pPrimaryMessage(NULL) @@ -1767,7 +1769,21 @@ short MessageDialog::Execute() m_pGrid->set_column_spacing(12); m_pImage = new FixedImage(m_pGrid, WB_CENTER | WB_VCENTER | WB_3DLOOK); - m_pImage->SetImage(WarningBox::GetStandardImage()); + switch (m_eMessageType) + { + case VCL_MESSAGE_INFO: + m_pImage->SetImage(InfoBox::GetStandardImage()); + break; + case VCL_MESSAGE_WARNING: + m_pImage->SetImage(WarningBox::GetStandardImage()); + break; + case VCL_MESSAGE_QUESTION: + m_pImage->SetImage(QueryBox::GetStandardImage()); + break; + case VCL_MESSAGE_ERROR: + m_pImage->SetImage(ErrorBox::GetStandardImage()); + break; + } m_pImage->set_grid_left_attach(0); m_pImage->set_grid_top_attach(0); m_pImage->set_valign(VCL_ALIGN_START); @@ -1800,7 +1816,7 @@ short MessageDialog::Execute() VclButtonBox *pButtonBox = get_action_area(); assert(pButtonBox); PushButton *pBtn; - switch (m_eType) + switch (m_eButtonsType) { case VCL_BUTTONS_NONE: break; @@ -1874,6 +1890,23 @@ bool MessageDialog::set_property(const OString &rKey, const OString &rValue) set_primary_text(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); else if (rKey == "secondary-text") set_secondary_text(OStringToOUString(rValue, RTL_TEXTENCODING_UTF8)); + else if (rKey == "message-type") + { + VclMessageType eMode = VCL_MESSAGE_INFO; + if (rValue.equals("info")) + eMode = VCL_MESSAGE_INFO; + else if (rValue.equals("warning")) + eMode = VCL_MESSAGE_WARNING; + else if (rValue.equals("question")) + eMode = VCL_MESSAGE_QUESTION; + else if (rValue.equals("error")) + eMode = VCL_MESSAGE_ERROR; + else + { + SAL_WARN("vcl.layout", "unknown message type mode" << rValue.getStr()); + } + m_eMessageType = eMode; + } else if (rKey == "buttons") { VclButtonsType eMode = VCL_BUTTONS_NONE; @@ -1893,7 +1926,7 @@ bool MessageDialog::set_property(const OString &rKey, const OString &rValue) { SAL_WARN("vcl.layout", "unknown buttons type mode" << rValue.getStr()); } - m_eType = eMode; + m_eButtonsType = eMode; } else return Dialog::set_property(rKey, rValue); commit ddca040048b6b26bd348e9c4a8a3528ad1613814 Author: Armin Le Grand <a...@apache.org> Date: Fri Jan 11 15:16:47 2013 +0000 Resolves: #i121609# Made conversion to bitmap more direct (cherry picked from commit 5fdbac8ba880a1158e11f0b42059c09510a3ddac) Conflicts: svx/inc/svx/svdxcgv.hxx svx/source/svdraw/svdxcgv.cxx Change-Id: I654f82546656aa1789a3838c1373564bc28eaf31 diff --git a/include/svx/svdxcgv.hxx b/include/svx/svdxcgv.hxx index 1d7a161..89dde5e 100644 --- a/include/svx/svdxcgv.hxx +++ b/include/svx/svdxcgv.hxx @@ -58,6 +58,7 @@ protected: public: // Alle markierten Objekte auf dem angegebenen OutputDevice ausgeben. + ::std::vector< SdrObject* > GetMarkedObjects() const; virtual void DrawMarkedObj(OutputDevice& rOut) const; // Z.B. fuer's Clipboard, Drag&Drop, ... diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index 4d0ee93..f750448 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -48,6 +48,12 @@ #include <svl/style.hxx> #include <fmobj.hxx> #include <vcl/svgdata.hxx> +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> +#include <drawinglayer/primitive2d/groupprimitive2d.hxx> +#include <drawinglayer/geometry/viewinformation2d.hxx> +#include <svx/sdr/contact/viewcontact.hxx> +#include <svx/sdr/contact/objectcontactofobjlistpainter.hxx> +#include <svx/sdr/contact/displayinfo.hxx> //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -469,14 +475,42 @@ BitmapEx SdrExchangeView::GetMarkedObjBitmapEx(bool bNoVDevIfOneBmpMarked) const if( !aBmp ) { - const GDIMetaFile aGDIMetaFile(GetMarkedObjMetaFile(bNoVDevIfOneBmpMarked)); - const Rectangle aBound(GetMarkedObjBoundRect()); - - aBmp = convertMetafileToBitmapEx( - aGDIMetaFile, - basegfx::B2DRange( - aBound.Left(), aBound.Top(), - aBound.Right(), aBound.Bottom())); + // choose conversion directly using primitives to bitmap to avoid + // rendering errors with tiled bitmap fills (these will be tiled in a + // in-between metafile, but tend to show 'gaps' since the target is *no* + // bitmap rendering) + ::std::vector< SdrObject* > aSdrObjects(GetMarkedObjects()); + const sal_uInt32 nCount(aSdrObjects.size()); + + if(nCount) + { + // collect sub-primitives as group objects, thus no expensive append + // to existing sequence is needed + drawinglayer::primitive2d::Primitive2DSequence xPrimitives(nCount); + + for(sal_uInt32 a(0); a < nCount; a++) + { + xPrimitives[a] = new drawinglayer::primitive2d::GroupPrimitive2D( + aSdrObjects[a]->GetViewContact().getViewIndependentPrimitive2DSequence()); + } + + // get logic range + const drawinglayer::geometry::ViewInformation2D aViewInformation2D; + const basegfx::B2DRange aRange( + drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence( + xPrimitives, + aViewInformation2D)); + + if(!aRange.isEmpty()) + { + // if we have geometry and it has a range, convert to BitmapEx using + // common tooling + aBmp = convertPrimitive2DSequenceToBitmapEx( + xPrimitives, + aRange, + 500000); + } + } } } @@ -632,9 +666,10 @@ Graphic SdrExchangeView::GetObjGraphic( const SdrModel* pModel, const SdrObject* // ----------------------------------------------------------------------------- -void SdrExchangeView::DrawMarkedObj(OutputDevice& rOut) const +::std::vector< SdrObject* > SdrExchangeView::GetMarkedObjects() const { SortMarkedObjects(); + ::std::vector< SdrObject* > aRetval; ::std::vector< ::std::vector< SdrMark* > > aObjVectors( 2 ); ::std::vector< SdrMark* >& rObjVector1 = aObjVectors[ 0 ]; @@ -661,9 +696,27 @@ void SdrExchangeView::DrawMarkedObj(OutputDevice& rOut) const for( sal_uInt32 i = 0; i < rObjVector.size(); i++ ) { SdrMark* pMark = rObjVector[ i ]; - pMark->GetMarkedSdrObj()->SingleObjectPainter( rOut ); + aRetval.push_back(pMark->GetMarkedSdrObj()); } } + + return aRetval; +} + +// ----------------------------------------------------------------------------- + +void SdrExchangeView::DrawMarkedObj(OutputDevice& rOut) const +{ + ::std::vector< SdrObject* > aSdrObjects(GetMarkedObjects()); + + if(aSdrObjects.size()) + { + sdr::contact::ObjectContactOfObjListPainter aPainter(rOut, aSdrObjects, aSdrObjects[0]->GetPage()); + sdr::contact::DisplayInfo aDisplayInfo; + + // do processing + aPainter.ProcessDisplay(aDisplayInfo); + } } // ----------------------------------------------------------------------------- @@ -679,64 +732,43 @@ SdrModel* SdrExchangeView::GetMarkedObjModel() const if( !mxSelectionController.is() || !mxSelectionController->GetMarkedObjModel( pNeuPag ) ) { - ::std::vector< ::std::vector< SdrMark* > > aObjVectors( 2 ); - ::std::vector< SdrMark* >& rObjVector1 = aObjVectors[ 0 ]; - ::std::vector< SdrMark* >& rObjVector2 = aObjVectors[ 1 ]; - const SdrLayerAdmin& rLayerAdmin = pMod->GetLayerAdmin(); - const sal_uInt32 nControlLayerId = rLayerAdmin.GetLayerID( rLayerAdmin.GetControlLayerName(), sal_False ); - sal_uInt32 n, nCount, nCloneErrCnt = 0; - - for( n = 0, nCount = GetMarkedObjectCount(); n < nCount; n++ ) - { - SdrMark* pMark = GetSdrMarkByIndex( n ); - - // paint objects on control layer on top of all otherobjects - if( nControlLayerId == pMark->GetMarkedSdrObj()->GetLayer() ) - rObjVector2.push_back( pMark ); - else - rObjVector1.push_back( pMark ); - } + ::std::vector< SdrObject* > aSdrObjects(GetMarkedObjects()); // #i13033# // New mechanism to re-create the connections of cloned connectors CloneList aCloneList; + sal_uInt32 nCloneErrCnt(0); - for( n = 0, nCount = aObjVectors.size(); n < nCount; n++ ) + for( sal_uInt32 i(0); i < aSdrObjects.size(); i++ ) { - ::std::vector< SdrMark* >& rObjVector = aObjVectors[ n ]; + const SdrObject* pObj = aSdrObjects[i]; + SdrObject* pNeuObj; - for( sal_uInt32 i = 0; i < rObjVector.size(); i++ ) + if( pObj->ISA( SdrPageObj ) ) { - const SdrMark* pMark = rObjVector[ i ]; - const SdrObject* pObj = pMark->GetMarkedSdrObj(); - SdrObject* pNeuObj; - - if( pObj->ISA( SdrPageObj ) ) - { - // convert SdrPageObj's to a graphic representation, because - // virtual connection to referenced page gets lost in new model - pNeuObj = new SdrGrafObj( GetObjGraphic( pMod, pObj ), pObj->GetLogicRect() ); - pNeuObj->SetPage( pNeuPag ); - pNeuObj->SetModel( pNeuMod ); - } - else - { - pNeuObj = pObj->Clone(); - pNeuObj->SetPage( pNeuPag ); - pNeuObj->SetModel( pNeuMod ); - } + // convert SdrPageObj's to a graphic representation, because + // virtual connection to referenced page gets lost in new model + pNeuObj = new SdrGrafObj( GetObjGraphic( pMod, pObj ), pObj->GetLogicRect() ); + pNeuObj->SetPage( pNeuPag ); + pNeuObj->SetModel( pNeuMod ); + } + else + { + pNeuObj = pObj->Clone(); + pNeuObj->SetPage( pNeuPag ); + pNeuObj->SetModel( pNeuMod ); + } - if( pNeuObj ) - { - SdrInsertReason aReason(SDRREASON_VIEWCALL); - pNeuPag->InsertObject(pNeuObj,CONTAINER_APPEND,&aReason); + if( pNeuObj ) + { + SdrInsertReason aReason(SDRREASON_VIEWCALL); + pNeuPag->InsertObject(pNeuObj,CONTAINER_APPEND,&aReason); - // #i13033# - aCloneList.AddPair(pObj, pNeuObj); - } - else - nCloneErrCnt++; + // #i13033# + aCloneList.AddPair(pObj, pNeuObj); } + else + nCloneErrCnt++; } // #i13033#
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits