[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - 2 commits - svx/source vcl/source

2014-03-12 Thread Norbert Thiebaud
 svx/source/tbxctrls/tbunocontroller.cxx |   22 +-
 vcl/source/window/window.cxx|   10 +-
 2 files changed, 26 insertions(+), 6 deletions(-)

New commits:
commit ce5c798868e33c094971d8b8c2c9f40afc8f21c3
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Tue Mar 11 15:42:49 2014 -0500

force DPIScaleFactor to 1 on Mac

Conflicts:
vcl/source/window/window.cxx

Change-Id: I37629e1ef18f9843fcbdd643d8aaee0b3c8baa73
Reviewed-on: https://gerrit.libreoffice.org/8560
Tested-by: Norbert Thiebaud nthieb...@gmail.com
Reviewed-by: Norbert Thiebaud nthieb...@gmail.com

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index f1cab66..f477b5c 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -983,7 +983,11 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, 
SystemParentData* pSyste
 }
 
 // setup the scale factor for Hi-DPI displays
+#ifdef MACOSX
+mnDPIScaleFactor = 1;
+#else
 mnDPIScaleFactor = std::max((sal_Int32)1, 
(mpWindowImpl-mpFrameData-mnDPIY + 48) / 96);
+#endif
 
 const StyleSettings rStyleSettings = maSettings.GetStyleSettings();
 sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom();
@@ -1723,7 +1727,11 @@ void Window::ImplInitResolutionSettings()
 mnDPIY = (mpWindowImpl-mpFrameData-mnDPIY*nScreenZoom)/100;
 
 // setup the scale factor for Hi-DPI displays
-mnDPIScaleFactor = std::max(1, (mpWindowImpl-mpFrameData-mnDPIY + 
48) / 96);
+#ifdef MACOSX
+mnDPIScaleFactor = 1;
+#else
+mnDPIScaleFactor = std::max((sal_Int32)1, 
(mpWindowImpl-mpFrameData-mnDPIY + 48) / 96);
+#endif
 
 SetPointFont( rStyleSettings.GetAppFont() );
 }
commit a644b400d611bfa086e0cdb6b0a41228809ffd3d
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Jan 28 16:09:58 2014 +

Related: fdo#73051 make font size drop down of optimal width

presumably keithcu felt the font size was too wide, so lets
try and implement the desired effect of an optimal width.

Change-Id: Idc1741de04b3559fa415ebcf2289f96ba240ca8f
Reviewed-on: https://gerrit.libreoffice.org/8520
Reviewed-by: Norbert Thiebaud nthieb...@gmail.com
Tested-by: Norbert Thiebaud nthieb...@gmail.com

diff --git a/svx/source/tbxctrls/tbunocontroller.cxx 
b/svx/source/tbxctrls/tbunocontroller.cxx
index c343844..ad99d66 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -53,6 +53,7 @@ public:
 
 voidstatusChanged_Impl( long nHeight, bool bErase = false 
);
 voidUpdateFont( const 
::com::sun::star::awt::FontDescriptor rCurrentFont );
+voidSetOptimalSize();
 
 virtual longNotify( NotifyEvent rNEvt );
 
@@ -85,12 +86,11 @@ SvxFontSizeBox_Impl::SvxFontSizeBox_Impl(
 FontSizeBox( _pParent, WinBits( WB_DROPDOWN ) ),
 
 m_pCtrl ( _rCtrl ),
-m_aLogicalSize  ( 20,100 ),
+m_aLogicalSize  ( 0,100 ),
 m_bRelease  ( true ),
 m_xDispatchProvider ( _rDispatchProvider ),
 m_xFrame( _xFrame )
 {
-SetSizePixel( LogicToPixel( m_aLogicalSize, MAP_APPFONT ));
 SetValue( 0 );
 SetText(  );
 }
@@ -221,6 +221,16 @@ long SvxFontSizeBox_Impl::Notify( NotifyEvent rNEvt )
 return nHandled ? nHandled : FontSizeBox::Notify( rNEvt );
 }
 
+void SvxFontSizeBox_Impl::SetOptimalSize()
+{
+Size aPrefSize(LogicToPixel(m_aLogicalSize, MAP_APPFONT));
+aPrefSize.Width() = get_preferred_size().Width();
+SetSizePixel(aPrefSize);
+Size aDropSize(LogicToPixel(Size(0, LOGICAL_EDIT_HEIGHT), MAP_APPFONT));
+aDropSize.Width() = aPrefSize.Width();
+SetDropDownSizePixel(aDropSize);
+}
+
 // ---
 
 void SvxFontSizeBox_Impl::DataChanged( const DataChangedEvent rDCEvt )
@@ -228,9 +238,7 @@ void SvxFontSizeBox_Impl::DataChanged( const 
DataChangedEvent rDCEvt )
 if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) 
  (rDCEvt.GetFlags()  SETTINGS_STYLE) )
 {
-SetSizePixel( LogicToPixel( m_aLogicalSize, MAP_APPFONT ));
-Size aDropSize( m_aLogicalSize.Width(), LOGICAL_EDIT_HEIGHT );
-SetDropDownSizePixel( LogicToPixel( aDropSize, MAP_APPFONT ));
+SetOptimalSize();
 }
 
 FontSizeBox::DataChanged( rDCEvt );
@@ -380,6 +388,10 @@ uno::Reference awt::XWindow  SAL_CALL 
FontHeightToolBoxControl::createItemWind
 uno::Reference frame::XDispatchProvider ( m_xFrame, 
uno::UNO_QUERY ),
 m_xFrame,
 *this );
+//Get the box to fill itself with all its sizes
+m_pBox-UpdateFont(m_aCurrentFont);
+//Make it size itself to its optimal size re above sizes
+m_pBox-SetOptimalSize();
 xItemWindow = VCLUnoHelper::GetInterface( m_pBox );
 }
 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - 2 commits - svx/source sw/source sw/uiconfig sw/UIConfig_swriter.mk

2013-12-17 Thread Caolán McNamara
 svx/source/gallery2/galmisc.cxx |   20 ++-
 sw/UIConfig_swriter.mk  |1 
 sw/source/ui/config/optload.cxx |   11 +---
 sw/source/ui/inc/optload.hxx|5 -
 sw/uiconfig/swriter/ui/captiondialog.ui |   81 
 5 files changed, 104 insertions(+), 14 deletions(-)

New commits:
commit 21bfcac22b53b163e1912d8b13fe4d4a4202f445
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Dec 17 10:21:49 2013 +

fix caption dialog

Change-Id: I499f47b116ff6957bbbc20b91224fe95593d1da1
(cherry picked from commit 2e4360815b08e1b5bd7233509d033b5a49b7c61e)

diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 5b3a755..928f46b 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -74,6 +74,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/bulletsandnumbering \
sw/uiconfig/swriter/ui/businessdatapage \
sw/uiconfig/swriter/ui/cannotsavelabeldialog \
+   sw/uiconfig/swriter/ui/captiondialog \
sw/uiconfig/swriter/ui/captionoptions \
sw/uiconfig/swriter/ui/cardformatpage \
sw/uiconfig/swriter/ui/cardmediumpage \
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 62be5df..4a6d5b2 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -312,15 +312,12 @@ IMPL_LINK_NOARG(SwLoadOptPage, MetricHdl)
 return 0;
 }
 
-SwCaptionOptDlg::SwCaptionOptDlg(Window* pParent, const SfxItemSet rSet) :
-SfxNoLayoutSingleTabDialog(pParent, rSet, 0)
+SwCaptionOptDlg::SwCaptionOptDlg(Window* pParent, const SfxItemSet rSet)
+: SfxSingleTabDialog(pParent, rSet, CaptionDialog,
+modules/swriter/ui/captiondialog.ui)
 {
 // create TabPage
-SetTabPage((SwCaptionOptPage*) SwCaptionOptPage::Create(this, rSet));
-}
-
-SwCaptionOptDlg::~SwCaptionOptDlg()
-{
+setTabPage(SwCaptionOptPage::Create(get_content_area(), rSet));
 }
 
 SwCaptionPreview::SwCaptionPreview( Window* pParent, WinBits nStyle )
diff --git a/sw/source/ui/inc/optload.hxx b/sw/source/ui/inc/optload.hxx
index 7825ab5..0ee5023 100644
--- a/sw/source/ui/inc/optload.hxx
+++ b/sw/source/ui/inc/optload.hxx
@@ -69,11 +69,10 @@ public:
 virtual voidReset( const SfxItemSet rSet );
 };
 
-class SwCaptionOptDlg : public SfxNoLayoutSingleTabDialog
+class SwCaptionOptDlg : public SfxSingleTabDialog
 {
 public:
- SwCaptionOptDlg(Window* pParent, const SfxItemSet rSet);
-~SwCaptionOptDlg();
+SwCaptionOptDlg(Window* pParent, const SfxItemSet rSet);
 };
 
 class CaptionComboBox : public SwComboBox
diff --git a/sw/uiconfig/swriter/ui/captiondialog.ui 
b/sw/uiconfig/swriter/ui/captiondialog.ui
new file mode 100644
index 000..0b6e2d2
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/captiondialog.ui
@@ -0,0 +1,81 @@
+?xml version=1.0 encoding=UTF-8?
+interface
+  !-- interface-requires gtk+ 3.0 --
+  object class=GtkDialog id=CaptionDialog
+property name=can_focusFalse/property
+property name=border_width6/property
+property name=title translatable=yesCaption/property
+property name=type_hintdialog/property
+child internal-child=vbox
+  object class=GtkBox id=dialog-vbox1
+property name=can_focusFalse/property
+property name=orientationvertical/property
+property name=spacing12/property
+child internal-child=action_area
+  object class=GtkButtonBox id=dialog-action_area1
+property name=can_focusFalse/property
+property name=layout_styleend/property
+child
+  object class=GtkButton id=ok
+property name=labelgtk-ok/property
+property name=visibleTrue/property
+property name=can_focusTrue/property
+property name=can_defaultTrue/property
+property name=has_defaultTrue/property
+property name=receives_defaultTrue/property
+property name=use_stockTrue/property
+  /object
+  packing
+property name=expandFalse/property
+property name=fillTrue/property
+property name=position0/property
+  /packing
+/child
+child
+  object class=GtkButton id=cancel
+property name=labelgtk-cancel/property
+property name=visibleTrue/property
+property name=can_focusTrue/property
+property name=receives_defaultTrue/property
+property name=use_stockTrue/property
+  /object
+  packing
+property name=expandFalse/property
+property name=fillTrue/property
+property name=position1/property
+  /packing
+/child
+child
+  object class=GtkButton id=help
+property 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - 2 commits - svx/source

2013-12-11 Thread Caolán McNamara
 svx/source/table/accessibletableshape.cxx |6 ++
 svx/source/table/svdotable.cxx|   20 +++-
 2 files changed, 25 insertions(+), 1 deletion(-)

New commits:
commit a90e08cb15e712e1d15a16de9a2677e57d81fd13
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Dec 11 11:57:34 2013 +

disposed but not dtored

just die when you are supposed to, without this endless amounts of 
accessiblity
cells remain after sorting slides with tables in them

(cherry picked from commit 1c28065d8fe3e9a1394a7ecfc29e95a9639a1012)

Conflicts:
svx/source/table/accessibletableshape.cxx

Change-Id: Ice9a86b8b806e58f9bf871341a38f7729798dda9

diff --git a/svx/source/table/accessibletableshape.cxx 
b/svx/source/table/accessibletableshape.cxx
index a5e910e..8872591 100644
--- a/svx/source/table/accessibletableshape.cxx
+++ b/svx/source/table/accessibletableshape.cxx
@@ -113,6 +113,12 @@ void AccessibleTableShapeImpl::dispose()
 {
 if( mxTable.is() )
 {
+//remove all the cell's acc object in table's dispose.
+for( AccessibleCellMap::iterator iter( maChildMap.begin() ); iter != 
maChildMap.end(); iter++ )
+{
+(*iter).second-dispose();
+}
+maChildMap.clear();
 Reference XModifyListener  xListener( this );
 mxTable-removeModifyListener( xListener );
 mxTable.clear();
commit 3d742188d402b294af9a06ba15bc16d19966bd6f
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Dec 10 16:54:59 2013 +

correctly dispose to avoid cyclic dependencies

accessibility cruft is still listening to dead tables so crashes in
slidesorting in main panel if moved slide has tables in it after visiting 
slide
sorter once.

Change-Id: I09f9a73b01fb2ddf059402146acdc7bd823798b9
(cherry picked from commit 0b8e2e5efe20519e8b5563314bac0cbb84a3b967)

diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 994076e..9c5e64a 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -266,9 +266,9 @@ void SdrTableObjImpl::init( SdrTableObj* pTable, sal_Int32 
nColumns, sal_Int32 n
 mpTableObj = pTable;
 mxTable = new TableModel( pTable );
 mxTable-init( nColumns, nRows );
-mpLayouter = new TableLayouter( mxTable );
 Reference XModifyListener  xListener( static_cast 
::com::sun::star::util::XModifyListener* (this) );
 mxTable-addModifyListener( xListener );
+mpLayouter = new TableLayouter( mxTable );
 LayoutTable( mpTableObj-aRect, true, true );
 mpTableObj-maLogicRect = mpTableObj-aRect;
 }
@@ -279,6 +279,8 @@ SdrTableObjImpl SdrTableObjImpl::operator=( const 
SdrTableObjImpl rSource )
 {
 if (this != rSource)
 {
+disconnectTableStyle();
+
 if( mpLayouter )
 {
 delete mpLayouter;
@@ -303,6 +305,8 @@ SdrTableObjImpl SdrTableObjImpl::operator=( const 
SdrTableObjImpl rSource )
 ApplyCellStyles();
 mpTableObj-aRect = mpTableObj-maLogicRect;
 LayoutTable( mpTableObj-aRect, false, false );
+
+connectTableStyle();
 }
 return *this;
 }
@@ -449,8 +453,22 @@ bool SdrTableObjImpl::ApplyCellStyles()
 
 void SdrTableObjImpl::dispose()
 {
+disconnectTableStyle();
+mxTableStyle.clear();
+
+if( mpLayouter )
+{
+delete mpLayouter;
+mpLayouter = 0;
+}
+
 if( mxTable.is() )
+{
+Reference XModifyListener  xListener( static_cast 
::com::sun::star::util::XModifyListener* (this) );
+mxTable-removeModifyListener( xListener );
 mxTable-dispose();
+mxTable.clear();
+}
 }
 
 // 
-
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits