summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCao Cuong Ngo <cao.cuong.ngo@gmail.com>2013-07-17 20:30:22 +0200
committerCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2013-09-02 13:51:52 +0200
commitdb0cc8453ca795d3657e365bb0817708e3f00f38 (patch)
treee80452c26051592b39dcb3f08f06137b20ee1132 /sfx2
parent9a33f266913704563ae109390e57ac283bdcbbcc (diff)
CMIS properties dialog
Only update modified properties Change-Id: I985cba20abd9b2d5b25bfa3c716ad6df94178c72
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx49
1 files changed, 25 insertions, 24 deletions
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 7a2e69add808..a212345b6e6a 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -578,31 +578,22 @@ std::vector< CmisProperty* > SfxDocumentInfoItem::GetCmisProperties() const
uno::Sequence< document::CmisProperty > SfxDocumentInfoItem::GetCmisPropertiesSeq() const
{
+ Sequence< document::CmisProperty > aPropertiesSeq( m_aCmisProperties.size( ) );
std::vector< CmisProperty* >::const_iterator pIter;
- sal_Int32 i=0, updatableCount = 0, nCount = 0;
-
- for ( pIter = m_aCmisProperties.begin();
- pIter != m_aCmisProperties.end(); ++pIter, ++i )
- {
- if ( ( *pIter )->m_bUpdatable ) updatableCount++;
- }
- Sequence< document::CmisProperty > aPropertiesSeq( updatableCount );
+ sal_Int32 i = 0;
for ( pIter = m_aCmisProperties.begin();
- pIter != m_aCmisProperties.end(); ++pIter, ++i )
- if (( *pIter )->m_bUpdatable )
+ pIter != m_aCmisProperties.end(); ++pIter, i++ )
{
CmisProperty* aProp = *pIter;
- aPropertiesSeq[nCount].Id = aProp->m_sId;
- aPropertiesSeq[nCount].Name = aProp->m_sName;
- aPropertiesSeq[nCount].Updatable = aProp->m_bUpdatable;
- aPropertiesSeq[nCount].Required = aProp->m_bRequired;
- aPropertiesSeq[nCount].MultiValued = aProp->m_bMultiValued;
- aPropertiesSeq[nCount].OpenChoice = aProp->m_bOpenChoice;
- aPropertiesSeq[nCount].Choices = aProp->m_aChoices;
- aPropertiesSeq[nCount].Value = aProp->m_aValue;
-
- nCount++;
+ aPropertiesSeq[i].Id = aProp->m_sId;
+ aPropertiesSeq[i].Name = aProp->m_sName;
+ aPropertiesSeq[i].Updatable = aProp->m_bUpdatable;
+ aPropertiesSeq[i].Required = aProp->m_bRequired;
+ aPropertiesSeq[i].MultiValued = aProp->m_bMultiValued;
+ aPropertiesSeq[i].OpenChoice = aProp->m_bOpenChoice;
+ aPropertiesSeq[i].Choices = aProp->m_aChoices;
+ aPropertiesSeq[i].Value = aProp->m_aValue;
}
return aPropertiesSeq;
@@ -2868,7 +2859,7 @@ SfxCmisPropertiesPage::SfxCmisPropertiesPage( Window* pParent, const SfxItemSet&
sal_Bool SfxCmisPropertiesPage::FillItemSet( SfxItemSet& rSet )
{
- sal_Bool bModified = sal_True;
+ sal_Bool bModified = sal_False;
const SfxPoolItem* pItem = NULL;
SfxDocumentInfoItem* pInfo = NULL;
bool bMustDelete = false;
@@ -2887,12 +2878,20 @@ sal_Bool SfxCmisPropertiesPage::FillItemSet( SfxItemSet& rSet )
if ( pInfo )
{
+ Sequence< document::CmisProperty > aOldProps = pInfo->GetCmisPropertiesSeq( );
pInfo->ClearCmisProperties();
Sequence< document::CmisProperty > aPropertySeq = m_pPropertiesCtrl->GetCmisProperties();
- sal_Int32 i = 0, nCount = aPropertySeq.getLength();
- for ( ; i < nCount; ++i )
+
+ for ( sal_Int32 i = 0; i< aPropertySeq.getLength( ); i++ )
{
- if ( !aPropertySeq[i].Id.isEmpty() )
+ OUString oldValue;
+ aOldProps[i].Value >>= oldValue;
+ OUString newValue;
+ aPropertySeq[i].Value >>= newValue;
+ if ( !aPropertySeq[i].Id.isEmpty() &&
+ aPropertySeq[i].Updatable &&
+ oldValue != newValue )
+ {
pInfo->AddCmisProperty( aPropertySeq[i].Id,
aPropertySeq[i].Name,
aPropertySeq[i].Updatable,
@@ -2901,6 +2900,8 @@ sal_Bool SfxCmisPropertiesPage::FillItemSet( SfxItemSet& rSet )
aPropertySeq[i].OpenChoice,
aPropertySeq[i].Choices,
aPropertySeq[i].Value );
+ bModified = true;
+ }
}
}