LibreOffice Module sd (master) 1
|
A ConfigurationClassifier object compares two configurations of resources and gives access to the differences. More...
#include <ConfigurationClassifier.hxx>
Public Types | |
typedef ::std::vector< css::uno::Reference< css::drawing::framework::XResourceId > > | ResourceIdVector |
Public Member Functions | |
ConfigurationClassifier (const css::uno::Reference< css::drawing::framework::XConfiguration > &rxConfiguration1, const css::uno::Reference< css::drawing::framework::XConfiguration > &rxConfiguration2) | |
Create a new ConfigurationClassifier object that will compare the two given configurations. More... | |
bool | Partition () |
Calculate three lists of resource ids. More... | |
const ResourceIdVector & | GetC1minusC2 () const |
Return the resources that belong to the configuration given as rxConfiguration1 to the constructor but that do not belong to rxConfiguration2. More... | |
const ResourceIdVector & | GetC2minusC1 () const |
Return the resources that belong to the configuration given as rxConfiguration2 to the constructor but that do not belong to rxConfiguration1. More... | |
Private Member Functions | |
void | PartitionResources (const css::uno::Sequence< css::uno::Reference< css::drawing::framework::XResourceId > > &rS1, const css::uno::Sequence< css::uno::Reference< css::drawing::framework::XResourceId > > &rS2) |
Put all the elements in the two given sequences of resource ids and copy them into one of the resource id result vectors maC1minusC2, maC2minusC1, and maC1andC2. More... | |
Static Private Member Functions | |
static void | ClassifyResources (const css::uno::Sequence< css::uno::Reference< css::drawing::framework::XResourceId > > &rS1, const css::uno::Sequence< css::uno::Reference< css::drawing::framework::XResourceId > > &rS2, ResourceIdVector &rS1minusS2, ResourceIdVector &rS2minusS1, ResourceIdVector &rS1andS2) |
Compare the given sequences of resource ids and put their elements in one of three vectors depending on whether an element belongs to both sequences or to one but not the other. More... | |
static void | CopyResources (const ResourceIdVector &rSource, const css::uno::Reference< css::drawing::framework::XConfiguration > &rxConfiguration, ResourceIdVector &rTarget) |
Copy the resources given in rSource to the list of resources specified by rTarget. More... | |
Private Attributes | |
css::uno::Reference< css::drawing::framework::XConfiguration > | mxConfiguration1 |
css::uno::Reference< css::drawing::framework::XConfiguration > | mxConfiguration2 |
ResourceIdVector | maC1minusC2 |
After the call to Classify() this vector holds all elements from mxConfiguration1 that are not in mxConfiguration2. More... | |
ResourceIdVector | maC2minusC1 |
After the call to Classify() this vector holds all elements from mxConfiguration2 that are not in mxConfiguration1. More... | |
A ConfigurationClassifier object compares two configurations of resources and gives access to the differences.
It is used mainly when changes to the current configuration have been requested and the various resource controllers have to be supplied with the set of resources that are to be activated or deactivated.
Definition at line 44 of file ConfigurationClassifier.hxx.
typedef ::std::vector<css::uno::Reference<css::drawing::framework::XResourceId> > sd::framework::ConfigurationClassifier::ResourceIdVector |
Definition at line 64 of file ConfigurationClassifier.hxx.
sd::framework::ConfigurationClassifier::ConfigurationClassifier | ( | const css::uno::Reference< css::drawing::framework::XConfiguration > & | rxConfiguration1, |
const css::uno::Reference< css::drawing::framework::XConfiguration > & | rxConfiguration2 | ||
) |
Create a new ConfigurationClassifier object that will compare the two given configurations.
Definition at line 32 of file ConfigurationClassifier.cxx.
|
staticprivate |
Compare the given sequences of resource ids and put their elements in one of three vectors depending on whether an element belongs to both sequences or to one but not the other.
Note that only the resource URLs of the XResourceId objects are used for the classification.
rS1 | One sequence of XResourceId objects. |
rS2 | Another sequence of XResourceId objects. |
Definition at line 83 of file ConfigurationClassifier.cxx.
Referenced by PartitionResources().
|
staticprivate |
Copy the resources given in rSource to the list of resources specified by rTarget.
Resources bound to the ones in rSource, either directly or indirectly, are copied as well.
rSource | All resources and the ones bound to them, either directly or indirectly, are copied. |
rxConfiguration | This configuration is used to determine the resources bound to the ones in rSource. |
rTarget | This list is filled with resources from rSource and the ones bound to them. |
Definition at line 118 of file ConfigurationClassifier.cxx.
References sd::framework::FrameworkHelper::ResourceIdToString(), rTarget, and SAL_INFO.
Referenced by PartitionResources().
|
inline |
Return the resources that belong to the configuration given as rxConfiguration1 to the constructor but that do not belong to rxConfiguration2.
Definition at line 74 of file ConfigurationClassifier.hxx.
References maC1minusC2.
Referenced by sd::framework::ConfigurationController::restoreConfiguration(), and sd::framework::ConfigurationUpdater::UpdateCore().
|
inline |
Return the resources that belong to the configuration given as rxConfiguration2 to the constructor but that do not belong to rxConfiguration1.
Definition at line 84 of file ConfigurationClassifier.hxx.
References maC2minusC1.
Referenced by sd::framework::ConfigurationController::restoreConfiguration(), and sd::framework::ConfigurationUpdater::UpdateCore().
bool sd::framework::ConfigurationClassifier::Partition | ( | ) |
Calculate three lists of resource ids.
These contain the resources that belong to one configuration but not the other, or that belong to both configurations.
Definition at line 40 of file ConfigurationClassifier.cxx.
References maC1minusC2, maC2minusC1, mxConfiguration1, mxConfiguration2, and PartitionResources().
Referenced by sd::framework::ConfigurationController::restoreConfiguration(), and sd::framework::ConfigurationUpdater::UpdateConfiguration().
|
private |
Put all the elements in the two given sequences of resource ids and copy them into one of the resource id result vectors maC1minusC2, maC2minusC1, and maC1andC2.
This is done by using only the resource URLs for classification. Therefore this method calls itself recursively.
rS1 | One sequence of XResourceId objects. |
rS2 | Another sequence of XResourceId objects. |
Definition at line 52 of file ConfigurationClassifier.cxx.
References ClassifyResources(), CopyResources(), maC1minusC2, maC2minusC1, mxConfiguration1, mxConfiguration2, PartitionResources(), and SAL_INFO.
Referenced by Partition(), and PartitionResources().
|
private |
After the call to Classify() this vector holds all elements from mxConfiguration1 that are not in mxConfiguration2.
Definition at line 108 of file ConfigurationClassifier.hxx.
Referenced by GetC1minusC2(), Partition(), and PartitionResources().
|
private |
After the call to Classify() this vector holds all elements from mxConfiguration2 that are not in mxConfiguration1.
Definition at line 113 of file ConfigurationClassifier.hxx.
Referenced by GetC2minusC1(), Partition(), and PartitionResources().
|
private |
Definition at line 102 of file ConfigurationClassifier.hxx.
Referenced by Partition(), and PartitionResources().
|
private |
Definition at line 103 of file ConfigurationClassifier.hxx.
Referenced by Partition(), and PartitionResources().