Kaydet (Commit) 51ea10e2 authored tarafından Christian Lippka's avatar Christian Lippka

#100843# added code to convert a api numbering rule to implementation rule

üst d2e8d121
......@@ -2,9 +2,9 @@
*
* $RCSfile: unonrule.cxx,v $
*
* $Revision: 1.15 $
* $Revision: 1.16 $
*
* last change: $Author: cl $ $Date: 2001-08-06 15:48:32 $
* last change: $Author: cl $ $Date: 2002-07-16 10:25:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -554,6 +554,43 @@ const SvxNumRule& SvxGetNumRule( uno::Reference< container::XIndexReplace > xRul
return pRule->getNumRule();
}
bool SvxGetNumRule( uno::Reference< container::XIndexReplace > xRule, SvxNumRule& rNumRule )
{
SvxUnoNumberingRules* pRule = SvxUnoNumberingRules::getImplementation( xRule );
if( pRule )
{
rNumRule = pRule->getNumRule();
}
else if( xRule.is() )
{
try
{
pRule = new SvxUnoNumberingRules( rNumRule );
uno::Reference< container::XIndexReplace > xDestRule( pRule );
const sal_Int32 nCount = min( xRule->getCount(), xDestRule->getCount() );
sal_Int32 nLevel;
for( nLevel = 0; nLevel < nCount; nLevel++ )
{
xDestRule->replaceByIndex( nLevel, xRule->getByIndex( nLevel ) );
}
rNumRule = pRule->getNumRule();
}
catch( uno::Exception& )
{
return false;
}
}
else
{
return false;
}
return true;
}
///////////////////////////////////////////////////////////////////////
uno::Reference< container::XIndexReplace > SvxCreateNumRule( const SvxNumRule* pRule ) throw()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment