[Libreoffice-commits] core.git: chart2/source
krishna keshav
princy.krishnakeshav at gmail.com
Sun Jul 17 12:21:05 UTC 2016
chart2/source/controller/accessibility/AccessibleBase.cxx | 4
chart2/source/controller/inc/ObjectHierarchy.hxx | 25 ++---
chart2/source/controller/main/ElementSelector.cxx | 9 +
chart2/source/controller/main/ElementSelector.hxx | 2
chart2/source/controller/main/ObjectHierarchy.cxx | 64 +++++++-------
5 files changed, 52 insertions(+), 52 deletions(-)
New commits:
commit bd9644249d19fdf1825eccdac992db592d5ec850
Author: krishna keshav <princy.krishnakeshav at gmail.com>
Date: Sat Jul 16 00:07:02 2016 +0530
tdf#100913 Remove tOID typedefs in ObjectHierarchy class
Replace use of toID with ObjectIdentifier in 'ObjectIdentifier.hxx'.
Change-Id: Ic0157974eca2992167319f7d19a0224056cc985e
Reviewed-on: https://gerrit.libreoffice.org/27243
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx b/chart2/source/controller/accessibility/AccessibleBase.cxx
index 7fba2be..a903d4b 100644
--- a/chart2/source/controller/accessibility/AccessibleBase.cxx
+++ b/chart2/source/controller/accessibility/AccessibleBase.cxx
@@ -240,7 +240,7 @@ bool AccessibleBase::ImplUpdateChildren()
::std::sort( aModelChildren.begin(), aModelChildren.end());
- ::std::vector< ObjectHierarchy::tOID > aChildrenToRemove, aChildrenToAdd;
+ ::std::vector< ObjectIdentifier > aChildrenToRemove, aChildrenToAdd;
::std::set_difference( aModelChildren.begin(), aModelChildren.end(),
aAccChildren.begin(), aAccChildren.end(),
::std::back_inserter( aChildrenToAdd ));
@@ -248,7 +248,7 @@ bool AccessibleBase::ImplUpdateChildren()
aModelChildren.begin(), aModelChildren.end(),
::std::back_inserter( aChildrenToRemove ));
- ::std::vector< ObjectHierarchy::tOID >::const_iterator aIt( aChildrenToRemove.begin());
+ ::std::vector< ObjectIdentifier >::const_iterator aIt( aChildrenToRemove.begin());
for( ; aIt != aChildrenToRemove.end(); ++aIt )
{
RemoveChildByOId( *aIt );
diff --git a/chart2/source/controller/inc/ObjectHierarchy.hxx b/chart2/source/controller/inc/ObjectHierarchy.hxx
index 473f0b1..017b726 100644
--- a/chart2/source/controller/inc/ObjectHierarchy.hxx
+++ b/chart2/source/controller/inc/ObjectHierarchy.hxx
@@ -41,8 +41,7 @@ class ImplObjectHierarchy;
class ObjectHierarchy
{
public:
- typedef ObjectIdentifier tOID;
- typedef ::std::vector< tOID > tChildContainer;
+ typedef ::std::vector< ObjectIdentifier > tChildContainer;
/** @param bFlattenDiagram
If <TRUE/>, the content of the diagram (data series, wall, floor,
@@ -56,20 +55,20 @@ public:
bool bOrderingForElementSelector = false );
~ObjectHierarchy();
- static tOID getRootNodeOID();
- static bool isRootNode( const tOID& rOID );
+ static ObjectIdentifier getRootNodeOID();
+ static bool isRootNode( const ObjectIdentifier& rOID );
/// equal to getChildren( getRootNodeOID())
tChildContainer getTopLevelChildren() const;
- bool hasChildren( const tOID& rParent ) const;
- tChildContainer getChildren( const tOID& rParent ) const;
+ bool hasChildren( const ObjectIdentifier& rParent ) const;
+ tChildContainer getChildren( const ObjectIdentifier& rParent ) const;
- tChildContainer getSiblings( const tOID& rNode ) const;
+ tChildContainer getSiblings( const ObjectIdentifier& rNode ) const;
/// The result is empty, if the node cannot be found in the tree
- tOID getParent( const tOID& rNode ) const;
+ ObjectIdentifier getParent( const ObjectIdentifier& rNode ) const;
/// @returns -1, if no parent can be determined
- sal_Int32 getIndexInParent( const tOID& rNode ) const;
+ sal_Int32 getIndexInParent( const ObjectIdentifier& rNode ) const;
private:
@@ -79,15 +78,15 @@ private:
class ObjectKeyNavigation
{
public:
- explicit ObjectKeyNavigation( const ObjectHierarchy::tOID & rCurrentOID,
+ explicit ObjectKeyNavigation( const ObjectIdentifier & rCurrentOID,
const css::uno::Reference< css::chart2::XChartDocument > & xChartDocument,
ExplicitValueProvider * pExplicitValueProvider = nullptr );
bool handleKeyEvent( const css::awt::KeyEvent & rEvent );
- const ObjectHierarchy::tOID& getCurrentSelection() const { return m_aCurrentOID;}
+ const ObjectIdentifier& getCurrentSelection() const { return m_aCurrentOID;}
private:
- void setCurrentSelection( const ObjectHierarchy::tOID& rOID );
+ void setCurrentSelection( const ObjectIdentifier& rOID );
bool first();
bool last();
bool next();
@@ -97,7 +96,7 @@ private:
bool veryFirst();
bool veryLast();
- ObjectHierarchy::tOID m_aCurrentOID;
+ ObjectIdentifier m_aCurrentOID;
css::uno::Reference< css::chart2::XChartDocument > m_xChartDocument;
ExplicitValueProvider * m_pExplicitValueProvider;
};
diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx
index d7ed6b7..a8b86fd 100644
--- a/chart2/source/controller/main/ElementSelector.cxx
+++ b/chart2/source/controller/main/ElementSelector.cxx
@@ -26,6 +26,7 @@
#include "DrawViewWrapper.hxx"
#include "ResId.hxx"
#include "Strings.hrc"
+#include "ObjectIdentifier.hxx"
#include <cppuhelper/supportsservice.hxx>
#include <toolkit/helper/vclunohelper.hxx>
@@ -57,14 +58,14 @@ SelectorListBox::SelectorListBox( vcl::Window* pParent, WinBits nStyle )
{
}
-void lcl_addObjectsToList( const ObjectHierarchy& rHierarchy, const ObjectHierarchy::tOID & rParent, std::vector< ListBoxEntryData >& rEntries
+void lcl_addObjectsToList( const ObjectHierarchy& rHierarchy, const ObjectIdentifier & rParent, std::vector< ListBoxEntryData >& rEntries
, const sal_Int32 nHierarchyDepth, const Reference< chart2::XChartDocument >& xChartDoc )
{
ObjectHierarchy::tChildContainer aChildren( rHierarchy.getChildren(rParent) );
ObjectHierarchy::tChildContainer::const_iterator aIt( aChildren.begin());
while( aIt != aChildren.end() )
{
- ObjectHierarchy::tOID aOID = *aIt;
+ ObjectIdentifier aOID = *aIt;
OUString aCID = aOID.getObjectCID();
ListBoxEntryData aEntry;
aEntry.OID = aOID;
@@ -90,7 +91,7 @@ void SelectorListBox::UpdateChartElementsListAndSelection()
if( xChartController.is() )
{
Reference< view::XSelectionSupplier > xSelectionSupplier( xChartController, uno::UNO_QUERY);
- ObjectHierarchy::tOID aSelectedOID;
+ ObjectIdentifier aSelectedOID;
OUString aSelectedCID;
if( xSelectionSupplier.is() )
{
@@ -191,7 +192,7 @@ void SelectorListBox::Select()
const sal_Int32 nPos = GetSelectEntryPos();
if( static_cast<size_t>(nPos) < m_aEntries.size() )
{
- ObjectHierarchy::tOID aOID = m_aEntries[nPos].OID;
+ ObjectIdentifier aOID = m_aEntries[nPos].OID;
Reference< view::XSelectionSupplier > xSelectionSupplier( m_xChartController.get(), uno::UNO_QUERY );
if( xSelectionSupplier.is() )
xSelectionSupplier->select( aOID.getAny() );
diff --git a/chart2/source/controller/main/ElementSelector.hxx b/chart2/source/controller/main/ElementSelector.hxx
index 6826b22..f350854 100644
--- a/chart2/source/controller/main/ElementSelector.hxx
+++ b/chart2/source/controller/main/ElementSelector.hxx
@@ -33,7 +33,7 @@ namespace chart
struct ListBoxEntryData
{
OUString UIName;
- ObjectHierarchy::tOID OID;
+ ObjectIdentifier OID;
sal_Int32 nHierarchyDepth;
ListBoxEntryData() : nHierarchyDepth(0)
diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx
index 0fef16e..a8a29ce 100644
--- a/chart2/source/controller/main/ObjectHierarchy.cxx
+++ b/chart2/source/controller/main/ObjectHierarchy.cxx
@@ -127,11 +127,11 @@ public:
ExplicitValueProvider* pExplicitValueProvider,
bool bFlattenDiagram, bool bOrderingForElementSelector );
- bool hasChildren( const ObjectHierarchy::tOID& rParent );
- ObjectHierarchy::tChildContainer getChildren( const ObjectHierarchy::tOID& rParent );
- ObjectHierarchy::tChildContainer getSiblings( const ObjectHierarchy::tOID& rNode );
+ bool hasChildren( const ObjectIdentifier& rParent );
+ ObjectHierarchy::tChildContainer getChildren( const ObjectIdentifier& rParent );
+ ObjectHierarchy::tChildContainer getSiblings( const ObjectIdentifier& rNode );
- ObjectHierarchy::tOID getParent( const ObjectHierarchy::tOID& rOID );
+ ObjectIdentifier getParent( const ObjectIdentifier& rOID );
private:
void createTree( const Reference< XChartDocument > & xChartDocument );
@@ -155,11 +155,11 @@ private:
const Reference< XDiagram > & xDiagram );
void createAdditionalShapesTree( ObjectHierarchy::tChildContainer& rContainer );
- ObjectHierarchy::tOID getParentImpl(
- const ObjectHierarchy::tOID& rParentOID,
- const ObjectHierarchy::tOID& rOID );
+ ObjectIdentifier getParentImpl(
+ const ObjectIdentifier& rParentOID,
+ const ObjectIdentifier& rOID );
- typedef ::std::map< ObjectHierarchy::tOID, ObjectHierarchy::tChildContainer >
+ typedef ::std::map< ObjectIdentifier, ObjectHierarchy::tChildContainer >
tChildMap;
tChildMap m_aChildMap;
ExplicitValueProvider* m_pExplicitValueProvider;
@@ -191,7 +191,7 @@ void ImplObjectHierarchy::createTree( const Reference< XChartDocument >& xChartD
//@todo: change ObjectIdentifier to take an XChartDocument rather than XModel
Reference< frame::XModel > xModel( xChartDocument, uno::UNO_QUERY );
Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartDocument ) );
- ObjectHierarchy::tOID aDiaOID;
+ ObjectIdentifier aDiaOID;
if( xDiagram.is() )
aDiaOID = ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForObject( xDiagram, xModel ) );
ObjectHierarchy::tChildContainer aTopLevelContainer;
@@ -279,7 +279,7 @@ void ImplObjectHierarchy::createLegendTree(
{
if( xDiagram.is() && LegendHelper::hasLegend( xDiagram ) )
{
- ObjectHierarchy::tOID aLegendOID( ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForObject( xDiagram->getLegend(), Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ) ) ) );
+ ObjectIdentifier aLegendOID( ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForObject( xDiagram->getLegend(), Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ) ) ) );
rContainer.push_back( aLegendOID );
// iterate over child shapes of legend and search for matching CIDs
@@ -431,7 +431,7 @@ void ImplObjectHierarchy::createDataSeriesTree(
OUString aSeriesParticle(
ObjectIdentifier::createParticleForSeries(
nDiagramIndex, nCooSysIdx, nCTIdx, nSeriesIdx ));
- ObjectHierarchy::tOID aSeriesOID(
+ ObjectIdentifier aSeriesOID(
ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForParticle( aSeriesParticle ) ) );
rOutDiagramSubContainer.push_back( aSeriesOID );
@@ -548,7 +548,7 @@ void ImplObjectHierarchy::createAdditionalShapesTree( ObjectHierarchy::tChildCon
}
}
-bool ImplObjectHierarchy::hasChildren( const ObjectHierarchy::tOID& rParent )
+bool ImplObjectHierarchy::hasChildren( const ObjectIdentifier& rParent )
{
if ( rParent.isValid() )
{
@@ -559,7 +559,7 @@ bool ImplObjectHierarchy::hasChildren( const ObjectHierarchy::tOID& rParent )
return false;
}
-ObjectHierarchy::tChildContainer ImplObjectHierarchy::getChildren( const ObjectHierarchy::tOID& rParent )
+ObjectHierarchy::tChildContainer ImplObjectHierarchy::getChildren( const ObjectIdentifier& rParent )
{
if ( rParent.isValid() )
{
@@ -570,7 +570,7 @@ ObjectHierarchy::tChildContainer ImplObjectHierarchy::getChildren( const ObjectH
return ObjectHierarchy::tChildContainer();
}
-ObjectHierarchy::tChildContainer ImplObjectHierarchy::getSiblings( const ObjectHierarchy::tOID& rNode )
+ObjectHierarchy::tChildContainer ImplObjectHierarchy::getSiblings( const ObjectIdentifier& rNode )
{
if ( rNode.isValid() && !ObjectHierarchy::isRootNode( rNode ) )
{
@@ -586,9 +586,9 @@ ObjectHierarchy::tChildContainer ImplObjectHierarchy::getSiblings( const ObjectH
return ObjectHierarchy::tChildContainer();
}
-ObjectHierarchy::tOID ImplObjectHierarchy::getParentImpl(
- const ObjectHierarchy::tOID & rParentOID,
- const ObjectHierarchy::tOID & rOID )
+ObjectIdentifier ImplObjectHierarchy::getParentImpl(
+ const ObjectIdentifier & rParentOID,
+ const ObjectIdentifier & rOID )
{
// search children
ObjectHierarchy::tChildContainer aChildren( getChildren( rParentOID ));
@@ -601,7 +601,7 @@ ObjectHierarchy::tOID ImplObjectHierarchy::getParentImpl(
for( aIt = aChildren.begin(); aIt != aChildren.end(); ++aIt )
{
// recursion
- ObjectHierarchy::tOID aTempParent( getParentImpl( *aIt, rOID ));
+ ObjectIdentifier aTempParent( getParentImpl( *aIt, rOID ));
if ( aTempParent.isValid() )
{
// exit on success
@@ -610,11 +610,11 @@ ObjectHierarchy::tOID ImplObjectHierarchy::getParentImpl(
}
// exit on fail
- return ObjectHierarchy::tOID();
+ return ObjectIdentifier();
}
-ObjectHierarchy::tOID ImplObjectHierarchy::getParent(
- const ObjectHierarchy::tOID & rOID )
+ObjectIdentifier ImplObjectHierarchy::getParent(
+ const ObjectIdentifier & rOID )
{
return getParentImpl( ObjectHierarchy::getRootNodeOID(), rOID );
}
@@ -632,12 +632,12 @@ ObjectHierarchy::ObjectHierarchy(
ObjectHierarchy::~ObjectHierarchy()
{}
-ObjectHierarchy::tOID ObjectHierarchy::getRootNodeOID()
+ObjectIdentifier ObjectHierarchy::getRootNodeOID()
{
return ObjectIdentifier( "ROOT" );
}
-bool ObjectHierarchy::isRootNode( const ObjectHierarchy::tOID& rOID )
+bool ObjectHierarchy::isRootNode( const ObjectIdentifier& rOID )
{
return ( rOID == ObjectHierarchy::getRootNodeOID() );
}
@@ -647,13 +647,13 @@ ObjectHierarchy::tChildContainer ObjectHierarchy::getTopLevelChildren() const
return m_apImpl->getChildren( ObjectHierarchy::getRootNodeOID());
}
-bool ObjectHierarchy::hasChildren( const tOID& rParent ) const
+bool ObjectHierarchy::hasChildren( const ObjectIdentifier& rParent ) const
{
return m_apImpl->hasChildren( rParent );
}
ObjectHierarchy::tChildContainer ObjectHierarchy::getChildren(
- const ObjectHierarchy::tOID& rParent ) const
+ const ObjectIdentifier& rParent ) const
{
if ( rParent.isValid() )
return m_apImpl->getChildren( rParent );
@@ -662,7 +662,7 @@ ObjectHierarchy::tChildContainer ObjectHierarchy::getChildren(
}
ObjectHierarchy::tChildContainer ObjectHierarchy::getSiblings(
- const ObjectHierarchy::tOID& rNode ) const
+ const ObjectIdentifier& rNode ) const
{
if ( rNode.isValid() && !isRootNode( rNode ) )
return m_apImpl->getSiblings( rNode );
@@ -670,16 +670,16 @@ ObjectHierarchy::tChildContainer ObjectHierarchy::getSiblings(
return ObjectHierarchy::tChildContainer();
}
-ObjectHierarchy::tOID ObjectHierarchy::getParent(
- const ObjectHierarchy::tOID& rNode ) const
+ObjectIdentifier ObjectHierarchy::getParent(
+ const ObjectIdentifier& rNode ) const
{
return m_apImpl->getParent( rNode );
}
sal_Int32 ObjectHierarchy::getIndexInParent(
- const ObjectHierarchy::tOID& rNode ) const
+ const ObjectIdentifier& rNode ) const
{
- tOID aParentOID( m_apImpl->getParent( rNode ));
+ ObjectIdentifier aParentOID( m_apImpl->getParent( rNode ));
tChildContainer aChildren( m_apImpl->getChildren( aParentOID ) );
tChildContainer::const_iterator aIt( aChildren.begin() );
for( sal_Int32 nIndex = 0; aIt != aChildren.end(); ++nIndex, ++aIt )
@@ -691,7 +691,7 @@ sal_Int32 ObjectHierarchy::getIndexInParent(
}
ObjectKeyNavigation::ObjectKeyNavigation(
- const ObjectHierarchy::tOID & rCurrentOID,
+ const ObjectIdentifier & rCurrentOID,
const Reference< chart2::XChartDocument > & xChartDocument,
ExplicitValueProvider * pExplicitValueProvider /* = 0 */ ) :
m_aCurrentOID( rCurrentOID ),
@@ -740,7 +740,7 @@ bool ObjectKeyNavigation::handleKeyEvent(
return bResult;
}
-void ObjectKeyNavigation::setCurrentSelection( const ObjectHierarchy::tOID& rOID )
+void ObjectKeyNavigation::setCurrentSelection( const ObjectIdentifier& rOID )
{
m_aCurrentOID = rOID;
}
More information about the Libreoffice-commits
mailing list