[Libreoffice-commits] core.git: 7 commits - filter/source include/sfx2 include/svx include/vcl sc/source sd/source sfx2/source svx/inc svx/source svx/uiconfig svx/UIConfig_svx.mk sw/source vcl/source
Caolán McNamara
caolanm at redhat.com
Wed Sep 3 07:58:52 PDT 2014
filter/source/graphicfilter/ipict/ipict.cxx | 18 +++++----
include/sfx2/tbxctrl.hxx | 7 ++-
include/svx/dialogs.hrc | 7 +--
include/vcl/dialog.hxx | 2 -
include/vcl/floatwin.hxx | 2 -
include/vcl/syswin.hxx | 2 -
sc/source/ui/vba/vbaaxes.cxx | 10 +++++
sd/source/ui/func/fuscale.cxx | 6 +--
sfx2/source/toolbox/tbxitem.cxx | 16 +-------
svx/UIConfig_svx.mk | 1
svx/inc/helpid.hrc | 1
svx/source/tbxctrls/lboxctrl.cxx | 52 +++++++++-------------------
svx/source/tbxctrls/lboxctrl.hrc | 22 -----------
svx/source/tbxctrls/lboxctrl.src | 21 -----------
svx/uiconfig/ui/floatingundoredo.ui | 42 ++++++++++++++++++++++
sw/source/core/layout/flycnt.cxx | 2 -
sw/source/core/view/vprint.cxx | 4 +-
vcl/source/window/builder.cxx | 36 ++++++++++++-------
vcl/source/window/dialog.cxx | 7 ---
vcl/source/window/floatwin.cxx | 7 ---
vcl/source/window/syswin.cxx | 12 ++----
21 files changed, 129 insertions(+), 148 deletions(-)
New commits:
commit 77ce41f2571c3158f00e2b632ce006059282c462
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Sep 2 22:42:30 2014 +0100
convert RID_SVXTBX_UNDO_REDO_CTRL floating window to .ui
Change-Id: I88a5e0aec20170dfb71bf28cb35e860773657937
diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx
index 2c7d81a..99202ff 100644
--- a/include/sfx2/tbxctrl.hxx
+++ b/include/sfx2/tbxctrl.hxx
@@ -138,9 +138,10 @@ public:
SfxPopupWindow( sal_uInt16 nId,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
WinBits nBits );
- SfxPopupWindow( sal_uInt16 nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
- const ResId &rId );
+ SfxPopupWindow(sal_uInt16 nId,
+ const OString& rID, const OUString& rUIXMLDescription,
+ const css::uno::Reference<css::frame::XFrame> &rFrame =
+ css::uno::Reference<css::frame::XFrame>());
SfxPopupWindow( sal_uInt16 nId,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
Window* pParentWindow,
diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index 4303397..2a033e9 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -803,12 +803,11 @@
#define RID_SVXSTR_UNDO_GRAFTRANSPARENCY (RID_SVX_START + 828)
#define RID_SVXSTR_UNDO_GRAFCROP (RID_SVXSTR_GRAFCROP)
-// listbox control for UNDO and REDO
-#define RID_SVXTBX_UNDO_REDO_CTRL (RID_SVX_START + 845)
+// strings for UNDO and REDO
#define RID_SVXSTR_NUM_UNDO_ACTIONS (RID_SVX_START + 846)
#define RID_SVXSTR_NUM_REDO_ACTIONS (RID_SVX_START + 847)
-#define RID_SVXSTR_NUM_UNDO_ACTION (RID_SVX_START + 848)
-#define RID_SVXSTR_NUM_REDO_ACTION (RID_SVX_START + 849)
+#define RID_SVXSTR_NUM_UNDO_ACTION (RID_SVX_START + 848)
+#define RID_SVXSTR_NUM_REDO_ACTION (RID_SVX_START + 849)
// Default-transparence-gradient-names
#define RID_SVXSTR_TRASNGR0_DEF (RID_SVX_START + 850)
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index 14d303c..ff9f249 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -65,7 +65,7 @@ protected:
public:
SAL_DLLPRIVATE bool IsInClose() const { return mbInClose; }
- virtual void doDeferredInit(bool bResizable, bool bCloseable) SAL_OVERRIDE;
+ virtual void doDeferredInit(WinBits nBits) SAL_OVERRIDE;
protected:
explicit Dialog( WindowType nType );
diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx
index c768760..2d4981e 100644
--- a/include/vcl/floatwin.hxx
+++ b/include/vcl/floatwin.hxx
@@ -117,7 +117,7 @@ public:
SAL_DLLPRIVATE void ImplEndPopupMode( sal_uInt16 nFlags = 0, sal_uLong nFocusId = 0 );
SAL_DLLPRIVATE Rectangle& ImplGetItemEdgeClipRect();
SAL_DLLPRIVATE bool ImplIsInPrivatePopupMode() const { return mbInPopupMode; }
- virtual void doDeferredInit(bool bResizable, bool bCloseable) SAL_OVERRIDE;
+ virtual void doDeferredInit(WinBits nBits) SAL_OVERRIDE;
public:
explicit FloatingWindow(Window* pParent, WinBits nStyle = WB_STDFLOATWIN);
diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
index 93c5926..ce79e11 100644
--- a/include/vcl/syswin.hxx
+++ b/include/vcl/syswin.hxx
@@ -276,7 +276,7 @@ public:
SAL_DLLPRIVATE bool hasPendingLayout() const { return maLayoutTimer.IsActive(); }
- virtual void doDeferredInit(bool bResizable, bool bCloseable);
+ virtual void doDeferredInit(WinBits nBits);
};
#endif // INCLUDED_VCL_SYSWIN_HXX
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index 25781db3..090feb2 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -1125,8 +1125,6 @@ throw ( ::com::sun::star::uno::RuntimeException, std::exception )
}
}
-
-
SfxPopupWindow::SfxPopupWindow(
sal_uInt16 nId,
const Reference< XFrame >& rFrame,
@@ -1143,13 +1141,9 @@ SfxPopupWindow::SfxPopupWindow(
((SystemWindow *)pWindow)->GetTaskPaneList()->AddWindow( this );
}
-
-
-SfxPopupWindow::SfxPopupWindow(
- sal_uInt16 nId,
- const Reference< XFrame >& rFrame,
- const ResId &rId ) :
- FloatingWindow( SfxGetpApp()->GetTopWindow(), rId )
+SfxPopupWindow::SfxPopupWindow(sal_uInt16 nId, const OString& rID, const OUString& rUIXMLDescription,
+ const css::uno::Reference<css::frame::XFrame> &rFrame)
+ : FloatingWindow(SfxGetpApp()->GetTopWindow(), rID, rUIXMLDescription, rFrame)
, m_bFloating( false )
, m_bCascading( false )
, m_nId( nId )
@@ -1161,8 +1155,6 @@ SfxPopupWindow::SfxPopupWindow(
((SystemWindow *)pWindow)->GetTaskPaneList()->AddWindow( this );
}
-
-
SfxPopupWindow::SfxPopupWindow(
sal_uInt16 nId,
const Reference< XFrame >& rFrame,
@@ -1197,8 +1189,6 @@ SfxPopupWindow::SfxPopupWindow(
((SystemWindow *)pWindow)->GetTaskPaneList()->AddWindow( this );
}
-
-
SfxPopupWindow::~SfxPopupWindow()
{
if ( m_xStatusListener.is() )
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk
index 21ac190..b5db9b0 100644
--- a/svx/UIConfig_svx.mk
+++ b/svx/UIConfig_svx.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
svx/uiconfig/ui/docrecoverysavedialog \
svx/uiconfig/ui/extrustiondepthdialog \
svx/uiconfig/ui/findreplacedialog \
+ svx/uiconfig/ui/floatingundoredo \
svx/uiconfig/ui/fontworkgallerydialog \
svx/uiconfig/ui/fontworkspacingdialog \
svx/uiconfig/ui/formlinkwarndialog \
diff --git a/svx/inc/helpid.hrc b/svx/inc/helpid.hrc
index c697252..33fd0a6 100644
--- a/svx/inc/helpid.hrc
+++ b/svx/inc/helpid.hrc
@@ -112,7 +112,6 @@
#define HID_POPUP_LINEEND "SVX_HID_POPUP_LINEEND"
#define HID_POPUP_LINEEND_CTRL "SVX_HID_POPUP_LINEEND_CTRL"
#define HID_STYLE_LISTBOX "SVX_HID_STYLE_LISTBOX"
-#define HID_SVXTBX_UNDO_REDO_CTRL "SVX_HID_SVXTBX_UNDO_REDO_CTRL"
#define HID_SVX_MDLG_DOCRECOVERY_BROKEN "SVX_HID_SVX_MDLG_DOCRECOVERY_BROKEN"
#define HID_SVX_TP_DOCRECOVERY_RECOVER "SVX_HID_SVX_TP_DOCRECOVERY_RECOVER"
#define HID_VALUESET_EXTRUSION_DIRECTION "SVX_HID_VALUESET_EXTRUSION_DIRECTION"
diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx
index a6b2600..33340d5 100644
--- a/svx/source/tbxctrls/lboxctrl.cxx
+++ b/svx/source/tbxctrls/lboxctrl.cxx
@@ -44,33 +44,24 @@
#include <svx/svxids.hrc>
#include <svx/dialogs.hrc>
-#include "lboxctrl.hrc"
-
-
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::frame;
class SvxPopupWindowListBox;
-
-
class SvxPopupWindowListBox: public SfxPopupWindow
{
using FloatingWindow::StateChanged;
- ListBox * pListBox;
+ ListBox * m_pListBox;
ToolBox & rToolBox;
bool bUserSel;
sal_uInt16 nTbxId;
OUString maCommandURL;
- // disallow copy-constructor and assignment-operator
-
-// SvxPopupWindowListBox( sal_uInt16 nSlotId, ToolBox& rTbx, sal_uInt16 nTbxItemId );
public:
SvxPopupWindowListBox( sal_uInt16 nSlotId, const OUString& rCommandURL, sal_uInt16 nTbxId, ToolBox& rTbx );
- virtual ~SvxPopupWindowListBox();
// SfxPopupWindow
virtual SfxPopupWindow * Clone() const SAL_OVERRIDE;
@@ -78,43 +69,38 @@ public:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
- inline ListBox & GetListBox() { return *pListBox; }
+ inline ListBox & GetListBox() { return *m_pListBox; }
bool IsUserSelected() const { return bUserSel; }
void SetUserSelected( bool bVal ) { bUserSel = bVal; }
- /*virtual*/Window* GetPreferredKeyInputWindow() SAL_OVERRIDE;
+ virtual Window* GetPreferredKeyInputWindow() SAL_OVERRIDE;
};
-
-
-SvxPopupWindowListBox::SvxPopupWindowListBox( sal_uInt16 nSlotId, const OUString& rCommandURL, sal_uInt16 nId, ToolBox& rTbx ) :
- SfxPopupWindow( nSlotId, Reference< XFrame >(), SVX_RES( RID_SVXTBX_UNDO_REDO_CTRL ) ),
- rToolBox ( rTbx ),
- bUserSel ( false ),
- nTbxId ( nId ),
- maCommandURL( rCommandURL )
+SvxPopupWindowListBox::SvxPopupWindowListBox(sal_uInt16 nSlotId, const OUString& rCommandURL, sal_uInt16 nId, ToolBox& rTbx)
+ : SfxPopupWindow(nSlotId, "FloatingUndoRedo", "svx/ui/floatingundoredo.ui")
+ , rToolBox(rTbx)
+ , bUserSel(false)
+ , nTbxId(nId)
+ , maCommandURL(rCommandURL)
{
DBG_ASSERT( nSlotId == GetId(), "id mismatch" );
- pListBox = new ListBox( this, SVX_RES( LB_SVXTBX_UNDO_REDO_CTRL ) );
- FreeResource();
- pListBox->EnableMultiSelection( true, true );
+ get(m_pListBox, "treeview");
+ WinBits nBits(m_pListBox->GetStyle());
+ nBits &= ~(WB_SIMPLEMODE);
+ m_pListBox->SetStyle(nBits);
+ Size aSize(LogicToPixel(Size(100, 85), MAP_APPFONT));
+ m_pListBox->set_width_request(aSize.Width());
+ m_pListBox->set_height_request(aSize.Height());
+ m_pListBox->EnableMultiSelection( true, true );
SetBackground( GetSettings().GetStyleSettings().GetDialogColor() );
AddStatusListener( rCommandURL );
}
-
-SvxPopupWindowListBox::~SvxPopupWindowListBox()
-{
- delete pListBox;
-}
-
-
SfxPopupWindow* SvxPopupWindowListBox::Clone() const
{
return new SvxPopupWindowListBox( GetId(), maCommandURL, nTbxId, rToolBox );
}
-
void SvxPopupWindowListBox::PopupModeEnd()
{
rToolBox.EndSelection();
@@ -141,11 +127,9 @@ Window* SvxPopupWindowListBox::GetPreferredKeyInputWindow()
{
// allows forwarding key events in the correct window
// without setting the focus
- return pListBox->GetPreferredKeyInputWindow();
+ return m_pListBox->GetPreferredKeyInputWindow();
}
-
-
SvxListBoxControl::SvxListBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx )
:SfxToolBoxControl( nSlotId, nId, rTbx ),
pPopupWin ( 0 )
diff --git a/svx/source/tbxctrls/lboxctrl.hrc b/svx/source/tbxctrls/lboxctrl.hrc
deleted file mode 100644
index 8320a91..0000000
--- a/svx/source/tbxctrls/lboxctrl.hrc
+++ /dev/null
@@ -1,22 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#define LB_SVXTBX_UNDO_REDO_CTRL 11
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/tbxctrls/lboxctrl.src b/svx/source/tbxctrls/lboxctrl.src
index 7961f39..f9b5ab1 100644
--- a/svx/source/tbxctrls/lboxctrl.src
+++ b/svx/source/tbxctrls/lboxctrl.src
@@ -19,27 +19,6 @@
#include <svx/dialogs.hrc>
#include <helpid.hrc>
-#include "lboxctrl.hrc"
-
-FloatingWindow RID_SVXTBX_UNDO_REDO_CTRL
-{
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 102 , 87 ) ;
- HelpID = HID_SVXTBX_UNDO_REDO_CTRL ;
- StdPopup = TRUE;
- Hide = TRUE ;
- OutputSize = TRUE ;
-
- ListBox LB_SVXTBX_UNDO_REDO_CTRL
- {
- HelpID = "svx:ListBox:RID_SVXTBX_UNDO_REDO_CTRL:LB_SVXTBX_UNDO_REDO_CTRL";
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 100 , 85 ) ;
- Border = TRUE ;
- DropDown = FALSE ;
- OutputSize = TRUE ;
- };
-};
String RID_SVXSTR_NUM_UNDO_ACTIONS
{
diff --git a/svx/uiconfig/ui/floatingundoredo.ui b/svx/uiconfig/ui/floatingundoredo.ui
new file mode 100644
index 0000000..66f30a6
--- /dev/null
+++ b/svx/uiconfig/ui/floatingundoredo.ui
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <object class="GtkWindow" id="FloatingUndoRedo:border">
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="border_width">6</property>
+ <property name="resizable">False</property>
+ <property name="destroy_with_parent">True</property>
+ <property name="type_hint">popup-menu</property>
+ <property name="skip_pager_hint">True</property>
+ <property name="decorated">False</property>
+ <property name="deletable">False</property>
+ <child>
+ <object class="GtkBox" id="box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkTreeView" id="treeview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="treeview-selection1"/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index ed310f0..8db0652 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -930,6 +930,26 @@ namespace
return eUnit;
}
+
+ WinBits extractDeferredBits(VclBuilder::stringmap &rMap)
+ {
+ WinBits nBits = WB_3DLOOK|WB_HIDE;
+ if (extractResizable(rMap))
+ nBits |= WB_SIZEABLE;
+ if (extractCloseable(rMap))
+ nBits |= WB_CLOSEABLE;
+ OString sBorder = VclBuilder::extractCustomProperty(rMap);
+ if (!sBorder.isEmpty())
+ nBits |= WB_BORDER;
+ OString sType(extractTypeHint(rMap));
+ if (sType == "utility")
+ nBits |= WB_SYSTEMWINDOW | WB_DIALOGCONTROL | WB_MOVEABLE;
+ else if (sType == "popup-menu")
+ nBits |= WB_SYSTEMWINDOW | WB_DIALOGCONTROL | WB_POPUP;
+ else
+ nBits |= WB_MOVEABLE;
+ return nBits;
+ }
}
FieldUnit VclBuilder::detectUnit(OString const& rString)
@@ -1597,18 +1617,8 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri
}
else if (name == "GtkWindow")
{
- WinBits nBits = WB_SYSTEMWINDOW|WB_MOVEABLE|WB_3DLOOK|WB_CLOSEABLE|WB_HIDE;
- if (extractResizable(rMap))
- nBits |= WB_SIZEABLE;
- OString sType(extractTypeHint(rMap));
- if (sType == "utility")
- {
- pWindow = new FloatingWindow(pParent, nBits);
- }
- else
- {
- SAL_WARN("vcl.layout", "no mapping yet for GtkWindow of type " << sType.getStr() << " yet");
- }
+ WinBits nBits = extractDeferredBits(rMap);
+ pWindow = new FloatingWindow(pParent, nBits|WB_MOVEABLE);
}
else
{
@@ -1706,7 +1716,7 @@ Window *VclBuilder::insertObject(Window *pParent, const OString &rClass,
if (pParent->IsSystemWindow())
{
SystemWindow *pSysWin = static_cast<SystemWindow*>(pCurrentChild);
- pSysWin->doDeferredInit(extractResizable(rProps), extractCloseable(rProps));
+ pSysWin->doDeferredInit(extractDeferredBits(rProps));
m_bToplevelHasDeferredInit = false;
}
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 5f04074..ff6ab0c 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -477,13 +477,8 @@ OUString VclBuilderContainer::getUIRootDir()
//we can't change sizeable after the fact, so need to defer until we know and then
//do the init. Find the real parent stashed in mpDialogParent.
-void Dialog::doDeferredInit(bool bResizable, bool bCloseable)
+void Dialog::doDeferredInit(WinBits nBits)
{
- WinBits nBits = WB_3DLOOK|WB_CLOSEABLE|WB_MOVEABLE;
- if (bResizable)
- nBits |= WB_SIZEABLE;
- if (bCloseable)
- nBits |= WB_CLOSEABLE;
Window *pParent = mpDialogParent;
mpDialogParent = NULL;
ImplInit(pParent, nBits);
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index caedcbc..05b806f 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -171,13 +171,8 @@ FloatingWindow::FloatingWindow(Window* pParent, const OString& rID, const OUStri
}
//Find the real parent stashed in mpDialogParent.
-void FloatingWindow::doDeferredInit(bool bResizable, bool bCloseable)
+void FloatingWindow::doDeferredInit(WinBits nBits)
{
- WinBits nBits = WB_MOVEABLE|WB_3DLOOK;
- if (bResizable)
- nBits |= WB_SIZEABLE;
- if (bCloseable)
- nBits |= WB_CLOSEABLE;
Window *pParent = mpDialogParent;
mpDialogParent = NULL;
ImplInit(pParent, nBits);
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index c274634..6a21d22 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -1101,7 +1101,7 @@ void SystemWindow::DoInitialLayout()
}
}
-void SystemWindow::doDeferredInit(bool /*bResizable*/, bool /*bCloseable*/)
+void SystemWindow::doDeferredInit(WinBits /*nBits*/)
{
SAL_WARN("vcl.layout", "SystemWindow in layout without doDeferredInit impl");
}
commit 2f60a1bdabac11e985dbcc6265dd8b97ef1ca6fd
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Sep 3 15:11:32 2014 +0100
forget about the Left/Top/Right/Bottom frame distance
I think these are actually already factored in, at
least the undo popup doesn't want it and a quick look
around gives 0 for other dialogs.
Change-Id: Ib5abf91992b0e6075dbdce209798596f21342818
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index 1277093..c274634 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -1031,14 +1031,10 @@ void SystemWindow::setPosSizeOnContainee(Size aSize, VclContainer &rBox)
{
sal_Int32 nBorderWidth = get_border_width();
- aSize.Width() -= mpWindowImpl->mnLeftBorder + mpWindowImpl->mnRightBorder
- + 2 * nBorderWidth;
- aSize.Height() -= mpWindowImpl->mnTopBorder + mpWindowImpl->mnBottomBorder
- + 2 * nBorderWidth;
-
- Point aPos(mpWindowImpl->mnLeftBorder + nBorderWidth,
- mpWindowImpl->mnTopBorder + nBorderWidth);
+ aSize.Width() -= 2 * nBorderWidth;
+ aSize.Height() -= 2 * nBorderWidth;
+ Point aPos(nBorderWidth, nBorderWidth);
VclContainer::setLayoutAllocation(rBox, aPos, aSize);
}
commit 6c17e9a5ed0734c1418594ff2bcd46c060b4e40b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Sep 3 09:04:15 2014 +0100
coverity#1130359 Unchecked dynamic_cast
Change-Id: Ib39687040557847bc8b6bed98f52d31b66dc43ad
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 3992d0b..9db2970 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -366,7 +366,7 @@ SwDoc * SwViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt)
aSelPoint = Point( aCharRect.Left(), aCharRect.Top() );
}
}
- else
+ else if (pFirstCrsr)
{
aSelPoint = pFirstCrsr->GetSttPos();
}
@@ -405,7 +405,7 @@ SwDoc * SwViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt)
else
{
pCNd->SetAttr( SwFmtPageDesc( pPageDesc ) );
- if( pFirstCrsr->HasMark() )
+ if( pFirstCrsr && pFirstCrsr->HasMark() )
{
SwTxtNode *pTxtNd = pCNd->GetTxtNode();
if( pTxtNd )
commit 7a3dfd1fa01fcc2527edc70580dec110b14d66b4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Sep 3 08:58:05 2014 +0100
coverity#735906 Dereference after null check
Change-Id: I5052f95919436c9b5c36025439aca70690880d02
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index b69e3eb..d383a60 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -740,7 +740,7 @@ static const SwFrm * lcl_CalcDownDist( SwDistance &rRet,
const SwSectionFrm* pNxtSect = pLay ?
pLay->FindSctFrm() : NULL;
bSct = false;
- if( pSect->IsAnFollow( pNxtSect ) )
+ if (pLay && pSect->IsAnFollow(pNxtSect))
{
pSect = pNxtSect;
if( pLay->IsVertical() )
commit a13b6c3865fcd6a3fc31f015798b8d7cf3b8a7b5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Sep 3 08:52:37 2014 +0100
coverity#704756 Dereference after null check
Change-Id: I004b68ff42d2f56cb7eb1f3a0b20de841a0919c4
diff --git a/sd/source/ui/func/fuscale.cxx b/sd/source/ui/func/fuscale.cxx
index 04c8718..05ae588 100644
--- a/sd/source/ui/func/fuscale.cxx
+++ b/sd/source/ui/func/fuscale.cxx
@@ -131,9 +131,6 @@ void FuScale::DoExecute( SfxRequest& rReq )
default:
{
rReq.Ignore ();
- /*
- rReq.Done( *( pDlg->GetOutputItemSet() ) );
- pArgs = rReq.GetArgs();*/
}
break;
}
@@ -142,6 +139,9 @@ void FuScale::DoExecute( SfxRequest& rReq )
pDlg.reset();
+ if (!mpViewShell)
+ return;
+
switch (((const SvxZoomItem &) aArgs.Get (SID_ATTR_ZOOM)).GetType ())
{
case SVX_ZOOM_PERCENT:
commit b2e118e92f9fa593a215930dc47642145f0a3d7c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Sep 3 08:41:55 2014 +0100
coverity#1209824 Unintended sign extension
and
coverity#1209823 Unintended sign extension
Change-Id: I5dd273e5c9dc0bd408216df6c7db13e70a156020
diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx
index 4566288..d26d4b9 100644
--- a/filter/source/graphicfilter/ipict/ipict.cxx
+++ b/filter/source/graphicfilter/ipict/ipict.cxx
@@ -718,7 +718,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, bool bBaseAddr, bool bColo
nPixelSize, nCmpCount, nCmpSize;
sal_uInt32 nPackSize, nPlaneBytes, nHRes, nVRes;
sal_uInt8 nDat, nRed, nGreen, nBlue, nDummy;
- sal_uLong i, nDataSize = 0;
+ size_t i, nDataSize = 0;
// The calculation of nDataSize is considering the size of the whole data.
nDataSize = 0;
@@ -830,7 +830,8 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, bool bBaseAddr, bool bColo
if ( nPixelSize == 1 || nPixelSize == 2 || nPixelSize == 4 || nPixelSize == 8 )
{
sal_uInt8 nByteCountAsByte, nFlagCounterByte;
- sal_uInt16 nByteCount, nCount, nSrcBPL, nDestBPL;
+ sal_uInt16 nByteCount, nSrcBPL, nDestBPL;
+ size_t nCount;
if ( nPixelSize == 1 ) nSrcBPL = ( nWidth + 7 ) >> 3;
else if ( nPixelSize == 2 ) nSrcBPL = ( nWidth + 3 ) >> 2;
@@ -974,7 +975,8 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, bool bBaseAddr, bool bColo
else if (nPixelSize==32)
{
sal_uInt8 nByteCountAsByte, nFlagCounterByte;
- sal_uInt16 nByteCount, nCount;
+ sal_uInt16 nByteCount;
+ size_t nCount;
sal_uLong nSrcBitsPos;
BitmapColor aBitmapColor;
if ( ( pReadAcc = aBitmap.AcquireReadAccess() ) == NULL )
@@ -1013,7 +1015,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, bool bBaseAddr, bool bColo
{
if ( ( nCmpCount == 3 ) || ( nCmpCount == 4 ) )
{
- boost::scoped_array<sal_uInt8> pScanline(new sal_uInt8[ nWidth * nCmpCount ]);
+ boost::scoped_array<sal_uInt8> pScanline(new sal_uInt8[static_cast<size_t>(nWidth) * nCmpCount]);
for ( ny = 0; ny < nHeight; ny++ )
{
nSrcBitsPos = pPict->Tell();
@@ -1035,8 +1037,8 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, bool bBaseAddr, bool bColo
if ( ( nFlagCounterByte & 0x80 ) == 0)
{
nCount = ( (sal_uInt16)nFlagCounterByte ) + 1;
- if ( ( i + nCount ) > (sal_uInt32)( nWidth * nCmpCount ) )
- nCount = (sal_uInt16)( nWidth * nCmpCount - i );
+ if ( ( i + nCount ) > static_cast<size_t>(nWidth) * nCmpCount )
+ nCount = static_cast<size_t>(nWidth) * nCmpCount - i;
while( nCount-- )
{
pPict->ReadUChar( nDat );
@@ -1046,8 +1048,8 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, bool bBaseAddr, bool bColo
else
{
nCount = ( 1 - ( ( (sal_uInt16)nFlagCounterByte ) | 0xff00 ) );
- if ( ( i + nCount ) > (sal_uInt32)( nWidth * nCmpCount ) )
- nCount = (sal_uInt16)( nWidth * nCmpCount - i );
+ if ( ( i + nCount ) > static_cast<size_t>(nWidth) * nCmpCount)
+ nCount = static_cast<size_t>(nWidth) * nCmpCount - i;
pPict->ReadUChar( nDat );
while( nCount-- )
pScanline[ i++ ] = nDat;
commit ade84ba664b12766b3626dc04277a889ce5bd596
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Sep 3 08:32:01 2014 +0100
coverity#1233511 Uncaught exception
Change-Id: I662bb136128c5e8f22f7d57d38f21a3437d36819
diff --git a/sc/source/ui/vba/vbaaxes.cxx b/sc/source/ui/vba/vbaaxes.cxx
index 8427e14..1cd8851 100644
--- a/sc/source/ui/vba/vbaaxes.cxx
+++ b/sc/source/ui/vba/vbaaxes.cxx
@@ -120,8 +120,18 @@ public:
virtual ::sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException, std::exception) SAL_OVERRIDE { return mCoordinates.size(); }
virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, ::uno::RuntimeException, std::exception) SAL_OVERRIDE
{
+ try
+ {
AxesCoordinate dIndexes = mCoordinates[ Index ];
return uno::makeAny( ScVbaAxes::createAxis( mxChart, mxContext, dIndexes.second, dIndexes.first ) );
+ }
+ catch (const css::script::BasicErrorException& e)
+ {
+ throw css::lang::WrappedTargetException(
+ "Error Getting Index!",
+ static_cast < OWeakObject * > ( this ),
+ makeAny( e ) );
+ }
}
// XElementAccess
virtual uno::Type SAL_CALL getElementType() throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
More information about the Libreoffice-commits
mailing list