summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-05-15 15:25:05 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-05-15 15:31:06 +0100
commitcdd4d969b1446ca0492adda239f5caf9987b84eb (patch)
tree1e837869356b2dd23e913ea3767e0d82444d8798
parent8856ec1904882c69a38f6898b3c4d9227e7257b0 (diff)
Related: rhbz#790233 Allow styles to be deleted from the template dialog
I knew this used to work at some stage, appears to be a regression since cdf8680ed24a56956f257c99c73ff95ff488e2c6 GetIndices_Impl gives the region and index of the entry relative to the immediate parent, so doesn't make sense to use those as indexes into the template array if we're at the style level. backup into the template level if we're below it to get the relevant template index. Change-Id: I37a0bbc38cbb4dd82dd3d2c8309d8be61d83adbd
-rw-r--r--sfx2/source/doc/docvor.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx
index 5ed00278bebf..a1eded4f2b52 100644
--- a/sfx2/source/doc/docvor.cxx
+++ b/sfx2/source/doc/docvor.cxx
@@ -1679,8 +1679,17 @@ sal_Bool SfxOrganizeDlg_Impl::DontDelete_Impl( SvLBoxEntry* pEntry )
1679 return sal_True; 1679 return sal_True;
1680 } 1680 }
1681 1681
1682 //If delete is pressed on e.g. a style entry go up the chain to find the
1683 //owning template
1684 while (nDepth > 1)
1685 {
1686 pEntry = pFocusBox->GetParent(pEntry);
1687 --nDepth;
1688 }
1689 SvLBoxEntry *pTemplateEntry = pEntry;
1690
1682 sal_uInt16 nRegion = 0, nIndex = 0; 1691 sal_uInt16 nRegion = 0, nIndex = 0;
1683 GetIndices_Impl( pFocusBox, pEntry, nRegion, nIndex ); 1692 GetIndices_Impl( pFocusBox, pTemplateEntry, nRegion, nIndex );
1684 const SfxDocumentTemplates* pTemplates = aMgr.GetTemplates(); 1693 const SfxDocumentTemplates* pTemplates = aMgr.GetTemplates();
1685 if ( !pTemplates || !pTemplates->HasUserContents( nRegion, nIndex ) ) 1694 if ( !pTemplates || !pTemplates->HasUserContents( nRegion, nIndex ) )
1686 return sal_True; 1695 return sal_True;