[Libreoffice-commits] core.git: 25 commits - chart2/source cui/source dbaccess/source include/svx reportdesign/source sc/source sd/source svx/inc svx/source sw/source
Noel Grandin
noel at peralex.com
Thu Aug 25 06:40:45 UTC 2016
chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx | 22 -
chart2/source/controller/dialogs/res_ErrorBar.cxx | 90 ++--
chart2/source/controller/dialogs/res_Trendline.cxx | 34 -
chart2/source/controller/dialogs/tp_AxisLabel.cxx | 18
chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx | 48 +-
chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx | 58 +--
chart2/source/controller/main/ChartController_Insert.cxx | 2
chart2/source/controller/sidebar/ChartSeriesPanel.cxx | 2
chart2/source/tools/RegressionCurveHelper.cxx | 36 -
chart2/source/view/main/ChartItemPool.cxx | 10
cui/source/dialogs/cuifmsearch.cxx | 14
cui/source/factory/dlgfact.cxx | 10
cui/source/factory/dlgfact.hxx | 4
cui/source/inc/dstribut.hxx | 8
cui/source/inc/labdlg.hxx | 5
cui/source/inc/swpossizetabpage.hxx | 3
cui/source/inc/transfrm.hxx | 13
cui/source/tabpages/border.cxx | 88 ++--
cui/source/tabpages/borderconn.cxx | 2
cui/source/tabpages/dstribut.cxx | 40 +-
cui/source/tabpages/labdlg.cxx | 8
cui/source/tabpages/numfmt.cxx | 22 -
cui/source/tabpages/swpossizetabpage.cxx | 6
cui/source/tabpages/transfrm.cxx | 8
dbaccess/source/ui/app/AppController.cxx | 2
dbaccess/source/ui/app/AppControllerDnD.cxx | 16
dbaccess/source/ui/browser/dbexchange.cxx | 36 -
dbaccess/source/ui/browser/unodatbr.cxx | 48 +-
dbaccess/source/ui/misc/TableCopyHelper.cxx | 24 -
dbaccess/source/ui/misc/TokenWriter.cxx | 20 -
include/svx/AccessibleShape.hxx | 3
include/svx/ChildrenManager.hxx | 4
include/svx/IAccessibleViewForwarderListener.hxx | 18
include/svx/anchorid.hxx | 23 -
include/svx/chrtitem.hxx | 108 ++---
include/svx/cube3d.hxx | 24 +
include/svx/dataaccessdescriptor.hxx | 30 -
include/svx/dbaexchange.hxx | 4
include/svx/def3d.hxx | 15
include/svx/deflt3d.hxx | 6
include/svx/dstribut_enum.hxx | 24 -
include/svx/flagsdef.hxx | 42 +-
include/svx/float3d.hxx | 12
include/svx/fmsrcimp.hxx | 18
include/svx/framebordertype.hxx | 22 -
include/svx/framelink.hxx | 8
include/svx/frmsel.hxx | 75 ++-
include/svx/galmisc.hxx | 16
include/svx/gridctrl.hxx | 33 +
include/svx/svxdlg.hxx | 5
reportdesign/source/ui/dlg/AddField.cxx | 14
reportdesign/source/ui/dlg/Formula.cxx | 2
reportdesign/source/ui/report/ReportController.cxx | 8
sc/source/filter/xml/XMLExportDatabaseRanges.cxx | 4
sc/source/ui/Accessibility/AccessibleDocument.cxx | 7
sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx | 2
sc/source/ui/docshell/dbdocfun.cxx | 4
sc/source/ui/docshell/dbdocimp.cxx | 16
sc/source/ui/unoobj/datauno.cxx | 4
sc/source/ui/unoobj/dispuno.cxx | 10
sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx | 18
sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx | 11
sd/source/ui/accessibility/AccessibleOutlineView.cxx | 5
sd/source/ui/inc/AccessibleDocumentViewBase.hxx | 3
sd/source/ui/inc/AccessibleDrawDocumentView.hxx | 3
sd/source/ui/inc/AccessibleOutlineView.hxx | 3
svx/inc/dragmt3d.hxx | 6
svx/inc/galobj.hxx | 10
svx/source/accessibility/AccessibleFrameSelector.cxx | 30 -
svx/source/accessibility/AccessibleShape.cxx | 5
svx/source/accessibility/ChildrenManager.cxx | 6
svx/source/accessibility/ChildrenManagerImpl.cxx | 21 -
svx/source/accessibility/ChildrenManagerImpl.hxx | 5
svx/source/dialog/framelink.cxx | 30 -
svx/source/dialog/frmsel.cxx | 190 +++++-----
svx/source/engine3d/deflt3d.cxx | 2
svx/source/engine3d/dragmt3d.cxx | 10
svx/source/engine3d/float3d.cxx | 32 -
svx/source/engine3d/view3d.cxx | 10
svx/source/fmcomp/dbaexchange.cxx | 74 +--
svx/source/fmcomp/dbaobjectex.cxx | 4
svx/source/fmcomp/fmgridcl.cxx | 36 -
svx/source/fmcomp/gridcell.cxx | 10
svx/source/fmcomp/gridctrl.cxx | 54 +-
svx/source/form/dataaccessdescriptor.cxx | 63 +--
svx/source/form/fmsrcimp.cxx | 74 +--
svx/source/form/fmview.cxx | 6
svx/source/form/fmvwimp.cxx | 8
svx/source/form/tabwin.cxx | 18
svx/source/gallery2/galbrws2.cxx | 20 -
svx/source/gallery2/galexpl.cxx | 4
svx/source/gallery2/galmisc.cxx | 16
svx/source/gallery2/galobj.cxx | 4
svx/source/gallery2/galtheme.cxx | 56 +-
svx/source/inc/frmselimpl.hxx | 2
svx/source/items/chrtitem.cxx | 33 -
svx/source/items/numfmtsh.cxx | 22 -
svx/source/svdraw/svdedtv2.cxx | 24 -
svx/source/table/accessiblecell.cxx | 2
svx/source/table/accessiblecell.hxx | 2
svx/source/unogallery/unogalitem.cxx | 6
sw/source/core/access/acccontext.cxx | 8
sw/source/core/layout/paintfrm.cxx | 8
sw/source/core/unocore/unofield.cxx | 4
sw/source/uibase/app/apphdl.cxx | 14
sw/source/uibase/app/swmodul1.cxx | 4
sw/source/uibase/dbui/dbmgr.cxx | 44 +-
sw/source/uibase/dochdl/swdtflvr.cxx | 14
sw/source/uibase/shells/drwbassh.cxx | 4
sw/source/uibase/shells/textsh2.cxx | 8
sw/source/uibase/uno/unodispatch.cxx | 8
sw/source/uibase/uno/unomailmerge.cxx | 16
sw/source/uibase/utlui/condedit.cxx | 4
sw/source/uibase/utlui/numfmtlb.cxx | 18
114 files changed, 1150 insertions(+), 1200 deletions(-)
New commits:
commit f360244e5ddb6b607e752a0df3c37ccefaec1d9f
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 24 15:51:14 2016 +0200
drop enum IAccessibleViewForwarderListener::ChangeType
since only one of it's values was in use, and simplify the
ViewForwarderChanged method as a consequence.
Change-Id: I00544c9b0a601c01e49519be5bafe192c6f735f6
diff --git a/include/svx/AccessibleShape.hxx b/include/svx/AccessibleShape.hxx
index 8bafaec..8f961ff 100644
--- a/include/svx/AccessibleShape.hxx
+++ b/include/svx/AccessibleShape.hxx
@@ -323,8 +323,7 @@ public:
throw (css::uno::RuntimeException, std::exception) override;
//===== IAccessibleViewForwarderListener ================================
- virtual void ViewForwarderChanged (ChangeType aChangeType,
- const IAccessibleViewForwarder* pViewForwarder) override;
+ virtual void ViewForwarderChanged() override;
//===== lang::XEventListener ============================================
diff --git a/include/svx/ChildrenManager.hxx b/include/svx/ChildrenManager.hxx
index bb1cab7..c85bd1b 100644
--- a/include/svx/ChildrenManager.hxx
+++ b/include/svx/ChildrenManager.hxx
@@ -192,9 +192,7 @@ public:
*/
void RemoveFocus();
- void ViewForwarderChanged(
- IAccessibleViewForwarderListener::ChangeType aChangeType,
- const IAccessibleViewForwarder* pViewForwarder);
+ void ViewForwarderChanged();
private:
rtl::Reference<ChildrenManagerImpl> mpImpl;
diff --git a/include/svx/IAccessibleViewForwarderListener.hxx b/include/svx/IAccessibleViewForwarderListener.hxx
index d9f27e8..b4195d1 100644
--- a/include/svx/IAccessibleViewForwarderListener.hxx
+++ b/include/svx/IAccessibleViewForwarderListener.hxx
@@ -39,25 +39,11 @@ class IAccessibleViewForwarder;
class IAccessibleViewForwarderListener
{
public:
- /** Enumeration of the different change types.
- */
- enum ChangeType {TRANSFORMATION, VISIBLE_AREA, STATE};
/** This method is called to indicate a change of the specified view
- forwarder.
- @param aChangeType
- The type of the change. TRANSFORMATION indicates a change of
- the coordinate transformation with a constant visible area. If
- the visible area changes, just use VISIBLE_AREA. This changes
- the transformation implicitly. The value STATE indicates a
- change of the validity state. Check the IsValid method of the
- view forwarder before doing further calls.
- @param pViewForwarder
- The modified view forwarder. It is specified just in case that
- there is more than one view forwarder in use at the same time.
+ forwarder, specifically, a change in visible area.
*/
- virtual void ViewForwarderChanged (ChangeType aChangeType,
- const IAccessibleViewForwarder* pViewForwarder) = 0;
+ virtual void ViewForwarderChanged() = 0;
protected:
~IAccessibleViewForwarderListener() {}
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 9c78759..703f61d 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -1377,13 +1377,12 @@ namespace
{
struct ScVisAreaChanged
{
- ScAccessibleDocument* mpAccDoc;
- explicit ScVisAreaChanged(ScAccessibleDocument* pAccDoc) : mpAccDoc(pAccDoc) {}
+ explicit ScVisAreaChanged() {}
void operator() (const ScAccessibleShapeData* pAccShapeData) const
{
if (pAccShapeData && pAccShapeData->pAccShape.is())
{
- pAccShapeData->pAccShape->ViewForwarderChanged(::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA, mpAccDoc);
+ pAccShapeData->pAccShape->ViewForwarderChanged();
}
}
};
@@ -1391,7 +1390,7 @@ namespace
void ScChildrenShapes::VisAreaChanged() const
{
- ScVisAreaChanged aVisAreaChanged(mpAccessibleDocument);
+ ScVisAreaChanged aVisAreaChanged;
std::for_each(maZOrderedShapes.begin(), maZOrderedShapes.end(), aVisAreaChanged);
}
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index 604eb89..d3a599c 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -806,7 +806,7 @@ namespace
{
if (rAccShapeData.mpAccShape.is())
{
- rAccShapeData.mpAccShape->ViewForwarderChanged(::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA, mpViewForwarder);
+ rAccShapeData.mpAccShape->ViewForwarderChanged();
}
}
};
diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
index 1f6e89d..2dbcedd 100644
--- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
+++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
@@ -212,7 +212,7 @@ IMPL_LINK_TYPED(AccessibleDocumentViewBase, WindowChildEventListener,
//===== IAccessibleViewForwarderListener ====================================
-void AccessibleDocumentViewBase::ViewForwarderChanged(ChangeType, const IAccessibleViewForwarder* )
+void AccessibleDocumentViewBase::ViewForwarderChanged()
{
// Empty
}
@@ -558,9 +558,7 @@ void SAL_CALL
if( IsDisposed() )
return;
- ViewForwarderChanged (
- IAccessibleViewForwarderListener::VISIBLE_AREA,
- &maViewForwarder);
+ ViewForwarderChanged();
}
void SAL_CALL
@@ -570,9 +568,7 @@ void SAL_CALL
if( IsDisposed() )
return;
- ViewForwarderChanged (
- IAccessibleViewForwarderListener::VISIBLE_AREA,
- &maViewForwarder);
+ ViewForwarderChanged();
}
void SAL_CALL
@@ -582,9 +578,7 @@ void SAL_CALL
if( IsDisposed() )
return;
- ViewForwarderChanged (
- IAccessibleViewForwarderListener::VISIBLE_AREA,
- &maViewForwarder);
+ ViewForwarderChanged();
}
void SAL_CALL
@@ -594,9 +588,7 @@ void SAL_CALL
if( IsDisposed() )
return;
- ViewForwarderChanged (
- IAccessibleViewForwarderListener::VISIBLE_AREA,
- &maViewForwarder);
+ ViewForwarderChanged();
}
//===== XFocusListener ==================================================
diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
index c5fb81b..4f2dc6e 100644
--- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
+++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
@@ -123,12 +123,11 @@ void AccessibleDrawDocumentView::Init()
mpChildrenManager->UpdateSelection ();
}
-void AccessibleDrawDocumentView::ViewForwarderChanged (ChangeType aChangeType,
- const IAccessibleViewForwarder* pViewForwarder)
+void AccessibleDrawDocumentView::ViewForwarderChanged()
{
- AccessibleDocumentViewBase::ViewForwarderChanged (aChangeType, pViewForwarder);
+ AccessibleDocumentViewBase::ViewForwarderChanged();
if (mpChildrenManager != nullptr)
- mpChildrenManager->ViewForwarderChanged (aChangeType, pViewForwarder);
+ mpChildrenManager->ViewForwarderChanged();
}
/** The page shape is created on every call at the moment (provided that
@@ -335,9 +334,7 @@ void SAL_CALL
{
OSL_TRACE (" visible area changed");
if (mpChildrenManager != nullptr)
- mpChildrenManager->ViewForwarderChanged (
- IAccessibleViewForwarderListener::VISIBLE_AREA,
- &maViewForwarder);
+ mpChildrenManager->ViewForwarderChanged();
}
else if (rEventObject.PropertyName == "ActiveLayer")
{
diff --git a/sd/source/ui/accessibility/AccessibleOutlineView.cxx b/sd/source/ui/accessibility/AccessibleOutlineView.cxx
index 7fb492e..ba187e8 100644
--- a/sd/source/ui/accessibility/AccessibleOutlineView.cxx
+++ b/sd/source/ui/accessibility/AccessibleOutlineView.cxx
@@ -103,10 +103,9 @@ void AccessibleOutlineView::Init()
AccessibleDocumentViewBase::Init ();
}
-void AccessibleOutlineView::ViewForwarderChanged (ChangeType aChangeType,
- const IAccessibleViewForwarder* pViewForwarder)
+void AccessibleOutlineView::ViewForwarderChanged()
{
- AccessibleDocumentViewBase::ViewForwarderChanged (aChangeType, pViewForwarder);
+ AccessibleDocumentViewBase::ViewForwarderChanged();
UpdateChildren();
}
diff --git a/sd/source/ui/inc/AccessibleDocumentViewBase.hxx b/sd/source/ui/inc/AccessibleDocumentViewBase.hxx
index 9f5bf09..1e3e5c0 100644
--- a/sd/source/ui/inc/AccessibleDocumentViewBase.hxx
+++ b/sd/source/ui/inc/AccessibleDocumentViewBase.hxx
@@ -134,8 +134,7 @@ public:
windowResized... methods it will be sufficient in most cases just to
override this method.
*/
- virtual void ViewForwarderChanged (ChangeType aChangeType,
- const IAccessibleViewForwarder* pViewForwarder) override;
+ virtual void ViewForwarderChanged() override;
//===== XAccessibleContext ==============================================
diff --git a/sd/source/ui/inc/AccessibleDrawDocumentView.hxx b/sd/source/ui/inc/AccessibleDrawDocumentView.hxx
index 0da01c7..a67a092 100644
--- a/sd/source/ui/inc/AccessibleDrawDocumentView.hxx
+++ b/sd/source/ui/inc/AccessibleDrawDocumentView.hxx
@@ -54,8 +54,7 @@ public:
//===== IAccessibleViewForwarderListener ================================
- virtual void ViewForwarderChanged (ChangeType aChangeType,
- const IAccessibleViewForwarder* pViewForwarder) override;
+ virtual void ViewForwarderChanged() override;
//===== XAccessibleContext ==============================================
diff --git a/sd/source/ui/inc/AccessibleOutlineView.hxx b/sd/source/ui/inc/AccessibleOutlineView.hxx
index 9de60128..ffcdc3b 100644
--- a/sd/source/ui/inc/AccessibleOutlineView.hxx
+++ b/sd/source/ui/inc/AccessibleOutlineView.hxx
@@ -52,8 +52,7 @@ public:
//===== IAccessibleViewForwarderListener ================================
- virtual void ViewForwarderChanged (ChangeType aChangeType,
- const IAccessibleViewForwarder* pViewForwarder) override;
+ virtual void ViewForwarderChanged() override;
//===== XAccessibleContext ==============================================
diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx
index 21708ad..260af70 100644
--- a/svx/source/accessibility/AccessibleShape.cxx
+++ b/svx/source/accessibility/AccessibleShape.cxx
@@ -1087,8 +1087,7 @@ sal_Int64 SAL_CALL
}
// IAccessibleViewForwarderListener
-void AccessibleShape::ViewForwarderChanged (ChangeType aChangeType,
- const IAccessibleViewForwarder* pViewForwarder)
+void AccessibleShape::ViewForwarderChanged()
{
// Inform all listeners that the graphical representation (i.e. size
// and/or position) of the shape has changed.
@@ -1098,7 +1097,7 @@ void AccessibleShape::ViewForwarderChanged (ChangeType aChangeType,
// Tell children manager of the modified view forwarder.
if (mpChildrenManager != nullptr)
- mpChildrenManager->ViewForwarderChanged (aChangeType, pViewForwarder);
+ mpChildrenManager->ViewForwarderChanged();
// update our children that our screen position might have changed
if( mpText )
diff --git a/svx/source/accessibility/ChildrenManager.cxx b/svx/source/accessibility/ChildrenManager.cxx
index 5634fa4..c7938a1 100644
--- a/svx/source/accessibility/ChildrenManager.cxx
+++ b/svx/source/accessibility/ChildrenManager.cxx
@@ -115,11 +115,9 @@ void ChildrenManager::RemoveFocus()
}
// IAccessibleViewForwarderListener
-void ChildrenManager::ViewForwarderChanged(
- IAccessibleViewForwarderListener::ChangeType aChangeType,
- const IAccessibleViewForwarder* pViewForwarder)
+void ChildrenManager::ViewForwarderChanged()
{
- mpImpl->ViewForwarderChanged (aChangeType, pViewForwarder);
+ mpImpl->ViewForwarderChanged();
}
} // end of namespace accessibility
diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx
index ff5bc25..2831775 100644
--- a/svx/source/accessibility/ChildrenManagerImpl.cxx
+++ b/svx/source/accessibility/ChildrenManagerImpl.cxx
@@ -403,9 +403,7 @@ void ChildrenManagerImpl::SendVisibleAreaEvents (
// as a result of a change of the view forwarder).
AccessibleShape* pShape = I->GetAccessibleShape ();
if (pShape != nullptr)
- pShape->ViewForwarderChanged (
- IAccessibleViewForwarderListener::VISIBLE_AREA,
- maShapeTreeInfo.GetViewForwarder());
+ pShape->ViewForwarderChanged();
}
}
@@ -729,22 +727,9 @@ void SAL_CALL ChildrenManagerImpl::disposing()
}
// IAccessibleViewForwarderListener
-void ChildrenManagerImpl::ViewForwarderChanged (ChangeType aChangeType,
- const IAccessibleViewForwarder* pViewForwarder)
+void ChildrenManagerImpl::ViewForwarderChanged()
{
- if (aChangeType == IAccessibleViewForwarderListener::VISIBLE_AREA)
- Update (false);
- else
- {
- SolarMutexGuard g;
- ChildDescriptorListType::const_iterator aEnd = maVisibleChildren.end();
- for (ChildDescriptorListType::iterator I=maVisibleChildren.begin(); I != aEnd; ++I)
- {
- AccessibleShape* pShape = I->GetAccessibleShape();
- if (pShape != nullptr)
- pShape->ViewForwarderChanged (aChangeType, pViewForwarder);
- }
- }
+ Update(false);
}
// IAccessibleParent
diff --git a/svx/source/accessibility/ChildrenManagerImpl.hxx b/svx/source/accessibility/ChildrenManagerImpl.hxx
index eadec9b..757953f 100644
--- a/svx/source/accessibility/ChildrenManagerImpl.hxx
+++ b/svx/source/accessibility/ChildrenManagerImpl.hxx
@@ -262,8 +262,7 @@ public:
@param pViewForwarder
The modified view forwarder. Use this one from now on.
*/
- virtual void ViewForwarderChanged (ChangeType aChangeType,
- const IAccessibleViewForwarder* pViewForwarder) override;
+ virtual void ViewForwarderChanged() override;
// IAccessibleParent
/** Replace the specified child with a replacement.
@@ -393,7 +392,7 @@ private:
Events are sent to all entries of this list that already contain
an accessible object.
*/
- void SendVisibleAreaEvents (ChildDescriptorListType& raChildList);
+ static void SendVisibleAreaEvents (ChildDescriptorListType& raChildList);
/** If children have to be created immediately and not on demand the
create the missing accessible objects now.
diff --git a/svx/source/table/accessiblecell.cxx b/svx/source/table/accessiblecell.cxx
index 47245fa..5dcb29f 100644
--- a/svx/source/table/accessiblecell.cxx
+++ b/svx/source/table/accessiblecell.cxx
@@ -492,7 +492,7 @@ Sequence<OUString> SAL_CALL AccessibleCell::getSupportedServiceNames() throw (Ru
// IAccessibleViewForwarderListener
-void AccessibleCell::ViewForwarderChanged (ChangeType /*aChangeType*/, const IAccessibleViewForwarder* /*pViewForwarder*/)
+void AccessibleCell::ViewForwarderChanged()
{
// Inform all listeners that the graphical representation (i.e. size
// and/or position) of the shape has changed.
diff --git a/svx/source/table/accessiblecell.hxx b/svx/source/table/accessiblecell.hxx
index df9de13..d001ef3 100644
--- a/svx/source/table/accessiblecell.hxx
+++ b/svx/source/table/accessiblecell.hxx
@@ -101,7 +101,7 @@ public:
virtual css::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override;
// IAccessibleViewForwarderListener
- virtual void ViewForwarderChanged (ChangeType aChangeType, const IAccessibleViewForwarder* pViewForwarder) override;
+ virtual void ViewForwarderChanged() override;
// Misc
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index 8fb2e30..f3d3285 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -227,9 +227,7 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrame *pFrame,
{
case Action::SCROLLED:
case Action::SCROLLED_WITHIN:
- xAccImpl->ViewForwarderChanged(
- ::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA,
- GetMap() );
+ xAccImpl->ViewForwarderChanged();
break;
case Action::SCROLLED_IN:
ScrolledInShape( rLower.GetDrawObject(),
@@ -237,9 +235,7 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrame *pFrame,
break;
case Action::SCROLLED_OUT:
{
- xAccImpl->ViewForwarderChanged(
- ::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA,
- GetMap() );
+ xAccImpl->ViewForwarderChanged();
// this DisposeShape call was removed by
// IAccessibility2 implementation
// without giving any reason why
commit 3aa7db4586c53a0815b74cc514ff8a6541dc7e01
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 24 15:06:35 2016 +0200
convert SvxAnchorIds to scoped enum
Change-Id: I4375fa07eb6ac81b21b904e965e4c2f9600ca99a
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index c1f3644..39ec6d2 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -921,7 +921,7 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTextTabDialog( vcl::Wind
// TabDialog that use functionality of the drawing layer and add AnchorTypes -- for SvxCaptionTabDialog
AbstractSvxCaptionDialog* AbstractDialogFactory_Impl::CreateCaptionDialog( vcl::Window* pParent,
const SdrView* pView,
- sal_uInt16 nAnchorTypes )
+ SvxAnchorIds nAnchorTypes )
{
VclPtrInstance<SvxCaptionTabDialog> pDlg( pParent, pView, nAnchorTypes );
return new AbstractSvxCaptionDialog_Impl( pDlg );
@@ -1095,7 +1095,7 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSvxBorderBackgroundDlg(
AbstractSvxTransformTabDialog* AbstractDialogFactory_Impl::CreateSvxTransformTabDialog( vcl::Window* pParent,
const SfxItemSet* pAttr,
const SdrView* pView,
- sal_uInt16 nAnchorTypes )
+ SvxAnchorIds nAnchorTypes )
{
VclPtrInstance<SvxTransformTabDialog> pDlg( pParent, pAttr,pView, nAnchorTypes);
return new AbstractSvxTransformTabDialog_Impl( pDlg );
@@ -1113,14 +1113,14 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSchTransformTabDialog( v
{
case RID_SCH_TransformTabDLG_SVXPAGE_ANGLE :
{
- pDlg.reset( VclPtr<SvxTransformTabDialog>::Create( pParent, pAttr,pSdrView, bSizeTabPage ? SVX_OBJ_NOPROTECT : SVX_OBJ_NOPROTECT|SVX_OBJ_NORESIZE) );
+ pDlg.reset( VclPtr<SvxTransformTabDialog>::Create( pParent, pAttr,pSdrView, bSizeTabPage ? SvxAnchorIds::NoProtect : SvxAnchorIds::NoProtect|SvxAnchorIds::NoResize) );
pDlg->RemoveTabPage( "RID_SVXPAGE_ANGLE" );
pDlg->RemoveTabPage( "RID_SVXPAGE_SLANT" );
}
break;
case RID_SCH_TransformTabDLG_SVXPAGE_SLANT:
{
- pDlg.reset(VclPtr<SvxTransformTabDialog>::Create ( pParent, pAttr,pSdrView, bSizeTabPage ? SVX_OBJ_NOPROTECT : SVX_OBJ_NOPROTECT|SVX_OBJ_NORESIZE ) );
+ pDlg.reset(VclPtr<SvxTransformTabDialog>::Create ( pParent, pAttr,pSdrView, bSizeTabPage ? SvxAnchorIds::NoProtect : SvxAnchorIds::NoProtect|SvxAnchorIds::NoResize ) );
pDlg->RemoveTabPage( "RID_SVXPAGE_SLANT" );
}
break;
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 1196aa3..4790b80 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -476,7 +476,7 @@ public:
const SfxItemSet& rSet) override;
virtual AbstractSvxCaptionDialog* CreateCaptionDialog( vcl::Window* pParent,
const SdrView* pView,
- sal_uInt16 nAnchorTypes = 0 ) override;
+ SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE ) override;
virtual AbstractSvxDistributeDialog* CreateSvxDistributeDialog(const SfxItemSet& rAttr) override;
virtual SfxAbstractInsertObjectDialog* CreateInsertObjectDialog( vcl::Window* pParent, const OUString& rCommmand,
const css::uno::Reference < css::embed::XStorage >& xStor,
@@ -509,7 +509,7 @@ public:
virtual AbstractSvxTransformTabDialog* CreateSvxTransformTabDialog( vcl::Window* pParent,
const SfxItemSet* pAttr,
const SdrView* pView,
- sal_uInt16 nAnchorTypes = 0) override ;
+ SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE) override ;
virtual SfxAbstractTabDialog* CreateSchTransformTabDialog( vcl::Window* pParent,
const SfxItemSet* pAttr,
const SdrView* pSdrView,
diff --git a/cui/source/inc/labdlg.hxx b/cui/source/inc/labdlg.hxx
index a7b1064..e431abb 100644
--- a/cui/source/inc/labdlg.hxx
+++ b/cui/source/inc/labdlg.hxx
@@ -26,6 +26,7 @@
#include <sfx2/tabdlg.hxx>
#include <svx/sxctitm.hxx>
#include <svx/sxcecitm.hxx>
+#include <svx/anchorid.hxx>
class SdrView;
@@ -101,7 +102,7 @@ class SvxCaptionTabDialog : public SfxTabDialog
{
private:
const SdrView* pView;
- sal_uInt16 nAnchorCtrls;
+ SvxAnchorIds nAnchorCtrls;
sal_uInt16 m_nSwPosSizePageId;
sal_uInt16 m_nPositionSizePageId;
sal_uInt16 m_nCaptionPageId;
@@ -112,7 +113,7 @@ private:
public:
SvxCaptionTabDialog(vcl::Window* pParent, const SdrView* pView,
- sal_uInt16 nAnchorTypes = 0);
+ SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE);
/// link for the Writer to validate positions
void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink );
diff --git a/cui/source/inc/swpossizetabpage.hxx b/cui/source/inc/swpossizetabpage.hxx
index 611ebc0..5142d6d 100644
--- a/cui/source/inc/swpossizetabpage.hxx
+++ b/cui/source/inc/swpossizetabpage.hxx
@@ -31,6 +31,7 @@
struct FrmMap;
class SdrView;
struct SvxSwFrameValidation;
+enum class SvxAnchorIds;
class SvxSwPosSizeTabPage : public SfxTabPage
{
@@ -136,7 +137,7 @@ public:
virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
- void EnableAnchorTypes(sal_uInt16 nAnchorEnable);
+ void EnableAnchorTypes(SvxAnchorIds nAnchorEnable);
void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink )
{m_aValidateLink = rLink;}
diff --git a/cui/source/inc/transfrm.hxx b/cui/source/inc/transfrm.hxx
index 2857e45..7e90777 100644
--- a/cui/source/inc/transfrm.hxx
+++ b/cui/source/inc/transfrm.hxx
@@ -21,6 +21,7 @@
#include <svx/dlgctrl.hxx>
#include <svx/dialcontrol.hxx>
+#include <svx/anchorid.hxx>
#include <vcl/fixed.hxx>
@@ -35,14 +36,6 @@ class SdrView;
|*
\************************************************************************/
-/** put this into the nAnchorTypes parameter of the SvxTransformTabDialog c'tor
- to disable the size controls */
-const sal_uInt16 SVX_OBJ_NORESIZE = 0x0100;
-
-/** put this into the nAnchorTypes parameter of the SvxTransformTabDialog c'tor
- to disable the protect controls */
-const sal_uInt16 SVX_OBJ_NOPROTECT = 0x0200;
-
struct SvxSwFrameValidation;
class SvxTransformTabDialog : public SfxTabDialog
{
@@ -53,7 +46,7 @@ class SvxTransformTabDialog : public SfxTabDialog
private:
const SdrView* pView;
- sal_uInt16 nAnchorCtrls;
+ SvxAnchorIds nAnchorCtrls;
Link<SvxSwFrameValidation&,void> aValidateLink;
virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override;
@@ -62,7 +55,7 @@ public:
SvxTransformTabDialog( vcl::Window* pParent, const SfxItemSet* pAttr,
const SdrView* pView,
- sal_uInt16 nAnchorTypes = 0);
+ SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE);
//link for the Writer to validate positions
void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink );
diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx
index 2c01f53..3c2d3e9 100644
--- a/cui/source/tabpages/labdlg.cxx
+++ b/cui/source/tabpages/labdlg.cxx
@@ -507,7 +507,7 @@ void SvxCaptionTabPage::FillValueSet()
SvxCaptionTabDialog::SvxCaptionTabDialog(vcl::Window* pParent, const SdrView* pSdrView,
- sal_uInt16 nAnchorTypes)
+ SvxAnchorIds nAnchorTypes)
: SfxTabDialog( pParent, "CalloutDialog", "cui/ui/calloutdialog.ui")
, pView(pSdrView)
, nAnchorCtrls(nAnchorTypes)
@@ -518,7 +518,7 @@ SvxCaptionTabDialog::SvxCaptionTabDialog(vcl::Window* pParent, const SdrView* pS
assert(pView); //Keine gueltige View Uebergeben!
//different positioning page in Writer
- if (nAnchorCtrls & 0x00ff)
+ if (nAnchorCtrls & (SvxAnchorIds::Paragraph | SvxAnchorIds::Character | SvxAnchorIds::Page | SvxAnchorIds::Fly))
{
m_nSwPosSizePageId = AddTabPage("RID_SVXPAGE_SWPOSSIZE", SvxSwPosSizeTabPage::Create,
SvxSwPosSizeTabPage::GetRanges );
@@ -540,10 +540,10 @@ void SvxCaptionTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
static_cast<SvxPositionSizeTabPage&>( rPage ).SetView( pView );
static_cast<SvxPositionSizeTabPage&>( rPage ).Construct();
- if( nAnchorCtrls & SVX_OBJ_NORESIZE )
+ if( nAnchorCtrls & SvxAnchorIds::NoResize )
static_cast<SvxPositionSizeTabPage&>( rPage ).DisableResize();
- if( nAnchorCtrls & SVX_OBJ_NOPROTECT )
+ if( nAnchorCtrls & SvxAnchorIds::NoProtect )
static_cast<SvxPositionSizeTabPage&>( rPage ).DisableProtect();
}
else if (nId == m_nSwPosSizePageId)
diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx
index 6fcd7cc..053495c 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -1096,11 +1096,11 @@ DeactivateRC SvxSwPosSizeTabPage::DeactivatePage( SfxItemSet* _pSet )
return DeactivateRC::LeavePage;
}
-void SvxSwPosSizeTabPage::EnableAnchorTypes(sal_uInt16 nAnchorEnable)
+void SvxSwPosSizeTabPage::EnableAnchorTypes(SvxAnchorIds nAnchorEnable)
{
- if((nAnchorEnable & SVX_OBJ_AT_FLY))
+ if((nAnchorEnable & SvxAnchorIds::Fly))
m_pToFrameRB->Show();
- if(!(nAnchorEnable & SVX_OBJ_PAGE))
+ if(!(nAnchorEnable & SvxAnchorIds::Page))
m_pToPageRB->Enable(false);
}
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index b570a60..90cede7 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -88,7 +88,7 @@ const sal_uInt16 SvxSlantTabPage::pSlantRanges[] =
\************************************************************************/
SvxTransformTabDialog::SvxTransformTabDialog( vcl::Window* pParent, const SfxItemSet* pAttr,
- const SdrView* pSdrView, sal_uInt16 nAnchorTypes )
+ const SdrView* pSdrView, SvxAnchorIds nAnchorTypes )
: SfxTabDialog( pParent
,"PositionAndSizeDialog"
,"cui/ui/positionsizedialog.ui"
@@ -101,7 +101,7 @@ SvxTransformTabDialog::SvxTransformTabDialog( vcl::Window* pParent, const SfxIte
DBG_ASSERT(pView, "no valid view (!)");
//different positioning page in Writer
- if(nAnchorCtrls & 0x00ff)
+ if(nAnchorCtrls & (SvxAnchorIds::Paragraph | SvxAnchorIds::Character | SvxAnchorIds::Page | SvxAnchorIds::Fly))
{
nSWPosSize = AddTabPage("RID_SVXPAGE_SWPOSSIZE", SvxSwPosSizeTabPage::Create, SvxSwPosSizeTabPage::GetRanges);
RemoveTabPage("RID_SVXPAGE_POSITION_SIZE");
@@ -125,12 +125,12 @@ void SvxTransformTabDialog::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
rSvxPos.SetView(pView);
rSvxPos.Construct();
- if(nAnchorCtrls & SVX_OBJ_NORESIZE)
+ if(nAnchorCtrls & SvxAnchorIds::NoResize)
{
rSvxPos.DisableResize();
}
- if(nAnchorCtrls & SVX_OBJ_NOPROTECT)
+ if(nAnchorCtrls & SvxAnchorIds::NoProtect)
{
rSvxPos.DisableProtect();
rSvxPos.UpdateControlStates();
diff --git a/include/svx/anchorid.hxx b/include/svx/anchorid.hxx
index 921769c..da73870 100644
--- a/include/svx/anchorid.hxx
+++ b/include/svx/anchorid.hxx
@@ -19,15 +19,26 @@
#ifndef INCLUDED_SVX_ANCHORID_HXX
#define INCLUDED_SVX_ANCHORID_HXX
+#include <o3tl/typed_flags_set.hxx>
-enum SvxAnchorIds
+enum class SvxAnchorIds
{
- SVX_OBJ_AT_CNTNT = 0x01, // Frame bound to paragraph
- SVX_OBJ_IN_CNTNT = 0x02, // Frame bound to character
- SVX_OBJ_PAGE = 0x04, // Frame bound to page
- SVX_OBJ_AT_FLY = 0x08 // Frame bound to other frame
-// SVX_OBJ_AUTO_CNTNT = 0x10 // Automatically positioned frame bound to paragraph
+ NONE = 0x0000,
+ Paragraph = 0x0001, // Frame bound to paragraph
+ Character = 0x0002, // Frame bound to character
+ Page = 0x0004, // Frame bound to page
+ Fly = 0x0008, // Frame bound to other frame
+ /** put this into the nAnchorTypes parameter of the SvxTransformTabDialog c'tor
+ to disable the size controls */
+ NoResize = 0x0100,
+ /** put this into the nAnchorTypes parameter of the SvxTransformTabDialog c'tor
+ to disable the protect controls */
+ NoProtect = 0x0200
};
+namespace o3tl
+{
+ template<> struct typed_flags<SvxAnchorIds> : is_typed_flags<SvxAnchorIds, 0x030f> {};
+}
#endif
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 2224c33..f3a21ca 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_SVX_SVXDLG_HXX
#include <sfx2/sfxdlg.hxx>
+#include <svx/anchorid.hxx>
#include <svx/zoom_def.hxx>
#include <editeng/edtdlg.hxx>
@@ -281,7 +282,7 @@ public:
virtual AbstractSvxCaptionDialog* CreateCaptionDialog( vcl::Window* pParent,
const SdrView* pView,
- sal_uInt16 nAnchorTypes = 0 ) = 0;
+ SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE ) = 0;
virtual AbstractSvxDistributeDialog* CreateSvxDistributeDialog(
const SfxItemSet& rAttr)= 0;
@@ -329,7 +330,7 @@ public:
virtual AbstractSvxTransformTabDialog* CreateSvxTransformTabDialog( vcl::Window* pParent,
const SfxItemSet* pAttr,
const SdrView* pView,
- sal_uInt16 nAnchorTypes = 0) = 0;
+ SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE) = 0;
virtual SfxAbstractTabDialog* CreateSchTransformTabDialog( vcl::Window* pParent,
const SfxItemSet* pAttr,
const SdrView* pSdrView,
diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx
index 34f379d..141a757 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -187,11 +187,11 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
// Allowed anchorages:
short nAnchor = pSh->GetAnchorId();
- sal_uInt16 nAllowedAnchors = SVX_OBJ_AT_CNTNT | SVX_OBJ_IN_CNTNT | SVX_OBJ_PAGE;
+ SvxAnchorIds nAllowedAnchors = SvxAnchorIds::Paragraph | SvxAnchorIds::Character | SvxAnchorIds::Page;
sal_uInt16 nHtmlMode = ::GetHtmlMode(pSh->GetView().GetDocShell());
if ( pSh->IsFlyInFly() )
- nAllowedAnchors |= SVX_OBJ_AT_FLY;
+ nAllowedAnchors |= SvxAnchorIds::Fly;
if (pObj->GetObjIdentifier() == OBJ_CAPTION )
bCaption = true;
commit ce51b64947f120c592853aec2d01542dcd2cc2c0
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 24 14:37:14 2016 +0200
convert SvxChartStyle to scoped enum
Change-Id: I007dc799777524ccfabbb1ce52b9495437ff9156
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index e77ffd6..1c55877 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -137,7 +137,7 @@ ChartItemPool::ChartItemPool():
ppPoolDefaults[SCHATTR_NUM_OF_LINES_FOR_BAR - SCHATTR_START] = new SfxInt32Item( SCHATTR_NUM_OF_LINES_FOR_BAR, 0 );
ppPoolDefaults[SCHATTR_SPLINE_ORDER - SCHATTR_START] = new SfxInt32Item( SCHATTR_SPLINE_ORDER, 3 );
ppPoolDefaults[SCHATTR_SPLINE_RESOLUTION - SCHATTR_START] = new SfxInt32Item( SCHATTR_SPLINE_RESOLUTION, 20 );
- ppPoolDefaults[SCHATTR_DIAGRAM_STYLE - SCHATTR_START] = new SvxChartStyleItem( CHSTYLE_2D_COLUMN, SCHATTR_DIAGRAM_STYLE );
+ ppPoolDefaults[SCHATTR_DIAGRAM_STYLE - SCHATTR_START] = new SvxChartStyleItem( SvxChartStyle::Column2D, SCHATTR_DIAGRAM_STYLE );
ppPoolDefaults[SCHATTR_GROUP_BARS_PER_AXIS - SCHATTR_START] = new SfxBoolItem(SCHATTR_GROUP_BARS_PER_AXIS, false);
ppPoolDefaults[SCHATTR_STARTING_ANGLE - SCHATTR_START] = new SfxInt32Item( SCHATTR_STARTING_ANGLE, 90 );
ppPoolDefaults[SCHATTR_CLOCKWISE - SCHATTR_START] = new SfxBoolItem( SCHATTR_CLOCKWISE, false );
diff --git a/include/svx/chrtitem.hxx b/include/svx/chrtitem.hxx
index 65ab0eb..2c97d85 100644
--- a/include/svx/chrtitem.hxx
+++ b/include/svx/chrtitem.hxx
@@ -22,14 +22,14 @@
#include <svl/eitem.hxx>
#include <svx/svxdllapi.h>
-enum SvxChartStyle
+enum class SvxChartStyle
{
- CHSTYLE_2D_LINE,
- CHSTYLE_2D_COLUMN,
- CHSTYLE_ADDIN
+ Line2D,
+ Column2D,
+ AddIn
};
-#define CHSTYLE_COUNT (CHSTYLE_ADDIN + 1)
+#define CHSTYLE_COUNT ((sal_uInt16)SvxChartStyle::AddIn + 1)
enum class SvxChartTextOrder
{
@@ -83,7 +83,7 @@ enum class SvxChartRegress
class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxChartStyleItem : public SfxEnumItem
{
public:
- SvxChartStyleItem(SvxChartStyle eStyle /*= CHSTYLE_2D_LINE*/,
+ SvxChartStyleItem(SvxChartStyle eStyle /*= SvxChartStyle::Line2D*/,
sal_uInt16 nId );
SvxChartStyleItem(SvStream& rIn, sal_uInt16 nId );
commit 4c2969b7be7701753386112d477a4b818d834708
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 24 13:55:53 2016 +0200
remove unused SvxChartDataDescr and SvxChartDataDescrItem
unused since
commit 4388503b94cdd305de66ab8e37e9058a160f56ba
Author: Vladimir Glazounov <vg at openoffice.org>
Date: Mon Oct 22 15:56:40 2007 +0000
INTEGRATION: CWS chart14 (1.3.12); FILE MERGED
Change-Id: I4bebb6250efe24a3b85a99441239aa6933156a9e
diff --git a/include/svx/chrtitem.hxx b/include/svx/chrtitem.hxx
index 1fea249..65ab0eb 100644
--- a/include/svx/chrtitem.hxx
+++ b/include/svx/chrtitem.hxx
@@ -31,14 +31,6 @@ enum SvxChartStyle
#define CHSTYLE_COUNT (CHSTYLE_ADDIN + 1)
-enum SvxChartDataDescr
-{
- CHDESCR_NONE,
- CHDESCR_TEXTANDVALUE
-};
-
-#define CHDESCR_COUNT (CHDESCR_TEXTANDVALUE + 1)
-
enum class SvxChartTextOrder
{
SideBySide,
@@ -118,18 +110,6 @@ public:
sal_uInt16 GetVersion (sal_uInt16 nFileFormatVersion) const override;
};
-class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxChartDataDescrItem : public SfxEnumItem
-{
-public:
- SvxChartDataDescrItem(SvStream& rIn,
- sal_uInt16 nId );
-
- virtual SfxPoolItem* Clone(SfxItemPool* pPool = nullptr) const override;
- virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const override;
-
- sal_uInt16 GetValueCount() const override { return CHDESCR_COUNT; }
-};
-
class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxChartTextOrderItem : public SfxEnumItem
{
public:
diff --git a/svx/source/items/chrtitem.cxx b/svx/source/items/chrtitem.cxx
index 9d3de39..192c96d 100644
--- a/svx/source/items/chrtitem.cxx
+++ b/svx/source/items/chrtitem.cxx
@@ -55,23 +55,6 @@ SfxPoolItem* SvxChartStyleItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
return new SvxChartStyleItem(rIn, Which());
}
-SvxChartDataDescrItem::SvxChartDataDescrItem(SvStream& rIn, sal_uInt16 nId) :
- SfxEnumItem(nId, rIn)
-{
-}
-
-
-SfxPoolItem* SvxChartDataDescrItem::Clone(SfxItemPool* /*pPool*/) const
-{
- return new SvxChartDataDescrItem(*this);
-}
-
-
-SfxPoolItem* SvxChartDataDescrItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
-{
- return new SvxChartDataDescrItem(rIn, Which());
-}
-
SvxChartTextOrderItem::SvxChartTextOrderItem(SvxChartTextOrder eOrder,
sal_uInt16 nId) :
SfxEnumItem(nId, (sal_uInt16)eOrder)
commit ac32de25069851369b05a4fa4d831077e5df6940
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 24 13:30:27 2016 +0200
convert SvxChartTextOrder to scoped enum
Change-Id: I09094152cdf4a2756a5775d651dab92042386ee3
diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.cxx b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
index 7aa4a18..8746615 100644
--- a/chart2/source/controller/dialogs/tp_AxisLabel.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
@@ -123,17 +123,17 @@ bool SchAxisLabelTabPage::FillItemSet( SfxItemSet* rOutAttrs )
if( m_bShowStaggeringControls )
{
- SvxChartTextOrder eOrder = CHTXTORDER_SIDEBYSIDE;
+ SvxChartTextOrder eOrder = SvxChartTextOrder::SideBySide;
bool bRadioButtonChecked = true;
if( m_pRbUpDown->IsChecked())
- eOrder = CHTXTORDER_UPDOWN;
+ eOrder = SvxChartTextOrder::UpDown;
else if( m_pRbDownUp->IsChecked())
- eOrder = CHTXTORDER_DOWNUP;
+ eOrder = SvxChartTextOrder::DownUp;
else if( m_pRbAuto->IsChecked())
- eOrder = CHTXTORDER_AUTO;
+ eOrder = SvxChartTextOrder::Auto;
else if( m_pRbSideBySide->IsChecked())
- eOrder = CHTXTORDER_SIDEBYSIDE;
+ eOrder = SvxChartTextOrder::SideBySide;
else
bRadioButtonChecked = false;
@@ -258,16 +258,16 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet* rInAttrs )
switch( eOrder )
{
- case CHTXTORDER_SIDEBYSIDE:
+ case SvxChartTextOrder::SideBySide:
m_pRbSideBySide->Check();
break;
- case CHTXTORDER_UPDOWN:
+ case SvxChartTextOrder::UpDown:
m_pRbUpDown->Check();
break;
- case CHTXTORDER_DOWNUP:
+ case SvxChartTextOrder::DownUp:
m_pRbDownUp->Check();
break;
- case CHTXTORDER_AUTO:
+ case SvxChartTextOrder::Auto:
m_pRbAuto->Check();
break;
}
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index 0470798..e77ffd6 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -121,7 +121,7 @@ ChartItemPool::ChartItemPool():
//axis label
ppPoolDefaults[SCHATTR_AXIS_SHOWDESCR - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_SHOWDESCR,false);
- ppPoolDefaults[SCHATTR_AXIS_LABEL_ORDER - SCHATTR_START] = new SvxChartTextOrderItem(CHTXTORDER_SIDEBYSIDE, SCHATTR_AXIS_LABEL_ORDER);
+ ppPoolDefaults[SCHATTR_AXIS_LABEL_ORDER - SCHATTR_START] = new SvxChartTextOrderItem(SvxChartTextOrder::SideBySide, SCHATTR_AXIS_LABEL_ORDER);
ppPoolDefaults[SCHATTR_AXIS_LABEL_OVERLAP - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_LABEL_OVERLAP,false);
ppPoolDefaults[SCHATTR_AXIS_LABEL_BREAK - SCHATTR_START] = new SfxBoolItem(SCHATTR_AXIS_LABEL_BREAK, false );
diff --git a/include/svx/chrtitem.hxx b/include/svx/chrtitem.hxx
index db12acc..1fea249 100644
--- a/include/svx/chrtitem.hxx
+++ b/include/svx/chrtitem.hxx
@@ -39,17 +39,15 @@ enum SvxChartDataDescr
#define CHDESCR_COUNT (CHDESCR_TEXTANDVALUE + 1)
-enum SvxChartTextOrder
+enum class SvxChartTextOrder
{
- CHTXTORDER_SIDEBYSIDE,
- CHTXTORDER_UPDOWN,
- CHTXTORDER_DOWNUP,
- CHTXTORDER_AUTO
+ SideBySide,
+ UpDown,
+ DownUp,
+ Auto
};
-#define CHTXTORDER_COUNT (CHTXTORDER_AUTO + 1)
-
-#define CHTXTORIENT_COUNT (CHTXTORIENT_TOPBOTTOM + 1)
+#define CHTXTORDER_COUNT ((sal_uInt16)SvxChartTextOrder::Auto + 1)
enum class SvxChartKindError
{
@@ -135,7 +133,7 @@ public:
class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxChartTextOrderItem : public SfxEnumItem
{
public:
- SvxChartTextOrderItem(SvxChartTextOrder eOrder /*= CHTXTORDER_SIDEBYSIDE*/,
+ SvxChartTextOrderItem(SvxChartTextOrder eOrder /*= SvxChartTextOrder::SideBySide*/,
sal_uInt16 nId );
SvxChartTextOrderItem(SvStream& rIn,
sal_uInt16 nId );
diff --git a/svx/source/items/chrtitem.cxx b/svx/source/items/chrtitem.cxx
index de1e732..9d3de39 100644
--- a/svx/source/items/chrtitem.cxx
+++ b/svx/source/items/chrtitem.cxx
@@ -105,13 +105,13 @@ bool SvxChartTextOrderItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMember
switch( eOrder )
{
- case CHTXTORDER_SIDEBYSIDE:
+ case SvxChartTextOrder::SideBySide:
eAO = css::chart::ChartAxisArrangeOrderType_SIDE_BY_SIDE; break;
- case CHTXTORDER_UPDOWN:
+ case SvxChartTextOrder::UpDown:
eAO = css::chart::ChartAxisArrangeOrderType_STAGGER_ODD; break;
- case CHTXTORDER_DOWNUP:
+ case SvxChartTextOrder::DownUp:
eAO = css::chart::ChartAxisArrangeOrderType_STAGGER_EVEN; break;
- case CHTXTORDER_AUTO:
+ case SvxChartTextOrder::Auto:
eAO = css::chart::ChartAxisArrangeOrderType_AUTO; break;
}
@@ -139,13 +139,13 @@ bool SvxChartTextOrderItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMe
switch( eAO )
{
case css::chart::ChartAxisArrangeOrderType_SIDE_BY_SIDE:
- eOrder = CHTXTORDER_SIDEBYSIDE; break;
+ eOrder = SvxChartTextOrder::SideBySide; break;
case css::chart::ChartAxisArrangeOrderType_STAGGER_ODD:
- eOrder = CHTXTORDER_UPDOWN; break;
+ eOrder = SvxChartTextOrder::UpDown; break;
case css::chart::ChartAxisArrangeOrderType_STAGGER_EVEN:
- eOrder = CHTXTORDER_DOWNUP; break;
+ eOrder = SvxChartTextOrder::DownUp; break;
case css::chart::ChartAxisArrangeOrderType_AUTO:
- eOrder = CHTXTORDER_AUTO; break;
+ eOrder = SvxChartTextOrder::Auto; break;
default:
return false;
}
commit 7db7666f01d81c1c345380ff724356224e9e1db6
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 24 13:27:33 2016 +0200
convert SvxChartKindError to scoped enum
Change-Id: Ibf6798fb1bdb7d16801402798414171876da915d
diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx
index 8e35487..0294813 100644
--- a/chart2/source/controller/dialogs/res_ErrorBar.cxx
+++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx
@@ -52,22 +52,22 @@ sal_uInt16 lcl_getLbEntryPosByErrorKind( SvxChartKindError eErrorKind )
switch( eErrorKind )
{
// for these cases select the default in the list box
- case CHERROR_NONE:
- case CHERROR_PERCENT:
- case CHERROR_CONST:
- case CHERROR_RANGE:
+ case SvxChartKindError::NONE:
+ case SvxChartKindError::Percent:
+ case SvxChartKindError::Const:
+ case SvxChartKindError::Range:
nResult = CHART_LB_FUNCTION_STD_DEV;
break;
- case CHERROR_VARIANT:
+ case SvxChartKindError::Variant:
nResult = CHART_LB_FUNCTION_VARIANCE;
break;
- case CHERROR_SIGMA:
+ case SvxChartKindError::Sigma:
nResult = CHART_LB_FUNCTION_STD_DEV;
break;
- case CHERROR_BIGERROR:
+ case SvxChartKindError::BigError:
nResult = CHART_LB_FUNCTION_ERROR_MARGIN;
break;
- case CHERROR_STDERROR:
+ case SvxChartKindError::StdError:
nResult = CHART_LB_FUNCTION_STD_ERROR;
break;
}
@@ -81,7 +81,7 @@ namespace chart
ErrorBarResources::ErrorBarResources( VclBuilderContainer* pParent, Dialog * pParentDialog,
const SfxItemSet& rInAttrs, bool bNoneAvailable,
tErrorBarType eType /* = ERROR_BAR_Y */ ) :
- m_eErrorKind( CHERROR_NONE ),
+ m_eErrorKind( SvxChartKindError::NONE ),
m_eIndicate( SvxChartIndicate::Both ),
m_bErrorKindUnique( true ),
m_bIndicatorUnique( true ),
@@ -351,13 +351,13 @@ IMPL_LINK_NOARG_TYPED( ErrorBarResources, CategoryChosen, Button*, void )
SvxChartKindError eOldError = m_eErrorKind;
if( m_pRbNone->IsChecked())
- m_eErrorKind = CHERROR_NONE;
+ m_eErrorKind = SvxChartKindError::NONE;
else if( m_pRbConst->IsChecked())
- m_eErrorKind = CHERROR_CONST;
+ m_eErrorKind = SvxChartKindError::Const;
else if( m_pRbPercent->IsChecked())
- m_eErrorKind = CHERROR_PERCENT;
+ m_eErrorKind = SvxChartKindError::Percent;
else if( m_pRbRange->IsChecked())
- m_eErrorKind = CHERROR_RANGE;
+ m_eErrorKind = SvxChartKindError::Range;
else if( m_pRbFunction->IsChecked())
{
if( m_pLbFunction->GetSelectEntryCount() == 1 )
@@ -365,13 +365,13 @@ IMPL_LINK_NOARG_TYPED( ErrorBarResources, CategoryChosen, Button*, void )
switch( m_pLbFunction->GetSelectEntryPos())
{
case CHART_LB_FUNCTION_STD_ERROR:
- m_eErrorKind = CHERROR_STDERROR; break;
+ m_eErrorKind = SvxChartKindError::StdError; break;
case CHART_LB_FUNCTION_STD_DEV:
- m_eErrorKind = CHERROR_SIGMA; break;
+ m_eErrorKind = SvxChartKindError::Sigma; break;
case CHART_LB_FUNCTION_VARIANCE:
- m_eErrorKind = CHERROR_VARIANT; break;
+ m_eErrorKind = SvxChartKindError::Variant; break;
case CHART_LB_FUNCTION_ERROR_MARGIN:
- m_eErrorKind = CHERROR_BIGERROR; break;
+ m_eErrorKind = SvxChartKindError::BigError; break;
default:
m_bErrorKindUnique = false;
}
@@ -386,16 +386,16 @@ IMPL_LINK_NOARG_TYPED( ErrorBarResources, CategoryChosen, Button*, void )
}
// changed to range
- if( m_eErrorKind == CHERROR_RANGE &&
- eOldError != CHERROR_RANGE )
+ if( m_eErrorKind == SvxChartKindError::Range &&
+ eOldError != SvxChartKindError::Range )
{
m_pCbSyncPosNeg->Check(
(!m_pEdRangePositive->GetText().isEmpty()) &&
m_pEdRangePositive->GetText() == m_pEdRangeNegative->GetText());
}
// changed from range
- else if( m_eErrorKind != CHERROR_RANGE &&
- eOldError == CHERROR_RANGE )
+ else if( m_eErrorKind != SvxChartKindError::Range &&
+ eOldError == SvxChartKindError::Range )
{
m_pCbSyncPosNeg->Check( m_pMfPositive->GetValue() == m_pMfNegative->GetValue());
}
@@ -490,7 +490,7 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
const SfxPoolItem *pPoolItem = nullptr;
// category
- m_eErrorKind = CHERROR_NONE;
+ m_eErrorKind = SvxChartKindError::NONE;
SfxItemState aState = rInAttrs.GetItemState( SCHATTR_STAT_KIND_ERROR, true, &pPoolItem );
m_bErrorKindUnique = ( aState != SfxItemState::DONTCARE );
@@ -503,22 +503,22 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
{
switch( m_eErrorKind )
{
- case CHERROR_NONE:
+ case SvxChartKindError::NONE:
m_pRbNone->Check();
break;
- case CHERROR_PERCENT:
+ case SvxChartKindError::Percent:
m_pRbPercent->Check();
break;
- case CHERROR_CONST:
+ case SvxChartKindError::Const:
m_pRbConst->Check();
break;
- case CHERROR_STDERROR:
- case CHERROR_VARIANT:
- case CHERROR_SIGMA:
- case CHERROR_BIGERROR:
+ case SvxChartKindError::StdError:
+ case SvxChartKindError::Variant:
+ case SvxChartKindError::Sigma:
+ case SvxChartKindError::BigError:
m_pRbFunction->Check();
break;
- case CHERROR_RANGE:
+ case SvxChartKindError::Range:
m_pRbRange->Check();
break;
}
@@ -545,7 +545,7 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
{
m_fMinusValue = static_cast<const SvxDoubleItem*>(pPoolItem)->GetValue();
- if( m_eErrorKind != CHERROR_RANGE &&
+ if( m_eErrorKind != SvxChartKindError::Range &&
m_fPlusValue == m_fMinusValue )
m_pCbSyncPosNeg->Check();
}
@@ -594,7 +594,7 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
{
OUString sRangeNegative = (static_cast< const SfxStringItem * >( pPoolItem ))->GetValue();
m_pEdRangeNegative->SetText( sRangeNegative );
- if( m_eErrorKind == CHERROR_RANGE &&
+ if( m_eErrorKind == SvxChartKindError::Range &&
!sRangeNegative.isEmpty() &&
sRangeNegative == m_pEdRangePositive->GetText() )
m_pCbSyncPosNeg->Check();
@@ -612,7 +612,7 @@ bool ErrorBarResources::FillItemSet(SfxItemSet& rOutAttrs) const
if( m_bErrorKindUnique )
{
- if( m_eErrorKind == CHERROR_RANGE )
+ if( m_eErrorKind == SvxChartKindError::Range )
{
OUString aPosRange;
OUString aNegRange;
@@ -637,9 +637,9 @@ bool ErrorBarResources::FillItemSet(SfxItemSet& rOutAttrs) const
if( m_bRangeNegUnique )
rOutAttrs.Put( SfxStringItem( SCHATTR_STAT_RANGE_NEG, aNegRange ));
}
- else if( m_eErrorKind == CHERROR_CONST ||
- m_eErrorKind == CHERROR_PERCENT ||
- m_eErrorKind == CHERROR_BIGERROR )
+ else if( m_eErrorKind == SvxChartKindError::Const ||
+ m_eErrorKind == SvxChartKindError::Percent ||
+ m_eErrorKind == SvxChartKindError::BigError )
{
double fPosValue = static_cast< double >( m_pMfPositive->GetValue()) /
pow( 10.0, m_pMfPositive->GetDecimalDigits());
diff --git a/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx
index ff6a1b9..d5cc3ad 100644
--- a/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx
@@ -155,7 +155,7 @@ bool ErrorBarItemConverter::ApplySpecialItem(
static_cast< const SvxChartKindErrorItem & >(
rItemSet.Get( nWhichId )).GetValue();
- if( !xErrorBarProp.is() && eErrorKind == CHERROR_NONE)
+ if( !xErrorBarProp.is() && eErrorKind == SvxChartKindError::NONE)
{
//nothing to do
}
@@ -165,21 +165,21 @@ bool ErrorBarItemConverter::ApplySpecialItem(
switch( eErrorKind )
{
- case CHERROR_NONE:
+ case SvxChartKindError::NONE:
nStyle = css::chart::ErrorBarStyle::NONE; break;
- case CHERROR_VARIANT:
+ case SvxChartKindError::Variant:
nStyle = css::chart::ErrorBarStyle::VARIANCE; break;
- case CHERROR_SIGMA:
+ case SvxChartKindError::Sigma:
nStyle = css::chart::ErrorBarStyle::STANDARD_DEVIATION; break;
- case CHERROR_PERCENT:
+ case SvxChartKindError::Percent:
nStyle = css::chart::ErrorBarStyle::RELATIVE; break;
- case CHERROR_BIGERROR:
+ case SvxChartKindError::BigError:
nStyle = css::chart::ErrorBarStyle::ERROR_MARGIN; break;
- case CHERROR_CONST:
+ case SvxChartKindError::Const:
nStyle = css::chart::ErrorBarStyle::ABSOLUTE; break;
- case CHERROR_STDERROR:
+ case SvxChartKindError::StdError:
nStyle = css::chart::ErrorBarStyle::STANDARD_ERROR; break;
- case CHERROR_RANGE:
+ case SvxChartKindError::Range:
nStyle = css::chart::ErrorBarStyle::FROM_DATA; break;
}
@@ -337,7 +337,7 @@ void ErrorBarItemConverter::FillSpecialItem(
{
case SCHATTR_STAT_KIND_ERROR:
{
- SvxChartKindError eErrorKind = CHERROR_NONE;
+ SvxChartKindError eErrorKind = SvxChartKindError::NONE;
uno::Reference< beans::XPropertySet > xErrorBarProp( GetPropertySet());
sal_Int32 nStyle = 0;
@@ -348,19 +348,19 @@ void ErrorBarItemConverter::FillSpecialItem(
case css::chart::ErrorBarStyle::NONE:
break;
case css::chart::ErrorBarStyle::VARIANCE:
- eErrorKind = CHERROR_VARIANT; break;
+ eErrorKind = SvxChartKindError::Variant; break;
case css::chart::ErrorBarStyle::STANDARD_DEVIATION:
- eErrorKind = CHERROR_SIGMA; break;
+ eErrorKind = SvxChartKindError::Sigma; break;
case css::chart::ErrorBarStyle::ABSOLUTE:
- eErrorKind = CHERROR_CONST; break;
+ eErrorKind = SvxChartKindError::Const; break;
case css::chart::ErrorBarStyle::RELATIVE:
- eErrorKind = CHERROR_PERCENT; break;
+ eErrorKind = SvxChartKindError::Percent; break;
case css::chart::ErrorBarStyle::ERROR_MARGIN:
- eErrorKind = CHERROR_BIGERROR; break;
+ eErrorKind = SvxChartKindError::BigError; break;
case css::chart::ErrorBarStyle::STANDARD_ERROR:
- eErrorKind = CHERROR_STDERROR; break;
+ eErrorKind = SvxChartKindError::StdError; break;
case css::chart::ErrorBarStyle::FROM_DATA:
- eErrorKind = CHERROR_RANGE; break;
+ eErrorKind = SvxChartKindError::Range; break;
}
}
rOutItemSet.Put( SvxChartKindErrorItem( eErrorKind, SCHATTR_STAT_KIND_ERROR ));
diff --git a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
index 20c9ce2..921f033 100644
--- a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
@@ -295,7 +295,7 @@ bool StatisticsItemConverter::ApplySpecialItem(
static_cast< const SvxChartKindErrorItem & >(
rItemSet.Get( nWhichId )).GetValue();
- if( !xErrorBarProp.is() && eErrorKind == CHERROR_NONE)
+ if( !xErrorBarProp.is() && eErrorKind == SvxChartKindError::NONE)
{
//nothing to do
}
@@ -305,21 +305,21 @@ bool StatisticsItemConverter::ApplySpecialItem(
switch( eErrorKind )
{
- case CHERROR_NONE:
+ case SvxChartKindError::NONE:
nStyle = css::chart::ErrorBarStyle::NONE; break;
- case CHERROR_VARIANT:
+ case SvxChartKindError::Variant:
nStyle = css::chart::ErrorBarStyle::VARIANCE; break;
- case CHERROR_SIGMA:
+ case SvxChartKindError::Sigma:
nStyle = css::chart::ErrorBarStyle::STANDARD_DEVIATION; break;
- case CHERROR_PERCENT:
+ case SvxChartKindError::Percent:
nStyle = css::chart::ErrorBarStyle::RELATIVE; break;
- case CHERROR_BIGERROR:
+ case SvxChartKindError::BigError:
nStyle = css::chart::ErrorBarStyle::ERROR_MARGIN; break;
- case CHERROR_CONST:
+ case SvxChartKindError::Const:
nStyle = css::chart::ErrorBarStyle::ABSOLUTE; break;
- case CHERROR_STDERROR:
+ case SvxChartKindError::StdError:
nStyle = css::chart::ErrorBarStyle::STANDARD_ERROR; break;
- case CHERROR_RANGE:
+ case SvxChartKindError::Range:
nStyle = css::chart::ErrorBarStyle::FROM_DATA; break;
}
@@ -634,7 +634,7 @@ void StatisticsItemConverter::FillSpecialItem(
{
bool bYError =
static_cast<const SfxBoolItem&>(rOutItemSet.Get(SCHATTR_STAT_ERRORBAR_TYPE)).GetValue();
- SvxChartKindError eErrorKind = CHERROR_NONE;
+ SvxChartKindError eErrorKind = SvxChartKindError::NONE;
uno::Reference< beans::XPropertySet > xErrorBarProp(
lcl_GetErrorBar( GetPropertySet(), bYError));
if( xErrorBarProp.is() )
@@ -647,19 +647,19 @@ void StatisticsItemConverter::FillSpecialItem(
case css::chart::ErrorBarStyle::NONE:
break;
case css::chart::ErrorBarStyle::VARIANCE:
- eErrorKind = CHERROR_VARIANT; break;
+ eErrorKind = SvxChartKindError::Variant; break;
case css::chart::ErrorBarStyle::STANDARD_DEVIATION:
- eErrorKind = CHERROR_SIGMA; break;
+ eErrorKind = SvxChartKindError::Sigma; break;
case css::chart::ErrorBarStyle::ABSOLUTE:
- eErrorKind = CHERROR_CONST; break;
+ eErrorKind = SvxChartKindError::Const; break;
case css::chart::ErrorBarStyle::RELATIVE:
- eErrorKind = CHERROR_PERCENT; break;
+ eErrorKind = SvxChartKindError::Percent; break;
case css::chart::ErrorBarStyle::ERROR_MARGIN:
- eErrorKind = CHERROR_BIGERROR; break;
+ eErrorKind = SvxChartKindError::BigError; break;
case css::chart::ErrorBarStyle::STANDARD_ERROR:
- eErrorKind = CHERROR_STDERROR; break;
+ eErrorKind = SvxChartKindError::StdError; break;
case css::chart::ErrorBarStyle::FROM_DATA:
- eErrorKind = CHERROR_RANGE; break;
+ eErrorKind = SvxChartKindError::Range; break;
}
}
}
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index ac0c8fc..0470798 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -66,7 +66,7 @@ ChartItemPool::ChartItemPool():
//statistic
ppPoolDefaults[SCHATTR_STAT_AVERAGE - SCHATTR_START] = new SfxBoolItem (SCHATTR_STAT_AVERAGE);
- ppPoolDefaults[SCHATTR_STAT_KIND_ERROR - SCHATTR_START] = new SvxChartKindErrorItem (CHERROR_NONE, SCHATTR_STAT_KIND_ERROR);
+ ppPoolDefaults[SCHATTR_STAT_KIND_ERROR - SCHATTR_START] = new SvxChartKindErrorItem (SvxChartKindError::NONE, SCHATTR_STAT_KIND_ERROR);
ppPoolDefaults[SCHATTR_STAT_PERCENT - SCHATTR_START] = new SvxDoubleItem (0.0, SCHATTR_STAT_PERCENT);
ppPoolDefaults[SCHATTR_STAT_BIGERROR - SCHATTR_START] = new SvxDoubleItem (0.0, SCHATTR_STAT_BIGERROR);
ppPoolDefaults[SCHATTR_STAT_CONSTPLUS - SCHATTR_START] = new SvxDoubleItem (0.0, SCHATTR_STAT_CONSTPLUS);
diff --git a/include/svx/chrtitem.hxx b/include/svx/chrtitem.hxx
index 71310c4..db12acc 100644
--- a/include/svx/chrtitem.hxx
+++ b/include/svx/chrtitem.hxx
@@ -51,19 +51,19 @@ enum SvxChartTextOrder
#define CHTXTORIENT_COUNT (CHTXTORIENT_TOPBOTTOM + 1)
-enum SvxChartKindError
+enum class SvxChartKindError
{
- CHERROR_NONE,
- CHERROR_VARIANT,
- CHERROR_SIGMA,
- CHERROR_PERCENT,
- CHERROR_BIGERROR,
- CHERROR_CONST,
- CHERROR_STDERROR,
- CHERROR_RANGE
+ NONE,
+ Variant,
+ Sigma,
+ Percent,
+ BigError,
+ Const,
+ StdError,
+ Range
};
-#define CHERROR_COUNT (CHERROR_RANGE + 1)
+#define CHERROR_COUNT ((sal_uInt16)SvxChartKindError::Range + 1)
enum class SvxChartIndicate
{
@@ -166,7 +166,7 @@ public:
class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxChartKindErrorItem : public SfxEnumItem
{
public:
- SvxChartKindErrorItem(SvxChartKindError /*eOrient = CHERROR_NONE*/,
+ SvxChartKindErrorItem(SvxChartKindError /*eOrient = SvxChartKindError::NONE*/,
sal_uInt16 nId );
SvxChartKindErrorItem(SvStream& rIn,
sal_uInt16 nId );
commit 9781212b55a3a8afd3e00cd0400725e38babfbdf
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 24 13:24:34 2016 +0200
convert SvxChartIndicate to scoped enum
Change-Id: I65183bd4ce21544608397164fc2660830378d975
diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx
index 1ed9bb5..8e35487 100644
--- a/chart2/source/controller/dialogs/res_ErrorBar.cxx
+++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx
@@ -82,7 +82,7 @@ ErrorBarResources::ErrorBarResources( VclBuilderContainer* pParent, Dialog * pPa
const SfxItemSet& rInAttrs, bool bNoneAvailable,
tErrorBarType eType /* = ERROR_BAR_Y */ ) :
m_eErrorKind( CHERROR_NONE ),
- m_eIndicate( CHINDICATE_BOTH ),
+ m_eIndicate( SvxChartIndicate::Both ),
m_bErrorKindUnique( true ),
m_bIndicatorUnique( true ),
m_bPlusUnique( true ),
@@ -427,11 +427,11 @@ IMPL_LINK_NOARG_TYPED(ErrorBarResources, IndicatorChanged, Button*, void)
{
m_bIndicatorUnique = true;
if( m_pRbBoth->IsChecked())
- m_eIndicate = CHINDICATE_BOTH;
+ m_eIndicate = SvxChartIndicate::Both;
else if( m_pRbPositive->IsChecked())
- m_eIndicate = CHINDICATE_UP;
+ m_eIndicate = SvxChartIndicate::Up;
else if( m_pRbNegative->IsChecked())
- m_eIndicate = CHINDICATE_DOWN;
+ m_eIndicate = SvxChartIndicate::Down;
else
m_bIndicatorUnique = false;
@@ -560,15 +560,15 @@ void ErrorBarResources::Reset(const SfxItemSet& rInAttrs)
{
switch( m_eIndicate )
{
- case CHINDICATE_NONE :
+ case SvxChartIndicate::NONE :
// no longer used, use both as default
- m_eIndicate = CHINDICATE_BOTH;
+ m_eIndicate = SvxChartIndicate::Both;
SAL_FALLTHROUGH; // to BOTH
- case CHINDICATE_BOTH :
+ case SvxChartIndicate::Both :
m_pRbBoth->Check(); break;
- case CHINDICATE_UP :
+ case SvxChartIndicate::Up :
m_pRbPositive->Check(); break;
- case CHINDICATE_DOWN :
+ case SvxChartIndicate::Down :
m_pRbNegative->Check(); break;
}
}
diff --git a/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx
index e609ac9..ff6a1b9 100644
--- a/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx
@@ -253,8 +253,8 @@ bool ErrorBarItemConverter::ApplySpecialItem(
static_cast< const SvxChartIndicateItem & >(
rItemSet.Get( nWhichId )).GetValue();
- bool bNewIndPos = (eIndicate == CHINDICATE_BOTH || eIndicate == CHINDICATE_UP );
- bool bNewIndNeg = (eIndicate == CHINDICATE_BOTH || eIndicate == CHINDICATE_DOWN );
+ bool bNewIndPos = (eIndicate == SvxChartIndicate::Both || eIndicate == SvxChartIndicate::Up );
+ bool bNewIndNeg = (eIndicate == SvxChartIndicate::Both || eIndicate == SvxChartIndicate::Down );
bool bShowPos(false), bShowNeg(false);
lcl_getErrorIndicatorValues( xErrorBarProp, bShowPos, bShowNeg );
@@ -401,23 +401,23 @@ void ErrorBarItemConverter::FillSpecialItem(
case SCHATTR_STAT_INDICATE:
{
- SvxChartIndicate eIndicate = CHINDICATE_BOTH;
+ SvxChartIndicate eIndicate = SvxChartIndicate::Both;
bool bShowPos(false), bShowNeg(false);
lcl_getErrorIndicatorValues( GetPropertySet(), bShowPos, bShowNeg );
if( bShowPos )
{
if( bShowNeg )
- eIndicate = CHINDICATE_BOTH;
+ eIndicate = SvxChartIndicate::Both;
else
- eIndicate = CHINDICATE_UP;
+ eIndicate = SvxChartIndicate::Up;
}
else
{
if( bShowNeg )
- eIndicate = CHINDICATE_DOWN;
+ eIndicate = SvxChartIndicate::Down;
else
- eIndicate = CHINDICATE_NONE;
+ eIndicate = SvxChartIndicate::NONE;
}
rOutItemSet.Put( SvxChartIndicateItem( eIndicate, SCHATTR_STAT_INDICATE ));
}
diff --git a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
index cdea973..20c9ce2 100644
--- a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
@@ -540,8 +540,8 @@ bool StatisticsItemConverter::ApplySpecialItem(
static_cast< const SvxChartIndicateItem & >(
rItemSet.Get( nWhichId )).GetValue();
- bool bNewIndPos = (eIndicate == CHINDICATE_BOTH || eIndicate == CHINDICATE_UP );
- bool bNewIndNeg = (eIndicate == CHINDICATE_BOTH || eIndicate == CHINDICATE_DOWN );
+ bool bNewIndPos = (eIndicate == SvxChartIndicate::Both || eIndicate == SvxChartIndicate::Up );
+ bool bNewIndNeg = (eIndicate == SvxChartIndicate::Both || eIndicate == SvxChartIndicate::Down );
bool bShowPos(false), bShowNeg(false);
lcl_getErrorIndicatorValues( xErrorBarProp, bShowPos, bShowNeg );
@@ -816,7 +816,7 @@ void StatisticsItemConverter::FillSpecialItem(
bool bYError =
static_cast<const SfxBoolItem&>(rOutItemSet.Get(SCHATTR_STAT_ERRORBAR_TYPE)).GetValue();
uno::Reference< beans::XPropertySet > xErrorBarProp( lcl_GetErrorBar( GetPropertySet(),bYError));
- SvxChartIndicate eIndicate = CHINDICATE_BOTH;
+ SvxChartIndicate eIndicate = SvxChartIndicate::Both;
if( xErrorBarProp.is())
{
bool bShowPos(false), bShowNeg(false);
@@ -825,16 +825,16 @@ void StatisticsItemConverter::FillSpecialItem(
if( bShowPos )
{
if( bShowNeg )
- eIndicate = CHINDICATE_BOTH;
+ eIndicate = SvxChartIndicate::Both;
else
- eIndicate = CHINDICATE_UP;
+ eIndicate = SvxChartIndicate::Up;
}
else
{
if( bShowNeg )
- eIndicate = CHINDICATE_DOWN;
+ eIndicate = SvxChartIndicate::Down;
else
- eIndicate = CHINDICATE_NONE;
+ eIndicate = SvxChartIndicate::NONE;
}
}
rOutItemSet.Put( SvxChartIndicateItem( eIndicate, SCHATTR_STAT_INDICATE ));
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index 0601bac..ac0c8fc 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -71,7 +71,7 @@ ChartItemPool::ChartItemPool():
ppPoolDefaults[SCHATTR_STAT_BIGERROR - SCHATTR_START] = new SvxDoubleItem (0.0, SCHATTR_STAT_BIGERROR);
ppPoolDefaults[SCHATTR_STAT_CONSTPLUS - SCHATTR_START] = new SvxDoubleItem (0.0, SCHATTR_STAT_CONSTPLUS);
ppPoolDefaults[SCHATTR_STAT_CONSTMINUS - SCHATTR_START] = new SvxDoubleItem (0.0, SCHATTR_STAT_CONSTMINUS);
- ppPoolDefaults[SCHATTR_STAT_INDICATE - SCHATTR_START] = new SvxChartIndicateItem (CHINDICATE_NONE, SCHATTR_STAT_INDICATE);
+ ppPoolDefaults[SCHATTR_STAT_INDICATE - SCHATTR_START] = new SvxChartIndicateItem (SvxChartIndicate::NONE, SCHATTR_STAT_INDICATE);
ppPoolDefaults[SCHATTR_STAT_RANGE_POS - SCHATTR_START] = new SfxStringItem (SCHATTR_STAT_RANGE_POS, OUString());
ppPoolDefaults[SCHATTR_STAT_RANGE_NEG - SCHATTR_START] = new SfxStringItem (SCHATTR_STAT_RANGE_NEG, OUString());
ppPoolDefaults[SCHATTR_STAT_ERRORBAR_TYPE - SCHATTR_START] = new SfxBoolItem(SCHATTR_STAT_ERRORBAR_TYPE, true);
diff --git a/include/svx/chrtitem.hxx b/include/svx/chrtitem.hxx
index 3d83658..71310c4 100644
--- a/include/svx/chrtitem.hxx
+++ b/include/svx/chrtitem.hxx
@@ -65,15 +65,15 @@ enum SvxChartKindError
#define CHERROR_COUNT (CHERROR_RANGE + 1)
-enum SvxChartIndicate
+enum class SvxChartIndicate
{
- CHINDICATE_NONE,
- CHINDICATE_BOTH,
- CHINDICATE_UP,
- CHINDICATE_DOWN
+ NONE,
+ Both,
+ Up,
+ Down
};
-#define CHINDICATE_COUNT (CHINDICATE_DOWN + 1)
+#define CHINDICATE_COUNT ((sal_uInt16)SvxChartIndicate::Down + 1)
enum class SvxChartRegress
{
@@ -184,7 +184,7 @@ public:
class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxChartIndicateItem : public SfxEnumItem
{
public:
- SvxChartIndicateItem(SvxChartIndicate eOrient /*= CHINDICATE_NONE*/,
+ SvxChartIndicateItem(SvxChartIndicate eOrient /*= SvxChartIndicate::NONE*/,
sal_uInt16 nId );
SvxChartIndicateItem(SvStream& rIn,
sal_uInt16 nId );
commit 2927a5c1c70b66062cc2b60f6f4eb7cf6c727d2c
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 24 13:21:36 2016 +0200
convert SvxChartRegress to scoped enum
Change-Id: Ibdaad10c7936a0e53ab61c2016c8c9f3ac278767
diff --git a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
index d81103e..3a4c801 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
@@ -60,22 +60,22 @@ css::chart::ChartRegressionCurveType lcl_getRegressionCurveType(SvxChartRegress
css::chart::ChartRegressionCurveType eRet = css::chart::ChartRegressionCurveType_NONE;
switch(eRegressionType)
{
- case CHREGRESS_LINEAR:
+ case SvxChartRegress::Linear:
eRet = css::chart::ChartRegressionCurveType_LINEAR;
break;
- case CHREGRESS_LOG:
+ case SvxChartRegress::Log:
eRet = css::chart::ChartRegressionCurveType_LOGARITHM;
break;
- case CHREGRESS_EXP:
+ case SvxChartRegress::Exp:
eRet = css::chart::ChartRegressionCurveType_EXPONENTIAL;
break;
- case CHREGRESS_POWER:
+ case SvxChartRegress::Power:
eRet = css::chart::ChartRegressionCurveType_POWER;
break;
- case CHREGRESS_POLYNOMIAL:
+ case SvxChartRegress::Polynomial:
eRet = css::chart::ChartRegressionCurveType_POLYNOMIAL;
break;
- /*case CHREGRESS_MOVING_AVERAGE:
+ /*case SvxChartRegress::MovingAverage:
eRet = css::chart::ChartRegressionCurveType_MOVING_AVERAGE;
break;*/
default:
@@ -91,21 +91,21 @@ SvxChartRegress lcl_getRegressionType( css::chart::ChartRegressionCurveType eReg
switch (eRegressionCurveType)
{
case css::chart::ChartRegressionCurveType_LINEAR:
- eRet = CHREGRESS_LINEAR;
+ eRet = SvxChartRegress::Linear;
break;
case css::chart::ChartRegressionCurveType_LOGARITHM:
- eRet = CHREGRESS_LOG;
+ eRet = SvxChartRegress::Log;
break;
case css::chart::ChartRegressionCurveType_EXPONENTIAL:
- eRet = CHREGRESS_EXP;
+ eRet = SvxChartRegress::Exp;
break;
case css::chart::ChartRegressionCurveType_POLYNOMIAL:
//case css::chart::ChartRegressionCurveType_MOVING_AVERAGE:
case css::chart::ChartRegressionCurveType_POWER:
- eRet = CHREGRESS_POWER;
+ eRet = SvxChartRegress::Power;
break;
default:
- eRet = CHREGRESS_NONE;
+ eRet = SvxChartRegress::NONE;
break;
}
return eRet;
diff --git a/chart2/source/controller/dialogs/res_Trendline.cxx b/chart2/source/controller/dialogs/res_Trendline.cxx
index dbd77e6..034a63b 100644
--- a/chart2/source/controller/dialogs/res_Trendline.cxx
+++ b/chart2/source/controller/dialogs/res_Trendline.cxx
@@ -40,7 +40,7 @@ void lcl_setValue( FormattedField& rFmtField, double fValue )
}
TrendlineResources::TrendlineResources( vcl::Window * pParent, const SfxItemSet& rInAttrs ) :
- m_eTrendLineType( CHREGRESS_LINEAR ),
+ m_eTrendLineType( SvxChartRegress::Linear ),
m_bTrendLineUnique( true ),
m_pNumFormatter( nullptr ),
m_nNbPoints( 0 )
@@ -96,17 +96,17 @@ TrendlineResources::~TrendlineResources()
IMPL_LINK_TYPED( TrendlineResources, SelectTrendLine, Button *, pRadioButton, void )
{
if( pRadioButton == m_pRB_Linear )
- m_eTrendLineType = CHREGRESS_LINEAR;
+ m_eTrendLineType = SvxChartRegress::Linear;
else if( pRadioButton == m_pRB_Logarithmic )
- m_eTrendLineType = CHREGRESS_LOG;
+ m_eTrendLineType = SvxChartRegress::Log;
else if( pRadioButton == m_pRB_Exponential )
- m_eTrendLineType = CHREGRESS_EXP;
+ m_eTrendLineType = SvxChartRegress::Exp;
else if( pRadioButton == m_pRB_Power )
- m_eTrendLineType = CHREGRESS_POWER;
+ m_eTrendLineType = SvxChartRegress::Power;
else if( pRadioButton == m_pRB_Polynomial )
- m_eTrendLineType = CHREGRESS_POLYNOMIAL;
+ m_eTrendLineType = SvxChartRegress::Polynomial;
else if( pRadioButton == m_pRB_MovingAverage )
- m_eTrendLineType = CHREGRESS_MOVING_AVERAGE;
+ m_eTrendLineType = SvxChartRegress::MovingAverage;
m_bTrendLineUnique = true;
UpdateControlStates();
@@ -239,22 +239,22 @@ void TrendlineResources::Reset( const SfxItemSet& rInAttrs )
{
switch( m_eTrendLineType )
{
- case CHREGRESS_LINEAR :
+ case SvxChartRegress::Linear :
m_pRB_Linear->Check();
break;
- case CHREGRESS_LOG :
+ case SvxChartRegress::Log :
m_pRB_Logarithmic->Check();
break;
- case CHREGRESS_EXP :
+ case SvxChartRegress::Exp :
m_pRB_Exponential->Check();
break;
- case CHREGRESS_POWER :
+ case SvxChartRegress::Power :
m_pRB_Power->Check();
break;
- case CHREGRESS_POLYNOMIAL :
+ case SvxChartRegress::Polynomial :
m_pRB_Polynomial->Check();
break;
- case CHREGRESS_MOVING_AVERAGE :
+ case SvxChartRegress::MovingAverage :
m_pRB_MovingAverage->Check();
break;
default:
@@ -329,10 +329,10 @@ void TrendlineResources::UpdateControlStates()
m_pNF_Degree->SetMax( nMaxValue );
m_pNF_Period->SetMax( m_nNbPoints - 1 );
}
- bool bMovingAverage = ( m_eTrendLineType == CHREGRESS_MOVING_AVERAGE );
- bool bInterceptAvailable = ( m_eTrendLineType == CHREGRESS_LINEAR )
- || ( m_eTrendLineType == CHREGRESS_POLYNOMIAL )
- || ( m_eTrendLineType == CHREGRESS_EXP );
+ bool bMovingAverage = ( m_eTrendLineType == SvxChartRegress::MovingAverage );
+ bool bInterceptAvailable = ( m_eTrendLineType == SvxChartRegress::Linear )
+ || ( m_eTrendLineType == SvxChartRegress::Polynomial )
+ || ( m_eTrendLineType == SvxChartRegress::Exp );
m_pFmtFld_ExtrapolateForward->Enable( !bMovingAverage );
m_pFmtFld_ExtrapolateBackward->Enable( !bMovingAverage );
m_pCB_SetIntercept->Enable( bInterceptAvailable );
diff --git a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
index b99d19a..cdea973 100644
--- a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
@@ -118,12 +118,12 @@ uno::Reference< beans::XPropertySet > lcl_getEquationProperties(
// ensure that a trendline is on
if( pItemSet )
{
- SvxChartRegress eRegress = CHREGRESS_NONE;
+ SvxChartRegress eRegress = SvxChartRegress::NONE;
const SfxPoolItem *pPoolItem = nullptr;
if( pItemSet->GetItemState( SCHATTR_REGRESSION_TYPE, true, &pPoolItem ) == SfxItemState::SET )
{
eRegress = static_cast< const SvxChartRegressItem * >( pPoolItem )->GetValue();
- bEquationExists = ( eRegress != CHREGRESS_NONE );
+ bEquationExists = ( eRegress != SvxChartRegress::NONE );
}
}
@@ -149,12 +149,12 @@ uno::Reference< beans::XPropertySet > lcl_getCurveProperties(
// ensure that a trendline is on
if( pItemSet )
{
- SvxChartRegress eRegress = CHREGRESS_NONE;
+ SvxChartRegress eRegress = SvxChartRegress::NONE;
const SfxPoolItem *pPoolItem = nullptr;
if( pItemSet->GetItemState( SCHATTR_REGRESSION_TYPE, true, &pPoolItem ) == SfxItemState::SET )
{
eRegress = static_cast< const SvxChartRegressItem * >( pPoolItem )->GetValue();
- bExists = ( eRegress != CHREGRESS_NONE );
+ bExists = ( eRegress != SvxChartRegress::NONE );
}
}
@@ -420,7 +420,7 @@ bool StatisticsItemConverter::ApplySpecialItem(
uno::Reference< chart2::XRegressionCurve > xCurve( GetPropertySet(), uno::UNO_QUERY );
uno::Reference< chart2::XRegressionCurveContainer > xContainer( GetPropertySet(), uno::UNO_QUERY );
- if( eRegress == CHREGRESS_NONE )
+ if( eRegress == SvxChartRegress::NONE )
{
if ( xContainer.is() )
{
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx
index 38819c7..fe7fef3 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -367,7 +367,7 @@ void ChartController::executeDispatch_InsertTrendline()
uno::Reference< chart2::XRegressionCurve > xCurve =
RegressionCurveHelper::addRegressionCurve(
- CHREGRESS_LINEAR,
+ SvxChartRegress::Linear,
xRegressionCurveContainer,
m_xCC );
diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
index 7147dda..43b36dd 100644
--- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
@@ -167,7 +167,7 @@ void setTrendlineVisible(const css::uno::Reference<css::frame::XModel>&
/* code */
uno::Reference< chart2::XRegressionCurve > xCurve =
RegressionCurveHelper::addRegressionCurve(
- CHREGRESS_LINEAR,
+ SvxChartRegress::Linear,
xRegressionCurveContainer,
comphelper::getProcessComponentContext());
}
diff --git a/chart2/source/tools/RegressionCurveHelper.cxx b/chart2/source/tools/RegressionCurveHelper.cxx
index 4cc6d69..084cc2f 100644
--- a/chart2/source/tools/RegressionCurveHelper.cxx
+++ b/chart2/source/tools/RegressionCurveHelper.cxx
@@ -53,22 +53,22 @@ OUString lcl_getServiceNameForType(SvxChartRegress eType)
OUString aServiceName;
switch( eType )
{
- case CHREGRESS_LINEAR:
+ case SvxChartRegress::Linear:
aServiceName = "com.sun.star.chart2.LinearRegressionCurve";
break;
- case CHREGRESS_LOG:
+ case SvxChartRegress::Log:
aServiceName = "com.sun.star.chart2.LogarithmicRegressionCurve";
break;
- case CHREGRESS_EXP:
+ case SvxChartRegress::Exp:
aServiceName = "com.sun.star.chart2.ExponentialRegressionCurve";
break;
- case CHREGRESS_POWER:
+ case SvxChartRegress::Power:
aServiceName = "com.sun.star.chart2.PotentialRegressionCurve";
break;
- case CHREGRESS_POLYNOMIAL:
+ case SvxChartRegress::Polynomial:
aServiceName = "com.sun.star.chart2.PolynomialRegressionCurve";
break;
- case CHREGRESS_MOVING_AVERAGE:
+ case SvxChartRegress::MovingAverage:
aServiceName = "com.sun.star.chart2.MovingAverageRegressionCurve";
break;
default:
@@ -362,7 +362,7 @@ uno::Reference< chart2::XRegressionCurve > RegressionCurveHelper::addRegressionC
if( !xRegressionCurveContainer.is() )
return xCurve;
- if( eType == CHREGRESS_NONE )
+ if( eType == SvxChartRegress::NONE )
{
OSL_FAIL("don't create a regression curve of type none");
return xCurve;
@@ -539,7 +539,7 @@ uno::Reference< chart2::XRegressionCurve > RegressionCurveHelper::getRegressionC
SvxChartRegress RegressionCurveHelper::getRegressionType(
const Reference< XRegressionCurve > & xCurve )
{
- SvxChartRegress eResult = CHREGRESS_UNKNOWN;
+ SvxChartRegress eResult = SvxChartRegress::Unknown;
try
{
@@ -550,31 +550,31 @@ SvxChartRegress RegressionCurveHelper::getRegressionType(
if( aServiceName == "com.sun.star.chart2.LinearRegressionCurve" )
{
- eResult = CHREGRESS_LINEAR;
+ eResult = SvxChartRegress::Linear;
}
else if( aServiceName == "com.sun.star.chart2.LogarithmicRegressionCurve" )
{
- eResult = CHREGRESS_LOG;
+ eResult = SvxChartRegress::Log;
}
else if( aServiceName == "com.sun.star.chart2.ExponentialRegressionCurve" )
{
- eResult = CHREGRESS_EXP;
+ eResult = SvxChartRegress::Exp;
}
else if( aServiceName == "com.sun.star.chart2.PotentialRegressionCurve" )
{
- eResult = CHREGRESS_POWER;
+ eResult = SvxChartRegress::Power;
}
else if( aServiceName == "com.sun.star.chart2.MeanValueRegressionCurve" )
{
- eResult = CHREGRESS_MEAN_VALUE;
+ eResult = SvxChartRegress::MeanValue;
}
else if( aServiceName == "com.sun.star.chart2.PolynomialRegressionCurve" )
{
- eResult = CHREGRESS_POLYNOMIAL;
+ eResult = SvxChartRegress::Polynomial;
}
else if( aServiceName == "com.sun.star.chart2.MovingAverageRegressionCurve" )
{
- eResult = CHREGRESS_MOVING_AVERAGE;
+ eResult = SvxChartRegress::MovingAverage;
}
}
}
@@ -589,7 +589,7 @@ SvxChartRegress RegressionCurveHelper::getRegressionType(
SvxChartRegress RegressionCurveHelper::getFirstRegressTypeNotMeanValueLine(
const Reference< XRegressionCurveContainer > & xRegCnt )
{
- SvxChartRegress eResult = CHREGRESS_NONE;
+ SvxChartRegress eResult = SvxChartRegress::NONE;
if( xRegCnt.is())
{
@@ -598,8 +598,8 @@ SvxChartRegress RegressionCurveHelper::getFirstRegressTypeNotMeanValueLine(
for( sal_Int32 i = 0; i < aCurves.getLength(); ++i )
{
SvxChartRegress eType = getRegressionType( aCurves[i] );
- if( eType != CHREGRESS_MEAN_VALUE &&
- eType != CHREGRESS_UNKNOWN )
+ if( eType != SvxChartRegress::MeanValue &&
+ eType != SvxChartRegress::Unknown )
{
eResult = eType;
break;
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index c1a9abf..0601bac 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -148,7 +148,7 @@ ChartItemPool::ChartItemPool():
ppPoolDefaults[SCHATTR_AXIS_FOR_ALL_SERIES - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_FOR_ALL_SERIES, 0);
- ppPoolDefaults[SCHATTR_REGRESSION_TYPE - SCHATTR_START] = new SvxChartRegressItem (CHREGRESS_NONE, SCHATTR_REGRESSION_TYPE);
+ ppPoolDefaults[SCHATTR_REGRESSION_TYPE - SCHATTR_START] = new SvxChartRegressItem (SvxChartRegress::NONE, SCHATTR_REGRESSION_TYPE);
ppPoolDefaults[SCHATTR_REGRESSION_SHOW_EQUATION - SCHATTR_START] = new SfxBoolItem(SCHATTR_REGRESSION_SHOW_EQUATION, false);
ppPoolDefaults[SCHATTR_REGRESSION_SHOW_COEFF - SCHATTR_START] = new SfxBoolItem(SCHATTR_REGRESSION_SHOW_COEFF, false);
ppPoolDefaults[SCHATTR_REGRESSION_DEGREE - SCHATTR_START] = new SfxInt32Item(SCHATTR_REGRESSION_DEGREE, 2);
diff --git a/include/svx/chrtitem.hxx b/include/svx/chrtitem.hxx
index 3305338..3d83658 100644
--- a/include/svx/chrtitem.hxx
+++ b/include/svx/chrtitem.hxx
@@ -75,20 +75,20 @@ enum SvxChartIndicate
#define CHINDICATE_COUNT (CHINDICATE_DOWN + 1)
-enum SvxChartRegress
+enum class SvxChartRegress
{
- CHREGRESS_NONE,
- CHREGRESS_LINEAR,
- CHREGRESS_LOG,
- CHREGRESS_EXP,
- CHREGRESS_POWER,
- CHREGRESS_POLYNOMIAL,
- CHREGRESS_MOVING_AVERAGE,
- CHREGRESS_MEAN_VALUE,
- CHREGRESS_UNKNOWN
+ NONE,
+ Linear,
+ Log,
+ Exp,
+ Power,
+ Polynomial,
+ MovingAverage,
+ MeanValue,
+ Unknown
};
-#define CHREGRESS_COUNT (CHREGRESS_UNKNOWN + 1)
+#define CHREGRESS_COUNT ((sal_uInt16)SvxChartRegress::Unknown + 1)
class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxChartStyleItem : public SfxEnumItem
{
@@ -107,7 +107,7 @@ public:
class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxChartRegressItem : public SfxEnumItem
{
public:
- SvxChartRegressItem(SvxChartRegress eRegress /*= CHREGRESS_LINEAR*/,
+ SvxChartRegressItem(SvxChartRegress eRegress /*= SvxChartRegress::Linear*/,
sal_uInt16 nId );
SvxChartRegressItem(SvStream& rIn, sal_uInt16 nId );
commit 8387ca6817f2fafcbb9c3bd9df76c91e93d4f772
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 24 13:09:40 2016 +0200
convert CUBE constants to typed_flags_set
Change-Id: I5f0b0e73ab3b4c10fdc9ea2dc817ea2fda8149a7
diff --git a/include/svx/cube3d.hxx b/include/svx/cube3d.hxx
index 34fad43..d1d2a06 100644
--- a/include/svx/cube3d.hxx
+++ b/include/svx/cube3d.hxx
@@ -22,6 +22,7 @@
#include <svx/obj3d.hxx>
#include <svx/svxdllapi.h>
+#include <o3tl/typed_flags_set.hxx>
/*************************************************************************
|*
@@ -36,10 +37,23 @@
|*
\************************************************************************/
-enum { CUBE_BOTTOM = 0x0001, CUBE_BACK = 0x0002, CUBE_LEFT = 0x0004,
- CUBE_TOP = 0x0008, CUBE_RIGHT = 0x0010, CUBE_FRONT = 0x0020,
- CUBE_FULL = 0x003F, CUBE_OPEN_TB = 0x0036, CUBE_OPEN_LR = 0x002B,
- CUBE_OPEN_FB = 0x001D };
+enum class CubeFaces
+{
+ Bottom = 0x0001,
+ Back = 0x0002,
+ Left = 0x0004,
+ Top = 0x0008,
+ Right = 0x0010,
+ Front = 0x0020,
+ Full = Bottom | Back | Left | Top | Right | Front,
+ OpenTopBottom = Back | Left | Right | Front,
+ OpenLeftRight = Bottom | Back | Top | Front,
+ OpenFrontBack = Bottom | Left | Top | Right
+};
+namespace o3tl
+{
+ template<> struct typed_flags<CubeFaces> : is_typed_flags<CubeFaces, 0x003f> {};
+}
class SAL_WARN_UNUSED SVX_DLLPUBLIC E3dCubeObj : public E3dCompoundObject
{
@@ -47,7 +61,7 @@ private:
// Parameter
basegfx::B3DPoint aCubePos;
basegfx::B3DVector aCubeSize;
- sal_uInt16 nSideFlags;
+ CubeFaces nSideFlags;
// BOOLeans
bool bPosIsCenter : 1;
diff --git a/include/svx/deflt3d.hxx b/include/svx/deflt3d.hxx
index da8e316..8a06293 100644
--- a/include/svx/deflt3d.hxx
+++ b/include/svx/deflt3d.hxx
@@ -25,6 +25,8 @@
#include <svx/svxdllapi.h>
#include <tools/color.hxx>
+enum class CubeFaces;
+
/*************************************************************************
|*
|* Class for managing the 3D default attributes
@@ -42,7 +44,7 @@ private:
// Cube object
basegfx::B3DPoint aDefaultCubePos;
basegfx::B3DVector aDefaultCubeSize;
- sal_uInt16 nDefaultCubeSideFlags;
+ CubeFaces nDefaultCubeSideFlags;
bool bDefaultCubePosIsCenter;
// Sphere object
@@ -81,7 +83,7 @@ public:
// Cube object
const basegfx::B3DPoint& GetDefaultCubePos() { return aDefaultCubePos; }
const basegfx::B3DVector& GetDefaultCubeSize() { return aDefaultCubeSize; }
- sal_uInt16 GetDefaultCubeSideFlags() const { return nDefaultCubeSideFlags; }
+ CubeFaces GetDefaultCubeSideFlags() const { return nDefaultCubeSideFlags; }
bool GetDefaultCubePosIsCenter() const { return bDefaultCubePosIsCenter; }
// Sphere object
diff --git a/svx/source/engine3d/deflt3d.cxx b/svx/source/engine3d/deflt3d.cxx
index 1b4847a..2b6664c 100644
--- a/svx/source/engine3d/deflt3d.cxx
+++ b/svx/source/engine3d/deflt3d.cxx
@@ -40,7 +40,7 @@ void E3dDefaultAttributes::Reset()
// Cube object
aDefaultCubePos = basegfx::B3DPoint(-500.0, -500.0, -500.0);
aDefaultCubeSize = basegfx::B3DVector(1000.0, 1000.0, 1000.0);
- nDefaultCubeSideFlags = CUBE_FULL;
+ nDefaultCubeSideFlags = CubeFaces::Full;
bDefaultCubePosIsCenter = false;
// Sphere object
commit 271bd3522e1148c0260688a42fd78959225db8cb
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 24 12:37:28 2016 +0200
convert DataAccessDescriptorProperty to scoped enum
Change-Id: Ifb8fb1d28464f0638ec1485d77ad333b1acc667c
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index d1206dc..18c2fe5 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -2447,7 +2447,7 @@ sal_Int8 OApplicationController::executeDrop( const ExecuteDropEvent& _rEvt )
sal_Int8 nAction = _rEvt.mnAction;
Reference<XContent> xContent;
- m_aAsyncDrop.aDroppedData[daComponent] >>= xContent;
+ m_aAsyncDrop.aDroppedData[DataAccessDescriptorProperty::Component] >>= xContent;
if ( xContent.is() )
{
OUString sName = xContent->getIdentifier()->getContentIdentifier();
diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx
index 3e2141f..692d986 100644
--- a/dbaccess/source/ui/app/AppControllerDnD.cxx
+++ b/dbaccess/source/ui/app/AppControllerDnD.cxx
@@ -586,8 +586,8 @@ bool OApplicationController::paste( ElementType _eType, const svx::ODataAccessDe
if ( _eType == E_QUERY )
{
sal_Int32 nCommandType = CommandType::TABLE;
- if ( _rPasteData.has(daCommandType) )
- _rPasteData[daCommandType] >>= nCommandType;
+ if ( _rPasteData.has(DataAccessDescriptorProperty::CommandType) )
+ _rPasteData[DataAccessDescriptorProperty::CommandType] >>= nCommandType;
if ( CommandType::QUERY == nCommandType || CommandType::COMMAND == nCommandType )
{
@@ -596,9 +596,9 @@ bool OApplicationController::paste( ElementType _eType, const svx::ODataAccessDe
OUString sCommand;
bool bEscapeProcessing = true;
- _rPasteData[daCommand] >>= sCommand;
- if ( _rPasteData.has(daEscapeProcessing) )
- _rPasteData[daEscapeProcessing] >>= bEscapeProcessing;
+ _rPasteData[DataAccessDescriptorProperty::Command] >>= sCommand;
+ if ( _rPasteData.has(DataAccessDescriptorProperty::EscapeProcessing) )
+ _rPasteData[DataAccessDescriptorProperty::EscapeProcessing] >>= bEscapeProcessing;
// plausibility check
bool bValidDescriptor = false;
@@ -749,10 +749,10 @@ bool OApplicationController::paste( ElementType _eType, const svx::ODataAccessDe
OSL_TRACE("There should be a sequence in it!");
return true;
}
- else if ( _rPasteData.has(daComponent) ) // forms or reports
+ else if ( _rPasteData.has(DataAccessDescriptorProperty::Component) ) // forms or reports
{
Reference<XContent> xContent;
- _rPasteData[daComponent] >>= xContent;
+ _rPasteData[DataAccessDescriptorProperty::Component] >>= xContent;
return insertHierachyElement(_eType,_sParentFolder,Reference<XNameAccess>(xContent,UNO_QUERY).is(),xContent,_bMove);
}
}
@@ -815,7 +815,7 @@ IMPL_LINK_NOARG_TYPED( OApplicationController, OnAsyncDrop, void*, void )
&& m_aAsyncDrop.nAction == DND_ACTION_MOVE )
{
Reference<XContent> xContent;
- m_aAsyncDrop.aDroppedData[daComponent] >>= xContent;
+ m_aAsyncDrop.aDroppedData[DataAccessDescriptorProperty::Component] >>= xContent;
::std::vector< OUString> aList;
sal_Int32 nIndex = 0;
OUString sName = xContent->getIdentifier()->getContentIdentifier();
diff --git a/dbaccess/source/ui/browser/dbexchange.cxx b/dbaccess/source/ui/browser/dbexchange.cxx
index 9cf3126..00e9ab6 100644
--- a/dbaccess/source/ui/browser/dbexchange.cxx
+++ b/dbaccess/source/ui/browser/dbexchange.cxx
@@ -104,7 +104,7 @@ namespace dbaui
osl_atomic_increment( &m_refCount );
Reference<XConnection> xConnection;
- getDescriptor()[ daConnection ] >>= xConnection;
+ getDescriptor()[ DataAccessDescriptorProperty::Connection ] >>= xConnection;
lcl_setListener( xConnection, this, true );
// do not pass the form itself as source result set, since the client might operate on the form, which
@@ -116,9 +116,9 @@ namespace dbaui
OSL_ENSURE( xResultSetClone.is(), "ODataClipboard::ODataClipboard: could not clone the form's result set" );
lcl_setListener( xResultSetClone, this, true );
- getDescriptor()[daCursor] <<= xResultSetClone;
- getDescriptor()[daSelection] <<= i_rSelectedRows;
- getDescriptor()[daBookmarkSelection]<<= i_bBookmarkSelection;
+ getDescriptor()[DataAccessDescriptorProperty::Cursor] <<= xResultSetClone;
+ getDescriptor()[DataAccessDescriptorProperty::Selection] <<= i_rSelectedRows;
+ getDescriptor()[DataAccessDescriptorProperty::BookmarkSelection]<<= i_bBookmarkSelection;
addCompatibleSelectionDescription( i_rSelectedRows );
if ( xConnection.is() && i_rORB.is() )
@@ -194,15 +194,15 @@ namespace dbaui
m_pRtf.clear();
}
- if ( getDescriptor().has( daConnection ) )
+ if ( getDescriptor().has( DataAccessDescriptorProperty::Connection ) )
{
- Reference<XConnection> xConnection( getDescriptor()[daConnection], UNO_QUERY );
+ Reference<XConnection> xConnection( getDescriptor()[DataAccessDescriptorProperty::Connection], UNO_QUERY );
lcl_setListener( xConnection, this, false );
}
- if ( getDescriptor().has( daCursor ) )
+ if ( getDescriptor().has( DataAccessDescriptorProperty::Cursor ) )
{
- Reference< XResultSet > xResultSet( getDescriptor()[ daCursor ], UNO_QUERY );
+ Reference< XResultSet > xResultSet( getDescriptor()[ DataAccessDescriptorProperty::Cursor ], UNO_QUERY );
lcl_setListener( xResultSet, this, false );
}
@@ -213,26 +213,26 @@ namespace dbaui
{
ODataAccessDescriptor& rDescriptor( getDescriptor() );
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list