nbdtmg.cxx (a7f01c39) nbdtmg.cxx (fbfb01de)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 85 unchanged lines hidden (view full) ---

94using namespace com::sun::star::beans;
95using namespace com::sun::star::lang;
96using namespace com::sun::star::text;
97using namespace com::sun::star::container;
98using namespace com::sun::star::style;
99using rtl::OUString;
100
101namespace svx { namespace sidebar {
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 85 unchanged lines hidden (view full) ---

94using namespace com::sun::star::beans;
95using namespace com::sun::star::lang;
96using namespace com::sun::star::text;
97using namespace com::sun::star::container;
98using namespace com::sun::star::style;
99using rtl::OUString;
100
101namespace svx { namespace sidebar {
102#define NUM_TYPE_MEMBER 4
102#define NUM_TYPE_MEMBER 4
103#define NUM_VALUSET_COUNT 16
104#define MAX_VALUESET_GRAPHIC 30
105
106typedef NumSettings_Impl* NumSettings_ImplPtr;
107SV_DECL_PTRARR_DEL(NumSettingsArr_Impl,NumSettings_ImplPtr,8,4)
108SV_IMPL_PTRARR( NumSettingsArr_Impl, NumSettings_ImplPtr )
109
110typedef NumberSettings_Impl* NumberSettings_ImplPtr;
111SV_DECL_PTRARR_DEL(NumberSettingsArr_Impl,NumberSettings_ImplPtr,8,4)
112SV_IMPL_PTRARR( NumberSettingsArr_Impl, NumberSettings_ImplPtr )
113
114Font& lcl_GetDefaultBulletFont()
115{
116 static sal_Bool bInit = 0;
117 static Font aDefBulletFont( UniString::CreateFromAscii(
103#define NUM_VALUSET_COUNT 16
104#define MAX_VALUESET_GRAPHIC 30
105
106typedef NumSettings_Impl* NumSettings_ImplPtr;
107SV_DECL_PTRARR_DEL(NumSettingsArr_Impl,NumSettings_ImplPtr,8,4)
108SV_IMPL_PTRARR( NumSettingsArr_Impl, NumSettings_ImplPtr )
109
110typedef NumberSettings_Impl* NumberSettings_ImplPtr;
111SV_DECL_PTRARR_DEL(NumberSettingsArr_Impl,NumberSettings_ImplPtr,8,4)
112SV_IMPL_PTRARR( NumberSettingsArr_Impl, NumberSettings_ImplPtr )
113
114Font& lcl_GetDefaultBulletFont()
115{
116 static sal_Bool bInit = 0;
117 static Font aDefBulletFont( UniString::CreateFromAscii(
118 RTL_CONSTASCII_STRINGPARAM( "StarSymbol" ) ),
118 RTL_CONSTASCII_STRINGPARAM( "StarSymbol" ) ),
119 String(), Size( 0, 14 ) );
120 if(!bInit)
121 {
122 aDefBulletFont.SetCharSet( RTL_TEXTENCODING_SYMBOL );
123 aDefBulletFont.SetFamily( FAMILY_DONTKNOW );
124 aDefBulletFont.SetPitch( PITCH_DONTKNOW );
125 aDefBulletFont.SetWeight( WEIGHT_DONTKNOW );
126 aDefBulletFont.SetTransparent( sal_True );

--- 72 unchanged lines hidden (view full) ---

199 {
200 nCount++;
201 nLv=i;
202 }
203 nMask <<= 1 ;
204 }
205
206 if ( nCount == 1)
119 String(), Size( 0, 14 ) );
120 if(!bInit)
121 {
122 aDefBulletFont.SetCharSet( RTL_TEXTENCODING_SYMBOL );
123 aDefBulletFont.SetFamily( FAMILY_DONTKNOW );
124 aDefBulletFont.SetPitch( PITCH_DONTKNOW );
125 aDefBulletFont.SetWeight( WEIGHT_DONTKNOW );
126 aDefBulletFont.SetTransparent( sal_True );

--- 72 unchanged lines hidden (view full) ---

199 {
200 nCount++;
201 nLv=i;
202 }
203 nMask <<= 1 ;
204 }
205
206 if ( nCount == 1)
207 return nLv;
207 return nLv;
208 else
209 return (sal_uInt16)0xFFFF;
210}
211
212void NBOTypeMgrBase::StoreBulCharFmtName_impl() {
213 if ( pSet )
214 {
215 SfxAllItemSet aSet(*pSet);
208 else
209 return (sal_uInt16)0xFFFF;
210}
211
212void NBOTypeMgrBase::StoreBulCharFmtName_impl() {
213 if ( pSet )
214 {
215 SfxAllItemSet aSet(*pSet);
216 SFX_ITEMSET_ARG(&aSet,pBulletCharFmt,SfxStringItem,SID_BULLET_CHAR_FMT,sal_False);
216 SFX_ITEMSET_ARG(&aSet,pBulletCharFmt,SfxStringItem,SID_BULLET_CHAR_FMT,sal_False);
217
218 if ( pBulletCharFmt )
219 {
220 aNumCharFmtName = String(pBulletCharFmt->GetValue());
221 }
222 }
223}
224String NBOTypeMgrBase::GetBulCharFmtName()
225{
226 return aNumCharFmtName;
227}
228void NBOTypeMgrBase::ImplLoad(String filename)
229{
230 bIsLoading = true;
231 SfxMapUnit eOldCoreUnit=eCoreUnit;
217
218 if ( pBulletCharFmt )
219 {
220 aNumCharFmtName = String(pBulletCharFmt->GetValue());
221 }
222 }
223}
224String NBOTypeMgrBase::GetBulCharFmtName()
225{
226 return aNumCharFmtName;
227}
228void NBOTypeMgrBase::ImplLoad(String filename)
229{
230 bIsLoading = true;
231 SfxMapUnit eOldCoreUnit=eCoreUnit;
232 eCoreUnit = SFX_MAPUNIT_100TH_MM;
232 eCoreUnit = SFX_MAPUNIT_100TH_MM;
233 INetURLObject aFile( SvtPathOptions().GetPalettePath() );
234 aFile.Append( filename);
235 SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ );
236 if( pIStm ) {
233 INetURLObject aFile( SvtPathOptions().GetPalettePath() );
234 aFile.Append( filename);
235 SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ );
236 if( pIStm ) {
237 sal_uInt32 nVersion;
238 sal_Int32 nNumIndex;
237 sal_uInt32 nVersion;
238 sal_Int32 nNumIndex;
239 *pIStm >> nVersion;
240 if (nVersion==DEFAULT_NUMBERING_CACHE_FORMAT_VERSION) // first version
241 {
242 *pIStm >> nNumIndex;
243 sal_uInt16 mLevel = 0x1;
244 while (nNumIndex>=0 && nNumIndex<DEFAULT_NUM_VALUSET_COUNT) {
245 SvxNumRule aNum(*pIStm);
246 // bullet color in font properties is not stored correctly. Need set transparency bits manually

--- 17 unchanged lines hidden (view full) ---

264 }
265 eCoreUnit = eOldCoreUnit;
266 bIsLoading = false;
267}
268void NBOTypeMgrBase::ImplStore(String filename)
269{
270 if (bIsLoading) return;
271 SfxMapUnit eOldCoreUnit=eCoreUnit;
239 *pIStm >> nVersion;
240 if (nVersion==DEFAULT_NUMBERING_CACHE_FORMAT_VERSION) // first version
241 {
242 *pIStm >> nNumIndex;
243 sal_uInt16 mLevel = 0x1;
244 while (nNumIndex>=0 && nNumIndex<DEFAULT_NUM_VALUSET_COUNT) {
245 SvxNumRule aNum(*pIStm);
246 // bullet color in font properties is not stored correctly. Need set transparency bits manually

--- 17 unchanged lines hidden (view full) ---

264 }
265 eCoreUnit = eOldCoreUnit;
266 bIsLoading = false;
267}
268void NBOTypeMgrBase::ImplStore(String filename)
269{
270 if (bIsLoading) return;
271 SfxMapUnit eOldCoreUnit=eCoreUnit;
272 eCoreUnit = SFX_MAPUNIT_100TH_MM;
272 eCoreUnit = SFX_MAPUNIT_100TH_MM;
273 INetURLObject aFile( SvtPathOptions().GetPalettePath() );
274 aFile.Append( filename);
273 INetURLObject aFile( SvtPathOptions().GetPalettePath() );
274 aFile.Append( filename);
275 SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE );
275 SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE );
276 if( pOStm ) {
276 if( pOStm ) {
277 sal_uInt32 nVersion;
278 sal_Int32 nNumIndex;
277 sal_uInt32 nVersion;
278 sal_Int32 nNumIndex;
279 nVersion = DEFAULT_NUMBERING_CACHE_FORMAT_VERSION;
280 *pOStm << nVersion;
279 nVersion = DEFAULT_NUMBERING_CACHE_FORMAT_VERSION;
280 *pOStm << nVersion;
281 for(sal_Int32 nItem = 0; nItem < DEFAULT_NUM_VALUSET_COUNT; nItem++ ) {
281 for(sal_Int32 nItem = 0; nItem < DEFAULT_NUM_VALUSET_COUNT; nItem++ ) {
282 if (IsCustomized(nItem)) {
283 SvxNumRule aDefNumRule( NUM_BULLET_REL_SIZE|NUM_CONTINUOUS|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE|NUM_SYMBOL_ALIGNMENT,10, sal_False ,
284 SVX_RULETYPE_NUMBERING,SvxNumberFormat::LABEL_ALIGNMENT);
285 sal_uInt16 mLevel = 0x1;
286 *pOStm << nItem;
287 ApplyNumRule(aDefNumRule,nItem,mLevel,false,true);
288 aDefNumRule.Store(*pOStm);
289 }
290 }
291 nNumIndex = -1;
282 if (IsCustomized(nItem)) {
283 SvxNumRule aDefNumRule( NUM_BULLET_REL_SIZE|NUM_CONTINUOUS|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE|NUM_SYMBOL_ALIGNMENT,10, sal_False ,
284 SVX_RULETYPE_NUMBERING,SvxNumberFormat::LABEL_ALIGNMENT);
285 sal_uInt16 mLevel = 0x1;
286 *pOStm << nItem;
287 ApplyNumRule(aDefNumRule,nItem,mLevel,false,true);
288 aDefNumRule.Store(*pOStm);
289 }
290 }
291 nNumIndex = -1;
292 *pOStm << nNumIndex; // write end flag
292 *pOStm << nNumIndex; // write end flag
293 delete pOStm;
294 }
295 eCoreUnit = eOldCoreUnit;
296}
297
298void NBOTypeMgrBase::StoreMapUnit_impl() {
299 if ( pSet )
300 {

--- 57 unchanged lines hidden (view full) ---

358 for (sal_uInt16 i=0;i<DEFAULT_BULLET_TYPES;i++)
359 {
360 pActualBullets[i] = new BulletsSettings_Impl(eNBType::BULLETS);
361 pActualBullets[i]->cBulletChar = aDefaultRTLBulletTypes[i];
362 pActualBullets[i]->aFont = rActBulletFont;
363 if (i==4 || i==5)
364 pActualBullets[i]->sDescription = SVX_RESSTR( RID_SVXSTR_BULLET_RTL_DESCRIPTION_4 - 4 + i );
365 else
293 delete pOStm;
294 }
295 eCoreUnit = eOldCoreUnit;
296}
297
298void NBOTypeMgrBase::StoreMapUnit_impl() {
299 if ( pSet )
300 {

--- 57 unchanged lines hidden (view full) ---

358 for (sal_uInt16 i=0;i<DEFAULT_BULLET_TYPES;i++)
359 {
360 pActualBullets[i] = new BulletsSettings_Impl(eNBType::BULLETS);
361 pActualBullets[i]->cBulletChar = aDefaultRTLBulletTypes[i];
362 pActualBullets[i]->aFont = rActBulletFont;
363 if (i==4 || i==5)
364 pActualBullets[i]->sDescription = SVX_RESSTR( RID_SVXSTR_BULLET_RTL_DESCRIPTION_4 - 4 + i );
365 else
366 pActualBullets[i]->sDescription = SVX_RESSTR( RID_SVXSTR_BULLET_DESCRIPTION_0 + i );
366 pActualBullets[i]->sDescription = SVX_RESSTR( RID_SVXSTR_BULLET_DESCRIPTION_0 + i );
367 }
368 }else
369 {
370 for (sal_uInt16 i=0;i<DEFAULT_BULLET_TYPES;i++)
371 {
372 pActualBullets[i] = new BulletsSettings_Impl(eNBType::BULLETS);
373 pActualBullets[i]->cBulletChar = aDefaultBulletTypes[i];
374 pActualBullets[i]->aFont =rActBulletFont;
367 }
368 }else
369 {
370 for (sal_uInt16 i=0;i<DEFAULT_BULLET_TYPES;i++)
371 {
372 pActualBullets[i] = new BulletsSettings_Impl(eNBType::BULLETS);
373 pActualBullets[i]->cBulletChar = aDefaultBulletTypes[i];
374 pActualBullets[i]->aFont =rActBulletFont;
375 pActualBullets[i]->sDescription = SVX_RESSTR( RID_SVXSTR_BULLET_DESCRIPTION_0 + i );
375 pActualBullets[i]->sDescription = SVX_RESSTR( RID_SVXSTR_BULLET_DESCRIPTION_0 + i );
376 }
377 }
378}
379sal_uInt16 BulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex)
376 }
377 }
378}
379sal_uInt16 BulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex)
380{
380{
381 if ( mLevel == (sal_uInt16)0xFFFF || mLevel == 0)
382 return (sal_uInt16)0xFFFF;
383 //if ( !lcl_IsNumFmtSet(pNR, mLevel) ) return (sal_uInt16)0xFFFF;
384
385 sal_uInt16 nActLv = IsSingleLevel(mLevel);
386
387 if ( nActLv == (sal_uInt16)0xFFFF )
388 return (sal_uInt16)0xFFFF;

--- 59 unchanged lines hidden (view full) ---

448 //sal_uInt16 nLength = 0;
449 /*if( Application::GetSettings().GetLayoutRTL() )
450 {
451 nLength = sizeof(aDynamicRTLBulletTypes)/sizeof(sal_Unicode);
452
453 if ( nIndex >= nLength )
454 return sal_False;
455
381 if ( mLevel == (sal_uInt16)0xFFFF || mLevel == 0)
382 return (sal_uInt16)0xFFFF;
383 //if ( !lcl_IsNumFmtSet(pNR, mLevel) ) return (sal_uInt16)0xFFFF;
384
385 sal_uInt16 nActLv = IsSingleLevel(mLevel);
386
387 if ( nActLv == (sal_uInt16)0xFFFF )
388 return (sal_uInt16)0xFFFF;

--- 59 unchanged lines hidden (view full) ---

448 //sal_uInt16 nLength = 0;
449 /*if( Application::GetSettings().GetLayoutRTL() )
450 {
451 nLength = sizeof(aDynamicRTLBulletTypes)/sizeof(sal_Unicode);
452
453 if ( nIndex >= nLength )
454 return sal_False;
455
456 aDynamicRTLBulletTypes[nIndex] = cChar;
456 aDynamicRTLBulletTypes[nIndex] = cChar;
457 } else
458 {
459 nLength = sizeof(aDynamicBulletTypes)/sizeof(sal_Unicode);
460
461 if ( nIndex >= nLength )
462 return sal_False;
463
464 aDynamicBulletTypes[nIndex] = cChar;

--- 49 unchanged lines hidden (view full) ---

514
515 sal_uInt16 nMask = 1;
516 String sBulletCharFmtName = GetBulCharFmtName();
517 for(sal_uInt16 i = 0; i < aNum.GetLevelCount(); i++)
518 {
519 if(mLevel & nMask)
520 {
521 SvxNumberFormat aFmt(aNum.GetLevel(i));
457 } else
458 {
459 nLength = sizeof(aDynamicBulletTypes)/sizeof(sal_Unicode);
460
461 if ( nIndex >= nLength )
462 return sal_False;
463
464 aDynamicBulletTypes[nIndex] = cChar;

--- 49 unchanged lines hidden (view full) ---

514
515 sal_uInt16 nMask = 1;
516 String sBulletCharFmtName = GetBulCharFmtName();
517 for(sal_uInt16 i = 0; i < aNum.GetLevelCount(); i++)
518 {
519 if(mLevel & nMask)
520 {
521 SvxNumberFormat aFmt(aNum.GetLevel(i));
522 aFmt.SetNumberingType( SVX_NUM_CHAR_SPECIAL );
522 aFmt.SetNumberingType( SVX_NUM_CHAR_SPECIAL );
523 aFmt.SetBulletFont(&rActBulletFont);
524 aFmt.SetBulletChar(cChar );
525 aFmt.SetCharFmtName(sBulletCharFmtName);
526 if (isResetSize) aFmt.SetBulletRelSize(45);
527 aNum.SetLevel(i, aFmt);
528 }
529 nMask <<= 1;
530 }

--- 22 unchanged lines hidden (view full) ---

553
554 if ( nIndex >= DEFAULT_BULLET_TYPES )
555 bRet = sal_False;
556 else
557 bRet = pActualBullets[nIndex]->bIsCustomized;
558
559 return bRet;
560}
523 aFmt.SetBulletFont(&rActBulletFont);
524 aFmt.SetBulletChar(cChar );
525 aFmt.SetCharFmtName(sBulletCharFmtName);
526 if (isResetSize) aFmt.SetBulletRelSize(45);
527 aNum.SetLevel(i, aFmt);
528 }
529 nMask <<= 1;
530 }

--- 22 unchanged lines hidden (view full) ---

553
554 if ( nIndex >= DEFAULT_BULLET_TYPES )
555 bRet = sal_False;
556 else
557 bRet = pActualBullets[nIndex]->bIsCustomized;
558
559 return bRet;
560}
561
561
562sal_Unicode BulletsTypeMgr::GetBulChar(sal_uInt16 nIndex)
563{
564 sal_Unicode cChar;
565 //sal_uInt16 nLength = 0;
566 //nLength = sizeof(pActualBullets)/sizeof(BulletsSettings_Impl);
567
568 if ( nIndex >= DEFAULT_BULLET_TYPES )
569 cChar = ' ';
562sal_Unicode BulletsTypeMgr::GetBulChar(sal_uInt16 nIndex)
563{
564 sal_Unicode cChar;
565 //sal_uInt16 nLength = 0;
566 //nLength = sizeof(pActualBullets)/sizeof(BulletsSettings_Impl);
567
568 if ( nIndex >= DEFAULT_BULLET_TYPES )
569 cChar = ' ';
570 else
570 else
571 cChar = pActualBullets[nIndex]->cBulletChar;
572
573 /*if( Application::GetSettings().GetLayoutRTL() )
574 {
575 nLength = sizeof(aDynamicRTLBulletTypes)/sizeof(sal_Unicode);
576
577 if ( nIndex >= nLength )
578 cChar = ' ';
571 cChar = pActualBullets[nIndex]->cBulletChar;
572
573 /*if( Application::GetSettings().GetLayoutRTL() )
574 {
575 nLength = sizeof(aDynamicRTLBulletTypes)/sizeof(sal_Unicode);
576
577 if ( nIndex >= nLength )
578 cChar = ' ';
579 else
579 else
580 cChar = aDynamicRTLBulletTypes[nIndex];
581 }else
582 {
583 nLength = sizeof(aDynamicBulletTypes)/sizeof(sal_Unicode);
584
585 if ( nIndex >= nLength )
586 cChar = ' ';
587 else
588 cChar = aDynamicBulletTypes[nIndex];
589 }*/
590
591 return cChar;
592}
593Font BulletsTypeMgr::GetBulCharFont(sal_uInt16 nIndex)
594{
595 Font aRet;
596 if ( nIndex >= DEFAULT_BULLET_TYPES )
597 aRet = lcl_GetDefaultBulletFont();
598 else
580 cChar = aDynamicRTLBulletTypes[nIndex];
581 }else
582 {
583 nLength = sizeof(aDynamicBulletTypes)/sizeof(sal_Unicode);
584
585 if ( nIndex >= nLength )
586 cChar = ' ';
587 else
588 cChar = aDynamicBulletTypes[nIndex];
589 }*/
590
591 return cChar;
592}
593Font BulletsTypeMgr::GetBulCharFont(sal_uInt16 nIndex)
594{
595 Font aRet;
596 if ( nIndex >= DEFAULT_BULLET_TYPES )
597 aRet = lcl_GetDefaultBulletFont();
598 else
599 aRet = pActualBullets[nIndex]->aFont;
599 aRet = pActualBullets[nIndex]->aFont;
600
601 return aRet;
602}
603/***************************************************************************************************
604**********************Graphic Bullet Type lib***********************************************************
605****************************************************************************************************/
606GraphicBulletsTypeMgr* GraphicBulletsTypeMgr::_instance = 0;
607GraphicBulletsTypeMgr::GraphicBulletsTypeMgr(const NBOType aType):

--- 25 unchanged lines hidden (view full) ---

633 }
634 else
635 delete pEntry;
636 }
637}
638void GraphicBulletsTypeMgr::Init()
639{
640 List aGrfNames;
600
601 return aRet;
602}
603/***************************************************************************************************
604**********************Graphic Bullet Type lib***********************************************************
605****************************************************************************************************/
606GraphicBulletsTypeMgr* GraphicBulletsTypeMgr::_instance = 0;
607GraphicBulletsTypeMgr::GraphicBulletsTypeMgr(const NBOType aType):

--- 25 unchanged lines hidden (view full) ---

633 }
634 else
635 delete pEntry;
636 }
637}
638void GraphicBulletsTypeMgr::Init()
639{
640 List aGrfNames;
641 GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames);
641 GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames);
642 for(sal_uInt16 i = 0; i < aGrfNames.Count(); i++)
643 {
644 String* pGrfNm = (String*) aGrfNames.GetObject(i);
645 INetURLObject aObj(*pGrfNm);
646 if(aObj.GetProtocol() == INET_PROT_FILE)
642 for(sal_uInt16 i = 0; i < aGrfNames.Count(); i++)
643 {
644 String* pGrfNm = (String*) aGrfNames.GetObject(i);
645 INetURLObject aObj(*pGrfNm);
646 if(aObj.GetProtocol() == INET_PROT_FILE)
647 *pGrfNm = aObj.PathToFileName();
647 *pGrfNm = aObj.PathToFileName();
648
649 GrfBulDataRelation* pEntry = new GrfBulDataRelation(eNBType::GRAPHICBULLETS);
650 pEntry->nTabIndex = i+1;
651 pEntry->nGallaryIndex = i;
652 pEntry->sGrfName = *pGrfNm;
653
654 if( i < MAX_VALUESET_GRAPHIC )
648
649 GrfBulDataRelation* pEntry = new GrfBulDataRelation(eNBType::GRAPHICBULLETS);
650 pEntry->nTabIndex = i+1;
651 pEntry->nGallaryIndex = i;
652 pEntry->sGrfName = *pGrfNm;
653
654 if( i < MAX_VALUESET_GRAPHIC )
655 {
656 pEntry->sDescription = SVX_RESSTR( RID_SVXSTR_GRAPHICS_DESCRIPTIONS + i );
655 {
656 pEntry->sDescription = SVX_RESSTR( RID_SVXSTR_GRAPHICS_DESCRIPTIONS + i );
657 }else
658 {
659 pEntry->sDescription = *pGrfNm;
660 }
661
662 aGrfDataLst.Insert( pEntry, LIST_APPEND );
663 }
664}
665sal_uInt16 GraphicBulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 /* nFromIndex */)
666{
667 if ( mLevel == (sal_uInt16)0xFFFF || mLevel == 0)
668 return (sal_uInt16)0xFFFF;
669
670 sal_uInt16 nActLv = IsSingleLevel(mLevel);
671
672 if ( nActLv == (sal_uInt16)0xFFFF )
673 return (sal_uInt16)0xFFFF;
674
657 }else
658 {
659 pEntry->sDescription = *pGrfNm;
660 }
661
662 aGrfDataLst.Insert( pEntry, LIST_APPEND );
663 }
664}
665sal_uInt16 GraphicBulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 /* nFromIndex */)
666{
667 if ( mLevel == (sal_uInt16)0xFFFF || mLevel == 0)
668 return (sal_uInt16)0xFFFF;
669
670 sal_uInt16 nActLv = IsSingleLevel(mLevel);
671
672 if ( nActLv == (sal_uInt16)0xFFFF )
673 return (sal_uInt16)0xFFFF;
674
675 SvxNumberFormat aFmt(aNum.GetLevel(nActLv));
675 SvxNumberFormat aFmt(aNum.GetLevel(nActLv));
676 const SvxBrushItem* pBrsh = aFmt.GetBrush();
677 const Graphic* pGrf = 0;
678 if ( pBrsh )
679 pGrf = pBrsh->GetGraphic();
680
681 if ( pGrf )
682 {
683 Graphic aGraphic;

--- 6 unchanged lines hidden (view full) ---

690 if (bExist) {
691 Bitmap aSum=pGrf->GetBitmap();
692 Bitmap aSum1=aGraphic.GetBitmap();
693 if (aSum.IsEqual(aSum1))
694 return pEntry->nTabIndex;
695 }
696 }
697 }
676 const SvxBrushItem* pBrsh = aFmt.GetBrush();
677 const Graphic* pGrf = 0;
678 if ( pBrsh )
679 pGrf = pBrsh->GetGraphic();
680
681 if ( pGrf )
682 {
683 Graphic aGraphic;

--- 6 unchanged lines hidden (view full) ---

690 if (bExist) {
691 Bitmap aSum=pGrf->GetBitmap();
692 Bitmap aSum1=aGraphic.GetBitmap();
693 if (aSum.IsEqual(aSum1))
694 return pEntry->nTabIndex;
695 }
696 }
697 }
698
698
699 return (sal_uInt16)0xFFFF;
700}
701
702sal_Bool GraphicBulletsTypeMgr::RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel)
703{
704 if ( mLevel == (sal_uInt16)0xFFFF || mLevel > aNum.GetLevelCount() || mLevel == 0)
705 return sal_False;
706

--- 20 unchanged lines hidden (view full) ---

727 {
728 const String* pGrfName = pBrsh->GetGraphicLink();
729 //String* pGrfName = (String*)(pBrsh->GetGraphicLink());
730 GrfBulDataRelation* pEntry = (GrfBulDataRelation*) aGrfDataLst.GetObject(nIndex);
731 if ( pGrfName )
732 pEntry->sGrfName = *pGrfName;
733 //pEntry->sDescription = sEmpty;
734 pEntry->nGallaryIndex = (sal_uInt16)0xFFFF;
699 return (sal_uInt16)0xFFFF;
700}
701
702sal_Bool GraphicBulletsTypeMgr::RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel)
703{
704 if ( mLevel == (sal_uInt16)0xFFFF || mLevel > aNum.GetLevelCount() || mLevel == 0)
705 return sal_False;
706

--- 20 unchanged lines hidden (view full) ---

727 {
728 const String* pGrfName = pBrsh->GetGraphicLink();
729 //String* pGrfName = (String*)(pBrsh->GetGraphicLink());
730 GrfBulDataRelation* pEntry = (GrfBulDataRelation*) aGrfDataLst.GetObject(nIndex);
731 if ( pGrfName )
732 pEntry->sGrfName = *pGrfName;
733 //pEntry->sDescription = sEmpty;
734 pEntry->nGallaryIndex = (sal_uInt16)0xFFFF;
735 pEntry->bIsCustomized = sal_True;
735 pEntry->bIsCustomized = sal_True;
736 String aStrFromRES = String(SVX_RESSTR( RID_SVXSTR_NUMBULLET_CUSTOM_BULLET_DESCRIPTION));
737 String aReplace = String::CreateFromAscii("%LIST_NUM");
738 String sNUM = String::CreateFromInt32( nIndex + 1 );
739 aStrFromRES.SearchAndReplace(aReplace,sNUM);
740 pEntry->sDescription = aStrFromRES;
741 }else
742 {
743 return sal_False;

--- 23 unchanged lines hidden (view full) ---

767 if(mLevel & nMask)
768 {
769 SvxNumberFormat aFmt(aNum.GetLevel(i));
770 aFmt.SetNumberingType(nSetNumberingType);
771 aFmt.SetPrefix( aEmptyStr );
772 aFmt.SetSuffix( aEmptyStr );
773 aFmt.SetCharFmtName( sNumCharFmtName );
774
736 String aStrFromRES = String(SVX_RESSTR( RID_SVXSTR_NUMBULLET_CUSTOM_BULLET_DESCRIPTION));
737 String aReplace = String::CreateFromAscii("%LIST_NUM");
738 String sNUM = String::CreateFromInt32( nIndex + 1 );
739 aStrFromRES.SearchAndReplace(aReplace,sNUM);
740 pEntry->sDescription = aStrFromRES;
741 }else
742 {
743 return sal_False;

--- 23 unchanged lines hidden (view full) ---

767 if(mLevel & nMask)
768 {
769 SvxNumberFormat aFmt(aNum.GetLevel(i));
770 aFmt.SetNumberingType(nSetNumberingType);
771 aFmt.SetPrefix( aEmptyStr );
772 aFmt.SetSuffix( aEmptyStr );
773 aFmt.SetCharFmtName( sNumCharFmtName );
774
775 Graphic aGraphic;
776 if(GalleryExplorer::GetGraphicObj( GALLERY_THEME_BULLETS, pEntry->nGallaryIndex, &aGraphic))
775 Graphic aGraphic;
776 if(GalleryExplorer::GetGraphicObj( GALLERY_THEME_BULLETS, pEntry->nGallaryIndex, &aGraphic))
777 {
777 {
778 Size aSize = SvxNumberFormat::GetGraphicSizeMM100(&aGraphic);
779 sal_Int16 eOrient = text::VertOrientation::LINE_CENTER;
778 Size aSize = SvxNumberFormat::GetGraphicSizeMM100(&aGraphic);
779 sal_Int16 eOrient = text::VertOrientation::LINE_CENTER;
780 aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)GetMapUnit());
780 aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)GetMapUnit());
781 SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH );
782 aFmt.SetGraphicBrush( &aBrush, &aSize, &eOrient );
781 SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH );
782 aFmt.SetGraphicBrush( &aBrush, &aSize, &eOrient );
783 }
783 }
784 else// if(pGrfName)
784 else // if(pGrfName)
785 aFmt.SetGraphic( sGrfName );
786
787 aNum.SetLevel(i, aFmt);
788 }
789 nMask <<= 1 ;
790 }
785 aFmt.SetGraphic( sGrfName );
786
787 aNum.SetLevel(i, aFmt);
788 }
789 nMask <<= 1 ;
790 }
791
791
792 return sal_True;
793}
794String GraphicBulletsTypeMgr::GetDescription(sal_uInt16 nIndex,sal_Bool /* isDefault */)
795{
796 String sRet;
797 sal_uInt16 nLength = 0;
798 nLength = aGrfDataLst.Count() ;
799

--- 21 unchanged lines hidden (view full) ---

821 else
822 {
823 GrfBulDataRelation* pEntry = (GrfBulDataRelation*) aGrfDataLst.GetObject(nIndex);
824 if ( pEntry )
825 {
826 bRet = pEntry->bIsCustomized;
827 };
828 }
792 return sal_True;
793}
794String GraphicBulletsTypeMgr::GetDescription(sal_uInt16 nIndex,sal_Bool /* isDefault */)
795{
796 String sRet;
797 sal_uInt16 nLength = 0;
798 nLength = aGrfDataLst.Count() ;
799

--- 21 unchanged lines hidden (view full) ---

821 else
822 {
823 GrfBulDataRelation* pEntry = (GrfBulDataRelation*) aGrfDataLst.GetObject(nIndex);
824 if ( pEntry )
825 {
826 bRet = pEntry->bIsCustomized;
827 };
828 }
829
829
830 return bRet;
831}
832String GraphicBulletsTypeMgr::GetGrfName(sal_uInt16 nIndex)
830 return bRet;
831}
832String GraphicBulletsTypeMgr::GetGrfName(sal_uInt16 nIndex)
833{
833{
834 String sRet;
835 if ( nIndex < aGrfDataLst.Count() )
836 {
837 GrfBulDataRelation* pEntry = (GrfBulDataRelation*) aGrfDataLst.GetObject(nIndex);
838 if ( pEntry )
839 {
840 sRet = pEntry->sGrfName;
834 String sRet;
835 if ( nIndex < aGrfDataLst.Count() )
836 {
837 GrfBulDataRelation* pEntry = (GrfBulDataRelation*) aGrfDataLst.GetObject(nIndex);
838 if ( pEntry )
839 {
840 sRet = pEntry->sGrfName;
841 }
842 }
843
841 }
842 }
843
844 return sRet;
845}
846/***************************************************************************************************
847**********************Mix Bullets Type lib**************************************************************
848****************************************************************************************************/
849MixBulletsTypeMgr* MixBulletsTypeMgr::_instance = 0;
850MixBulletsSettings_Impl* MixBulletsTypeMgr::pActualBullets[] ={0,0,0,0,0,0,0,0};
851MixBulletsSettings_Impl* MixBulletsTypeMgr::pDefaultActualBullets[] ={0,0,0,0,0,0,0,0};

--- 26 unchanged lines hidden (view full) ---

878
879MixBulletsTypeMgr::MixBulletsTypeMgr(const MixBulletsTypeMgr& aTypeMgr):
880 NBOTypeMgrBase(aTypeMgr)
881{
882 for (sal_uInt16 i=0;i<DEFAULT_BULLET_TYPES;i++)
883 {
884 if ( aTypeMgr.pActualBullets[i]->eType == eNBType::BULLETS )
885 {
844 return sRet;
845}
846/***************************************************************************************************
847**********************Mix Bullets Type lib**************************************************************
848****************************************************************************************************/
849MixBulletsTypeMgr* MixBulletsTypeMgr::_instance = 0;
850MixBulletsSettings_Impl* MixBulletsTypeMgr::pActualBullets[] ={0,0,0,0,0,0,0,0};
851MixBulletsSettings_Impl* MixBulletsTypeMgr::pDefaultActualBullets[] ={0,0,0,0,0,0,0,0};

--- 26 unchanged lines hidden (view full) ---

878
879MixBulletsTypeMgr::MixBulletsTypeMgr(const MixBulletsTypeMgr& aTypeMgr):
880 NBOTypeMgrBase(aTypeMgr)
881{
882 for (sal_uInt16 i=0;i<DEFAULT_BULLET_TYPES;i++)
883 {
884 if ( aTypeMgr.pActualBullets[i]->eType == eNBType::BULLETS )
885 {
886 pActualBullets[i]->eType = aTypeMgr.pActualBullets[i]->eType;
887 pActualBullets[i]->nIndex = aTypeMgr.pActualBullets[i]->nIndex; // index in the tab page display
886 pActualBullets[i]->eType = aTypeMgr.pActualBullets[i]->eType;
887 pActualBullets[i]->nIndex = aTypeMgr.pActualBullets[i]->nIndex; // Index in the tab page display
888 pActualBullets[i]->nIndexDefault = aTypeMgr.pActualBullets[i]->nIndexDefault;
889 pActualBullets[i]->pBullets = new BulletsSettings_Impl(eNBType::BULLETS) ;
890 ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->cBulletChar = ((BulletsSettings_Impl*)(aTypeMgr.pActualBullets[i]->pBullets))->cBulletChar;
891 ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->aFont = ((BulletsSettings_Impl*)(aTypeMgr.pActualBullets[i]->pBullets))->aFont;
892 ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->sDescription = ((BulletsSettings_Impl*)(aTypeMgr.pActualBullets[i]->pBullets))->sDescription;
893 ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->bIsCustomized = ((BulletsSettings_Impl*)(aTypeMgr.pActualBullets[i]->pBullets))->bIsCustomized;
894 ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->eType = ((BulletsSettings_Impl*)(aTypeMgr.pActualBullets[i]->pBullets))->eType;
895 }else if ( aTypeMgr.pActualBullets[i]->eType == eNBType::GRAPHICBULLETS )
896 {
888 pActualBullets[i]->nIndexDefault = aTypeMgr.pActualBullets[i]->nIndexDefault;
889 pActualBullets[i]->pBullets = new BulletsSettings_Impl(eNBType::BULLETS) ;
890 ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->cBulletChar = ((BulletsSettings_Impl*)(aTypeMgr.pActualBullets[i]->pBullets))->cBulletChar;
891 ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->aFont = ((BulletsSettings_Impl*)(aTypeMgr.pActualBullets[i]->pBullets))->aFont;
892 ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->sDescription = ((BulletsSettings_Impl*)(aTypeMgr.pActualBullets[i]->pBullets))->sDescription;
893 ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->bIsCustomized = ((BulletsSettings_Impl*)(aTypeMgr.pActualBullets[i]->pBullets))->bIsCustomized;
894 ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->eType = ((BulletsSettings_Impl*)(aTypeMgr.pActualBullets[i]->pBullets))->eType;
895 }else if ( aTypeMgr.pActualBullets[i]->eType == eNBType::GRAPHICBULLETS )
896 {
897 pActualBullets[i]->eType = aTypeMgr.pActualBullets[i]->eType;
898 pActualBullets[i]->nIndex = aTypeMgr.pActualBullets[i]->nIndex; // index in the tab page display
897 pActualBullets[i]->eType = aTypeMgr.pActualBullets[i]->eType;
898 pActualBullets[i]->nIndex = aTypeMgr.pActualBullets[i]->nIndex; // Index in the tab page display
899 pActualBullets[i]->nIndexDefault = aTypeMgr.pActualBullets[i]->nIndexDefault;
900 pActualBullets[i]->pBullets = new GrfBulDataRelation(eNBType::GRAPHICBULLETS) ;
901 ((GrfBulDataRelation*)(pActualBullets[i]->pBullets))->sGrfName = ((GrfBulDataRelation*)(aTypeMgr.pActualBullets[i]->pBullets))->sGrfName;
902 ((GrfBulDataRelation*)(pActualBullets[i]->pBullets))->sDescription = ((GrfBulDataRelation*)(aTypeMgr.pActualBullets[i]->pBullets))->sDescription;
903 ((GrfBulDataRelation*)(pActualBullets[i]->pBullets))->bIsCustomized = ((GrfBulDataRelation*)(aTypeMgr.pActualBullets[i]->pBullets))->bIsCustomized;
904 ((GrfBulDataRelation*)(pActualBullets[i]->pBullets))->eType = ((GrfBulDataRelation*)(aTypeMgr.pActualBullets[i]->pBullets))->eType;
905 if ( ((GrfBulDataRelation*)(aTypeMgr.pActualBullets[i]->pBullets))->bIsCustomized && ((GrfBulDataRelation*)(aTypeMgr.pActualBullets[i]->pBullets))->pGrfObj != NULL)
906 {
907 ((GrfBulDataRelation*)(pActualBullets[i]->pBullets))->pGrfObj = ((GrfBulDataRelation*)(aTypeMgr.pActualBullets[i]->pBullets))->pGrfObj;
908 }
909 }
910 }
911 ImplLoad(String::CreateFromAscii("standard.sya"));
912}
913void MixBulletsTypeMgr::Init()
914{
915 BulletsTypeMgr* pBTMgr = BulletsTypeMgr::GetInstance();
916 if ( pBTMgr )
917 {
899 pActualBullets[i]->nIndexDefault = aTypeMgr.pActualBullets[i]->nIndexDefault;
900 pActualBullets[i]->pBullets = new GrfBulDataRelation(eNBType::GRAPHICBULLETS) ;
901 ((GrfBulDataRelation*)(pActualBullets[i]->pBullets))->sGrfName = ((GrfBulDataRelation*)(aTypeMgr.pActualBullets[i]->pBullets))->sGrfName;
902 ((GrfBulDataRelation*)(pActualBullets[i]->pBullets))->sDescription = ((GrfBulDataRelation*)(aTypeMgr.pActualBullets[i]->pBullets))->sDescription;
903 ((GrfBulDataRelation*)(pActualBullets[i]->pBullets))->bIsCustomized = ((GrfBulDataRelation*)(aTypeMgr.pActualBullets[i]->pBullets))->bIsCustomized;
904 ((GrfBulDataRelation*)(pActualBullets[i]->pBullets))->eType = ((GrfBulDataRelation*)(aTypeMgr.pActualBullets[i]->pBullets))->eType;
905 if ( ((GrfBulDataRelation*)(aTypeMgr.pActualBullets[i]->pBullets))->bIsCustomized && ((GrfBulDataRelation*)(aTypeMgr.pActualBullets[i]->pBullets))->pGrfObj != NULL)
906 {
907 ((GrfBulDataRelation*)(pActualBullets[i]->pBullets))->pGrfObj = ((GrfBulDataRelation*)(aTypeMgr.pActualBullets[i]->pBullets))->pGrfObj;
908 }
909 }
910 }
911 ImplLoad(String::CreateFromAscii("standard.sya"));
912}
913void MixBulletsTypeMgr::Init()
914{
915 BulletsTypeMgr* pBTMgr = BulletsTypeMgr::GetInstance();
916 if ( pBTMgr )
917 {
918 //Index 1
918 // Index 1
919 pActualBullets[0] = new MixBulletsSettings_Impl(eNBType::BULLETS);
920 pActualBullets[0]->eType = eNBType::BULLETS;
919 pActualBullets[0] = new MixBulletsSettings_Impl(eNBType::BULLETS);
920 pActualBullets[0]->eType = eNBType::BULLETS;
921 pActualBullets[0]->nIndex = 0+1; //index in the tab page display,decrease 1 to the index within arr
922 pActualBullets[0]->nIndexDefault = 2; //index in the tab page display,decrease 1 to the index within arr
921 pActualBullets[0]->nIndex = 0+1; // Index in the tab page display,decrease 1 to the index within arr
922 pActualBullets[0]->nIndexDefault = 2; // Index in the tab page display,decrease 1 to the index within arr
923 pActualBullets[0]->pBullets = new BulletsSettings_Impl(eNBType::BULLETS) ;
924 ((BulletsSettings_Impl*)(pActualBullets[0]->pBullets))->cBulletChar = pBTMgr->GetBulChar(pActualBullets[0]->nIndexDefault-1);
925 ((BulletsSettings_Impl*)(pActualBullets[0]->pBullets))->aFont = pBTMgr->GetBulCharFont(pActualBullets[0]->nIndexDefault-1);
926 ((BulletsSettings_Impl*)(pActualBullets[0]->pBullets))->sDescription = pBTMgr->GetDescription(pActualBullets[0]->nIndexDefault-1);
927 ((BulletsSettings_Impl*)(pActualBullets[0]->pBullets))->bIsCustomized = pBTMgr->IsCustomized(pActualBullets[0]->nIndexDefault-1);
928 ((BulletsSettings_Impl*)(pActualBullets[0]->pBullets))->eType = eNBType::BULLETS;
929
923 pActualBullets[0]->pBullets = new BulletsSettings_Impl(eNBType::BULLETS) ;
924 ((BulletsSettings_Impl*)(pActualBullets[0]->pBullets))->cBulletChar = pBTMgr->GetBulChar(pActualBullets[0]->nIndexDefault-1);
925 ((BulletsSettings_Impl*)(pActualBullets[0]->pBullets))->aFont = pBTMgr->GetBulCharFont(pActualBullets[0]->nIndexDefault-1);
926 ((BulletsSettings_Impl*)(pActualBullets[0]->pBullets))->sDescription = pBTMgr->GetDescription(pActualBullets[0]->nIndexDefault-1);
927 ((BulletsSettings_Impl*)(pActualBullets[0]->pBullets))->bIsCustomized = pBTMgr->IsCustomized(pActualBullets[0]->nIndexDefault-1);
928 ((BulletsSettings_Impl*)(pActualBullets[0]->pBullets))->eType = eNBType::BULLETS;
929
930 //Index 2
930 // Index 2
931 pActualBullets[1] = new MixBulletsSettings_Impl(eNBType::BULLETS);
932 pActualBullets[1]->eType = eNBType::BULLETS;
931 pActualBullets[1] = new MixBulletsSettings_Impl(eNBType::BULLETS);
932 pActualBullets[1]->eType = eNBType::BULLETS;
933 pActualBullets[1]->nIndex = 1+1; //index in the tab page display,decrease 1 to the index within arr
934 pActualBullets[1]->nIndexDefault = 3; //index in the tab page display,decrease 1 to the index within arr
933 pActualBullets[1]->nIndex = 1+1; // Index in the tab page display,decrease 1 to the index within arr
934 pActualBullets[1]->nIndexDefault = 3; // Index in the tab page display,decrease 1 to the index within arr
935 pActualBullets[1]->pBullets = new BulletsSettings_Impl(eNBType::BULLETS) ;
936 ((BulletsSettings_Impl*)(pActualBullets[1]->pBullets))->cBulletChar = pBTMgr->GetBulChar(pActualBullets[1]->nIndexDefault-1);
937 ((BulletsSettings_Impl*)(pActualBullets[1]->pBullets))->aFont = pBTMgr->GetBulCharFont(pActualBullets[1]->nIndexDefault-1);
938 ((BulletsSettings_Impl*)(pActualBullets[1]->pBullets))->sDescription = pBTMgr->GetDescription(pActualBullets[1]->nIndexDefault-1);
939 ((BulletsSettings_Impl*)(pActualBullets[1]->pBullets))->bIsCustomized = pBTMgr->IsCustomized(pActualBullets[1]->nIndexDefault-1);
940 ((BulletsSettings_Impl*)(pActualBullets[1]->pBullets))->eType = eNBType::BULLETS;
941
935 pActualBullets[1]->pBullets = new BulletsSettings_Impl(eNBType::BULLETS) ;
936 ((BulletsSettings_Impl*)(pActualBullets[1]->pBullets))->cBulletChar = pBTMgr->GetBulChar(pActualBullets[1]->nIndexDefault-1);
937 ((BulletsSettings_Impl*)(pActualBullets[1]->pBullets))->aFont = pBTMgr->GetBulCharFont(pActualBullets[1]->nIndexDefault-1);
938 ((BulletsSettings_Impl*)(pActualBullets[1]->pBullets))->sDescription = pBTMgr->GetDescription(pActualBullets[1]->nIndexDefault-1);
939 ((BulletsSettings_Impl*)(pActualBullets[1]->pBullets))->bIsCustomized = pBTMgr->IsCustomized(pActualBullets[1]->nIndexDefault-1);
940 ((BulletsSettings_Impl*)(pActualBullets[1]->pBullets))->eType = eNBType::BULLETS;
941
942 //Index 3
942 // Index 3
943 pActualBullets[2] = new MixBulletsSettings_Impl(eNBType::BULLETS);
944 pActualBullets[2]->eType = eNBType::BULLETS;
943 pActualBullets[2] = new MixBulletsSettings_Impl(eNBType::BULLETS);
944 pActualBullets[2]->eType = eNBType::BULLETS;
945 pActualBullets[2]->nIndex = 2+1; //index in the tab page display,decrease 1 to the index within arr
946 pActualBullets[2]->nIndexDefault = 4; //index in the tab page display,decrease 1 to the index within arr
945 pActualBullets[2]->nIndex = 2+1; // Index in the tab page display,decrease 1 to the index within arr
946 pActualBullets[2]->nIndexDefault = 4; // Index in the tab page display,decrease 1 to the index within arr
947 pActualBullets[2]->pBullets = new BulletsSettings_Impl(eNBType::BULLETS) ;
948 ((BulletsSettings_Impl*)(pActualBullets[2]->pBullets))->cBulletChar = pBTMgr->GetBulChar(pActualBullets[2]->nIndexDefault-1);
949 ((BulletsSettings_Impl*)(pActualBullets[2]->pBullets))->aFont = pBTMgr->GetBulCharFont(pActualBullets[2]->nIndexDefault-1);
950 ((BulletsSettings_Impl*)(pActualBullets[2]->pBullets))->sDescription = pBTMgr->GetDescription(pActualBullets[2]->nIndexDefault-1);
951 ((BulletsSettings_Impl*)(pActualBullets[2]->pBullets))->bIsCustomized = pBTMgr->IsCustomized(pActualBullets[2]->nIndexDefault-1);
952 ((BulletsSettings_Impl*)(pActualBullets[2]->pBullets))->eType = eNBType::BULLETS;
953
947 pActualBullets[2]->pBullets = new BulletsSettings_Impl(eNBType::BULLETS) ;
948 ((BulletsSettings_Impl*)(pActualBullets[2]->pBullets))->cBulletChar = pBTMgr->GetBulChar(pActualBullets[2]->nIndexDefault-1);
949 ((BulletsSettings_Impl*)(pActualBullets[2]->pBullets))->aFont = pBTMgr->GetBulCharFont(pActualBullets[2]->nIndexDefault-1);
950 ((BulletsSettings_Impl*)(pActualBullets[2]->pBullets))->sDescription = pBTMgr->GetDescription(pActualBullets[2]->nIndexDefault-1);
951 ((BulletsSettings_Impl*)(pActualBullets[2]->pBullets))->bIsCustomized = pBTMgr->IsCustomized(pActualBullets[2]->nIndexDefault-1);
952 ((BulletsSettings_Impl*)(pActualBullets[2]->pBullets))->eType = eNBType::BULLETS;
953
954 //Index 4
954 // Index 4
955 pActualBullets[3] = new MixBulletsSettings_Impl(eNBType::BULLETS);
956 pActualBullets[3]->eType = eNBType::BULLETS;
955 pActualBullets[3] = new MixBulletsSettings_Impl(eNBType::BULLETS);
956 pActualBullets[3]->eType = eNBType::BULLETS;
957 pActualBullets[3]->nIndex = 3+1; //index in the tab page display,decrease 1 to the index within arr
958 pActualBullets[3]->nIndexDefault = 5; //index in the tab page display,decrease 1 to the index within arr
957 pActualBullets[3]->nIndex = 3+1; // Index in the tab page display,decrease 1 to the index within arr
958 pActualBullets[3]->nIndexDefault = 5; // Index in the tab page display,decrease 1 to the index within arr
959 pActualBullets[3]->pBullets = new BulletsSettings_Impl(eNBType::BULLETS) ;
960 ((BulletsSettings_Impl*)(pActualBullets[3]->pBullets))->cBulletChar = pBTMgr->GetBulChar(pActualBullets[3]->nIndexDefault-1);
961 ((BulletsSettings_Impl*)(pActualBullets[3]->pBullets))->aFont = pBTMgr->GetBulCharFont(pActualBullets[3]->nIndexDefault-1);
962 ((BulletsSettings_Impl*)(pActualBullets[3]->pBullets))->sDescription = pBTMgr->GetDescription(pActualBullets[3]->nIndexDefault-1);
963 ((BulletsSettings_Impl*)(pActualBullets[3]->pBullets))->bIsCustomized = pBTMgr->IsCustomized(pActualBullets[3]->nIndexDefault-1);
964 ((BulletsSettings_Impl*)(pActualBullets[3]->pBullets))->eType = eNBType::BULLETS;
965
959 pActualBullets[3]->pBullets = new BulletsSettings_Impl(eNBType::BULLETS) ;
960 ((BulletsSettings_Impl*)(pActualBullets[3]->pBullets))->cBulletChar = pBTMgr->GetBulChar(pActualBullets[3]->nIndexDefault-1);
961 ((BulletsSettings_Impl*)(pActualBullets[3]->pBullets))->aFont = pBTMgr->GetBulCharFont(pActualBullets[3]->nIndexDefault-1);
962 ((BulletsSettings_Impl*)(pActualBullets[3]->pBullets))->sDescription = pBTMgr->GetDescription(pActualBullets[3]->nIndexDefault-1);
963 ((BulletsSettings_Impl*)(pActualBullets[3]->pBullets))->bIsCustomized = pBTMgr->IsCustomized(pActualBullets[3]->nIndexDefault-1);
964 ((BulletsSettings_Impl*)(pActualBullets[3]->pBullets))->eType = eNBType::BULLETS;
965
966 //Index 5
966 // Index 5
967 pActualBullets[4] = new MixBulletsSettings_Impl(eNBType::BULLETS);
968 pActualBullets[4]->eType = eNBType::BULLETS;
967 pActualBullets[4] = new MixBulletsSettings_Impl(eNBType::BULLETS);
968 pActualBullets[4]->eType = eNBType::BULLETS;
969 pActualBullets[4]->nIndex = 4+1; //index in the tab page display,decrease 1 to the index within arr
970 pActualBullets[4]->nIndexDefault = 6; //index in the tab page display,decrease 1 to the index within arr
969 pActualBullets[4]->nIndex = 4+1; // Index in the tab page display,decrease 1 to the index within arr
970 pActualBullets[4]->nIndexDefault = 6; // Index in the tab page display,decrease 1 to the index within arr
971 pActualBullets[4]->pBullets = new BulletsSettings_Impl(eNBType::BULLETS) ;
972 ((BulletsSettings_Impl*)(pActualBullets[4]->pBullets))->cBulletChar = pBTMgr->GetBulChar(pActualBullets[4]->nIndexDefault-1);
973 ((BulletsSettings_Impl*)(pActualBullets[4]->pBullets))->aFont = pBTMgr->GetBulCharFont(pActualBullets[4]->nIndexDefault-1);
974 ((BulletsSettings_Impl*)(pActualBullets[4]->pBullets))->sDescription = pBTMgr->GetDescription(pActualBullets[4]->nIndexDefault-1);
975 ((BulletsSettings_Impl*)(pActualBullets[4]->pBullets))->bIsCustomized = pBTMgr->IsCustomized(pActualBullets[4]->nIndexDefault-1);
976 ((BulletsSettings_Impl*)(pActualBullets[4]->pBullets))->eType = eNBType::BULLETS;
977
971 pActualBullets[4]->pBullets = new BulletsSettings_Impl(eNBType::BULLETS) ;
972 ((BulletsSettings_Impl*)(pActualBullets[4]->pBullets))->cBulletChar = pBTMgr->GetBulChar(pActualBullets[4]->nIndexDefault-1);
973 ((BulletsSettings_Impl*)(pActualBullets[4]->pBullets))->aFont = pBTMgr->GetBulCharFont(pActualBullets[4]->nIndexDefault-1);
974 ((BulletsSettings_Impl*)(pActualBullets[4]->pBullets))->sDescription = pBTMgr->GetDescription(pActualBullets[4]->nIndexDefault-1);
975 ((BulletsSettings_Impl*)(pActualBullets[4]->pBullets))->bIsCustomized = pBTMgr->IsCustomized(pActualBullets[4]->nIndexDefault-1);
976 ((BulletsSettings_Impl*)(pActualBullets[4]->pBullets))->eType = eNBType::BULLETS;
977
978 //Index 6
978 // Index 6
979 pActualBullets[5] = new MixBulletsSettings_Impl(eNBType::BULLETS);
980 pActualBullets[5]->eType = eNBType::BULLETS;
979 pActualBullets[5] = new MixBulletsSettings_Impl(eNBType::BULLETS);
980 pActualBullets[5]->eType = eNBType::BULLETS;
981 pActualBullets[5]->nIndex = 5+1; //index in the tab page display,decrease 1 to the index within arr
982 pActualBullets[5]->nIndexDefault = 8; //index in the tab page display,decrease 1 to the index within arr
981 pActualBullets[5]->nIndex = 5+1; // Index in the tab page display,decrease 1 to the index within arr
982 pActualBullets[5]->nIndexDefault = 8; // Index in the tab page display,decrease 1 to the index within arr
983 pActualBullets[5]->pBullets = new BulletsSettings_Impl(eNBType::BULLETS) ;
984 ((BulletsSettings_Impl*)(pActualBullets[5]->pBullets))->cBulletChar = pBTMgr->GetBulChar(pActualBullets[5]->nIndexDefault-1);
985 ((BulletsSettings_Impl*)(pActualBullets[5]->pBullets))->aFont = pBTMgr->GetBulCharFont(pActualBullets[5]->nIndexDefault-1);
986 ((BulletsSettings_Impl*)(pActualBullets[5]->pBullets))->sDescription = pBTMgr->GetDescription(pActualBullets[5]->nIndexDefault-1);
987 ((BulletsSettings_Impl*)(pActualBullets[5]->pBullets))->bIsCustomized = pBTMgr->IsCustomized(pActualBullets[5]->nIndexDefault-1);
988 ((BulletsSettings_Impl*)(pActualBullets[5]->pBullets))->eType = eNBType::BULLETS;
989 }
990
991 GraphicBulletsTypeMgr* mGrfTMgr = GraphicBulletsTypeMgr::GetInstance();
992 if ( mGrfTMgr )
993 {
983 pActualBullets[5]->pBullets = new BulletsSettings_Impl(eNBType::BULLETS) ;
984 ((BulletsSettings_Impl*)(pActualBullets[5]->pBullets))->cBulletChar = pBTMgr->GetBulChar(pActualBullets[5]->nIndexDefault-1);
985 ((BulletsSettings_Impl*)(pActualBullets[5]->pBullets))->aFont = pBTMgr->GetBulCharFont(pActualBullets[5]->nIndexDefault-1);
986 ((BulletsSettings_Impl*)(pActualBullets[5]->pBullets))->sDescription = pBTMgr->GetDescription(pActualBullets[5]->nIndexDefault-1);
987 ((BulletsSettings_Impl*)(pActualBullets[5]->pBullets))->bIsCustomized = pBTMgr->IsCustomized(pActualBullets[5]->nIndexDefault-1);
988 ((BulletsSettings_Impl*)(pActualBullets[5]->pBullets))->eType = eNBType::BULLETS;
989 }
990
991 GraphicBulletsTypeMgr* mGrfTMgr = GraphicBulletsTypeMgr::GetInstance();
992 if ( mGrfTMgr )
993 {
994 //Index 7
994 // Index 7
995 pActualBullets[6] = new MixBulletsSettings_Impl(eNBType::GRAPHICBULLETS);
996 pActualBullets[6]->eType = eNBType::GRAPHICBULLETS;
995 pActualBullets[6] = new MixBulletsSettings_Impl(eNBType::GRAPHICBULLETS);
996 pActualBullets[6]->eType = eNBType::GRAPHICBULLETS;
997 pActualBullets[6]->nIndex = 6+1; //index in the tab page display,decrease 1 to the index within arr
998 pActualBullets[6]->nIndexDefault = 9; //index in the tab page display,decrease 1 to the index within arr
997 pActualBullets[6]->nIndex = 6+1; // Index in the tab page display,decrease 1 to the index within arr
998 pActualBullets[6]->nIndexDefault = 9; // Index in the tab page display,decrease 1 to the index within arr
999 pActualBullets[6]->pBullets = new GrfBulDataRelation(eNBType::GRAPHICBULLETS) ;
1000 ((GrfBulDataRelation*)(pActualBullets[6]->pBullets))->sGrfName = mGrfTMgr->GetGrfName(pActualBullets[6]->nIndexDefault);
1001 ((GrfBulDataRelation*)(pActualBullets[6]->pBullets))->sDescription = mGrfTMgr->GetDescription(pActualBullets[6]->nIndexDefault);
1002 ((GrfBulDataRelation*)(pActualBullets[6]->pBullets))->bIsCustomized = mGrfTMgr->IsCustomized(pActualBullets[6]->nIndexDefault);
1003 ((GrfBulDataRelation*)(pActualBullets[6]->pBullets))->eType = eNBType::GRAPHICBULLETS;
1004
999 pActualBullets[6]->pBullets = new GrfBulDataRelation(eNBType::GRAPHICBULLETS) ;
1000 ((GrfBulDataRelation*)(pActualBullets[6]->pBullets))->sGrfName = mGrfTMgr->GetGrfName(pActualBullets[6]->nIndexDefault);
1001 ((GrfBulDataRelation*)(pActualBullets[6]->pBullets))->sDescription = mGrfTMgr->GetDescription(pActualBullets[6]->nIndexDefault);
1002 ((GrfBulDataRelation*)(pActualBullets[6]->pBullets))->bIsCustomized = mGrfTMgr->IsCustomized(pActualBullets[6]->nIndexDefault);
1003 ((GrfBulDataRelation*)(pActualBullets[6]->pBullets))->eType = eNBType::GRAPHICBULLETS;
1004
1005 //Index 8
1005 // Index 8
1006 pActualBullets[7] = new MixBulletsSettings_Impl(eNBType::GRAPHICBULLETS);
1007 pActualBullets[7]->eType = eNBType::GRAPHICBULLETS;
1006 pActualBullets[7] = new MixBulletsSettings_Impl(eNBType::GRAPHICBULLETS);
1007 pActualBullets[7]->eType = eNBType::GRAPHICBULLETS;
1008 pActualBullets[7]->nIndex = 7+1; //index in the tab page display,decrease 1 to the index within arr
1009 pActualBullets[7]->nIndexDefault = 23; //index in the tab page display,decrease 1 to the index within arr
1008 pActualBullets[7]->nIndex = 7+1; // Index in the tab page display,decrease 1 to the index within arr
1009 pActualBullets[7]->nIndexDefault = 23; // Index in the tab page display,decrease 1 to the index within arr
1010 pActualBullets[7]->pBullets = new GrfBulDataRelation(eNBType::GRAPHICBULLETS) ;
1011 ((GrfBulDataRelation*)(pActualBullets[7]->pBullets))->sGrfName = mGrfTMgr->GetGrfName(pActualBullets[7]->nIndexDefault);
1012 ((GrfBulDataRelation*)(pActualBullets[7]->pBullets))->sDescription = mGrfTMgr->GetDescription(pActualBullets[7]->nIndexDefault);
1013 ((GrfBulDataRelation*)(pActualBullets[7]->pBullets))->bIsCustomized = mGrfTMgr->IsCustomized(pActualBullets[7]->nIndexDefault);
1014 ((GrfBulDataRelation*)(pActualBullets[7]->pBullets))->eType = eNBType::GRAPHICBULLETS;
1015 }
1010 pActualBullets[7]->pBullets = new GrfBulDataRelation(eNBType::GRAPHICBULLETS) ;
1011 ((GrfBulDataRelation*)(pActualBullets[7]->pBullets))->sGrfName = mGrfTMgr->GetGrfName(pActualBullets[7]->nIndexDefault);
1012 ((GrfBulDataRelation*)(pActualBullets[7]->pBullets))->sDescription = mGrfTMgr->GetDescription(pActualBullets[7]->nIndexDefault);
1013 ((GrfBulDataRelation*)(pActualBullets[7]->pBullets))->bIsCustomized = mGrfTMgr->IsCustomized(pActualBullets[7]->nIndexDefault);
1014 ((GrfBulDataRelation*)(pActualBullets[7]->pBullets))->eType = eNBType::GRAPHICBULLETS;
1015 }
1016
1016
1017}
1018sal_uInt16 MixBulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex)
1017}
1018sal_uInt16 MixBulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex)
1019{
1019{
1020 if ( mLevel == (sal_uInt16)0xFFFF || mLevel == 0)
1021 return (sal_uInt16)0xFFFF;
1022 //if ( !lcl_IsNumFmtSet(pNR, mLevel) ) return (sal_uInt16)0xFFFF;
1023
1024 sal_uInt16 nActLv = IsSingleLevel(mLevel);
1025
1026 if ( nActLv == (sal_uInt16)0xFFFF )
1027 return (sal_uInt16)0xFFFF;
1028
1029 SvxNumberFormat aFmt(aNum.GetLevel(nActLv));
1030 sal_Int16 eNumType = aFmt.GetNumberingType();
1031 if( eNumType == SVX_NUM_CHAR_SPECIAL)
1032 {
1033 sal_Unicode cChar = aFmt.GetBulletChar();
1034 const Font* pFont = aFmt.GetBulletFont();
1035 String sName = pFont?pFont->GetName():String();
1020 if ( mLevel == (sal_uInt16)0xFFFF || mLevel == 0)
1021 return (sal_uInt16)0xFFFF;
1022 //if ( !lcl_IsNumFmtSet(pNR, mLevel) ) return (sal_uInt16)0xFFFF;
1023
1024 sal_uInt16 nActLv = IsSingleLevel(mLevel);
1025
1026 if ( nActLv == (sal_uInt16)0xFFFF )
1027 return (sal_uInt16)0xFFFF;
1028
1029 SvxNumberFormat aFmt(aNum.GetLevel(nActLv));
1030 sal_Int16 eNumType = aFmt.GetNumberingType();
1031 if( eNumType == SVX_NUM_CHAR_SPECIAL)
1032 {
1033 sal_Unicode cChar = aFmt.GetBulletChar();
1034 const Font* pFont = aFmt.GetBulletFont();
1035 String sName = pFont?pFont->GetName():String();
1036
1036
1037 for(sal_uInt16 i = nFromIndex; i < DEFAULT_BULLET_TYPES; i++)
1038 {
1039 if ( pActualBullets[i]->eType == eNBType::BULLETS )
1040 {
1041 String ssName = ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->aFont.GetName();
1042 if ( (cChar == ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->cBulletChar||
1043 (cChar == 9830 && 57356 == ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->cBulletChar) ||
1044 (cChar == 9632 && 57354 == ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->cBulletChar)))//&&
1045 //(pFont && pFont->GetName().CompareTo(((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->aFont.GetName())==COMPARE_EQUAL) )
1037 for(sal_uInt16 i = nFromIndex; i < DEFAULT_BULLET_TYPES; i++)
1038 {
1039 if ( pActualBullets[i]->eType == eNBType::BULLETS )
1040 {
1041 String ssName = ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->aFont.GetName();
1042 if ( (cChar == ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->cBulletChar||
1043 (cChar == 9830 && 57356 == ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->cBulletChar) ||
1044 (cChar == 9632 && 57354 == ((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->cBulletChar)))//&&
1045 //(pFont && pFont->GetName().CompareTo(((BulletsSettings_Impl*)(pActualBullets[i]->pBullets))->aFont.GetName())==COMPARE_EQUAL) )
1046 {
1046 {
1047 return pActualBullets[i]->nIndex;
1048 }
1049 }
1050 }
1051 }else if ( (eNumType&(~LINK_TOKEN)) == SVX_NUM_BITMAP )
1052 {
1053 const SvxBrushItem* pBrsh = aFmt.GetBrush();
1054 const Graphic* pGrf = 0;

--- 34 unchanged lines hidden (view full) ---

1089
1090sal_Bool MixBulletsTypeMgr::RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel)
1091{
1092 if ( mLevel == (sal_uInt16)0xFFFF || mLevel == 0 || nIndex>=DEFAULT_BULLET_TYPES)
1093 return sal_False;
1094
1095 //if ( GetNBOIndexForNumRule(aNum,mLevel) != (sal_uInt16)0xFFFF )
1096 // return sal_False;
1047 return pActualBullets[i]->nIndex;
1048 }
1049 }
1050 }
1051 }else if ( (eNumType&(~LINK_TOKEN)) == SVX_NUM_BITMAP )
1052 {
1053 const SvxBrushItem* pBrsh = aFmt.GetBrush();
1054 const Graphic* pGrf = 0;

--- 34 unchanged lines hidden (view full) ---

1089
1090sal_Bool MixBulletsTypeMgr::RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel)
1091{
1092 if ( mLevel == (sal_uInt16)0xFFFF || mLevel == 0 || nIndex>=DEFAULT_BULLET_TYPES)
1093 return sal_False;
1094
1095 //if ( GetNBOIndexForNumRule(aNum,mLevel) != (sal_uInt16)0xFFFF )
1096 // return sal_False;
1097
1097
1098 sal_uInt16 nActLv = IsSingleLevel(mLevel);
1099
1100 if ( nActLv == (sal_uInt16)0xFFFF )
1101 return sal_False;
1102
1103 SvxNumberFormat aFmt(aNum.GetLevel(nActLv));
1104 sal_Int16 eNumType = aFmt.GetNumberingType();
1105 if( eNumType == SVX_NUM_CHAR_SPECIAL && pActualBullets[nIndex]->eType == eNBType::BULLETS )

--- 46 unchanged lines hidden (view full) ---

1152 pEntry->pGrfObj = new Graphic(*pGrf);
1153 pEntry->aSize = aFmt.GetGraphicSize();
1154 pEntry->aSize = OutputDevice::LogicToLogic(pEntry->aSize,(MapUnit)GetMapUnit(),MAP_100TH_MM);
1155 sal_uInt16 nDIndex = mGrfTMgr->GetNBOIndexForNumRule(aNum,mLevel);
1156 if (nDIndex!=(sal_uInt16)0xFFFF) pEntry->aSize=Size(0,0);
1157 }
1158 }
1159 pEntry->sDescription = sEmpty;
1098 sal_uInt16 nActLv = IsSingleLevel(mLevel);
1099
1100 if ( nActLv == (sal_uInt16)0xFFFF )
1101 return sal_False;
1102
1103 SvxNumberFormat aFmt(aNum.GetLevel(nActLv));
1104 sal_Int16 eNumType = aFmt.GetNumberingType();
1105 if( eNumType == SVX_NUM_CHAR_SPECIAL && pActualBullets[nIndex]->eType == eNBType::BULLETS )

--- 46 unchanged lines hidden (view full) ---

1152 pEntry->pGrfObj = new Graphic(*pGrf);
1153 pEntry->aSize = aFmt.GetGraphicSize();
1154 pEntry->aSize = OutputDevice::LogicToLogic(pEntry->aSize,(MapUnit)GetMapUnit(),MAP_100TH_MM);
1155 sal_uInt16 nDIndex = mGrfTMgr->GetNBOIndexForNumRule(aNum,mLevel);
1156 if (nDIndex!=(sal_uInt16)0xFFFF) pEntry->aSize=Size(0,0);
1157 }
1158 }
1159 pEntry->sDescription = sEmpty;
1160 pEntry->bIsCustomized = sal_True;
1160 pEntry->bIsCustomized = sal_True;
1161 }else
1162 {
1163 return sal_False;
1164 }
1165 }else
1166 {
1167 delete pActualBullets[nIndex]->pBullets;
1168 pActualBullets[nIndex]->pBullets = 0;
1169 if ( eNumType == SVX_NUM_CHAR_SPECIAL )
1170 {
1171 sal_Unicode cChar = aFmt.GetBulletChar();
1172 const Font* pFont = aFmt.GetBulletFont();
1173 pActualBullets[nIndex]->eType = eNBType::BULLETS;
1161 }else
1162 {
1163 return sal_False;
1164 }
1165 }else
1166 {
1167 delete pActualBullets[nIndex]->pBullets;
1168 pActualBullets[nIndex]->pBullets = 0;
1169 if ( eNumType == SVX_NUM_CHAR_SPECIAL )
1170 {
1171 sal_Unicode cChar = aFmt.GetBulletChar();
1172 const Font* pFont = aFmt.GetBulletFont();
1173 pActualBullets[nIndex]->eType = eNBType::BULLETS;
1174 pActualBullets[nIndex]->nIndex = nIndex+1; //index in the tab page display,decrease 1 to the index within arr
1174 pActualBullets[nIndex]->nIndex = nIndex+1; // Index in the tab page display,decrease 1 to the index within arr
1175 pActualBullets[nIndex]->pBullets = new BulletsSettings_Impl(eNBType::BULLETS) ;
1176 ((BulletsSettings_Impl*)(pActualBullets[nIndex]->pBullets))->cBulletChar = cChar;
1177 ((BulletsSettings_Impl*)(pActualBullets[nIndex]->pBullets))->aFont = pFont?*pFont:lcl_GetDefaultBulletFont();
1178 ((BulletsSettings_Impl*)(pActualBullets[nIndex]->pBullets))->bIsCustomized = sal_True;
1179 ((BulletsSettings_Impl*)(pActualBullets[nIndex]->pBullets))->eType = eNBType::BULLETS;
1180 BulletsTypeMgr* pBTMgr = BulletsTypeMgr::GetInstance();
1181 if ( pBTMgr )
1182 {

--- 20 unchanged lines hidden (view full) ---

1203 pGrf = pBrsh->GetGraphic();
1204 else
1205 return sal_False;
1206
1207 String sEmpty;
1208 const String* pGrfName = 0;
1209 if ( pGrf )
1210 {
1175 pActualBullets[nIndex]->pBullets = new BulletsSettings_Impl(eNBType::BULLETS) ;
1176 ((BulletsSettings_Impl*)(pActualBullets[nIndex]->pBullets))->cBulletChar = cChar;
1177 ((BulletsSettings_Impl*)(pActualBullets[nIndex]->pBullets))->aFont = pFont?*pFont:lcl_GetDefaultBulletFont();
1178 ((BulletsSettings_Impl*)(pActualBullets[nIndex]->pBullets))->bIsCustomized = sal_True;
1179 ((BulletsSettings_Impl*)(pActualBullets[nIndex]->pBullets))->eType = eNBType::BULLETS;
1180 BulletsTypeMgr* pBTMgr = BulletsTypeMgr::GetInstance();
1181 if ( pBTMgr )
1182 {

--- 20 unchanged lines hidden (view full) ---

1203 pGrf = pBrsh->GetGraphic();
1204 else
1205 return sal_False;
1206
1207 String sEmpty;
1208 const String* pGrfName = 0;
1209 if ( pGrf )
1210 {
1211 pGrfName = pBrsh->GetGraphicLink();
1211 pGrfName = pBrsh->GetGraphicLink();
1212
1213 pActualBullets[nIndex]->eType = eNBType::GRAPHICBULLETS;
1212
1213 pActualBullets[nIndex]->eType = eNBType::GRAPHICBULLETS;
1214 pActualBullets[nIndex]->nIndex = nIndex+1; //index in the tab page display,decrease 1 to the index within arr
1214 pActualBullets[nIndex]->nIndex = nIndex+1; // Index in the tab page display,decrease 1 to the index within arr
1215 pActualBullets[nIndex]->pBullets = new GrfBulDataRelation(eNBType::GRAPHICBULLETS) ;
1216 if (pGrfName)
1215 pActualBullets[nIndex]->pBullets = new GrfBulDataRelation(eNBType::GRAPHICBULLETS) ;
1216 if (pGrfName)
1217 ((GrfBulDataRelation*)(pActualBullets[nIndex]->pBullets))->sGrfName = *pGrfName;
1217 ((GrfBulDataRelation*)(pActualBullets[nIndex]->pBullets))->sGrfName = *pGrfName;
1218 ((GrfBulDataRelation*)(pActualBullets[nIndex]->pBullets))->bIsCustomized = sal_True;
1219 ((GrfBulDataRelation*)(pActualBullets[nIndex]->pBullets))->eType = eNBType::GRAPHICBULLETS;
1220 GraphicBulletsTypeMgr* mGrfTMgr = GraphicBulletsTypeMgr::GetInstance();
1221 if ( mGrfTMgr )
1222 {
1223 //sal_uInt16 nDIndex = mGrfTMgr->GetNBOIndexForNumRule(aNum,mLevel);
1224 //if ( nDIndex != (sal_uInt16)0xFFFF)
1225 //{

--- 12 unchanged lines hidden (view full) ---

1238 ((GrfBulDataRelation*)(pActualBullets[nIndex]->pBullets))->pGrfObj = new Graphic(*pGrf);
1239 Size aTmpSize = aFmt.GetGraphicSize();
1240 aTmpSize = OutputDevice::LogicToLogic(aTmpSize,(MapUnit)GetMapUnit(),MAP_100TH_MM);
1241 sal_uInt16 nDIndex = mGrfTMgr->GetNBOIndexForNumRule(aNum,mLevel);
1242 if (nDIndex!=(sal_uInt16)0xFFFF) aTmpSize=Size(0,0);
1243 ((GrfBulDataRelation*)(pActualBullets[nIndex]->pBullets))->aSize = aTmpSize;
1244
1245 }
1218 ((GrfBulDataRelation*)(pActualBullets[nIndex]->pBullets))->bIsCustomized = sal_True;
1219 ((GrfBulDataRelation*)(pActualBullets[nIndex]->pBullets))->eType = eNBType::GRAPHICBULLETS;
1220 GraphicBulletsTypeMgr* mGrfTMgr = GraphicBulletsTypeMgr::GetInstance();
1221 if ( mGrfTMgr )
1222 {
1223 //sal_uInt16 nDIndex = mGrfTMgr->GetNBOIndexForNumRule(aNum,mLevel);
1224 //if ( nDIndex != (sal_uInt16)0xFFFF)
1225 //{

--- 12 unchanged lines hidden (view full) ---

1238 ((GrfBulDataRelation*)(pActualBullets[nIndex]->pBullets))->pGrfObj = new Graphic(*pGrf);
1239 Size aTmpSize = aFmt.GetGraphicSize();
1240 aTmpSize = OutputDevice::LogicToLogic(aTmpSize,(MapUnit)GetMapUnit(),MAP_100TH_MM);
1241 sal_uInt16 nDIndex = mGrfTMgr->GetNBOIndexForNumRule(aNum,mLevel);
1242 if (nDIndex!=(sal_uInt16)0xFFFF) aTmpSize=Size(0,0);
1243 ((GrfBulDataRelation*)(pActualBullets[nIndex]->pBullets))->aSize = aTmpSize;
1244
1245 }
1246 }
1246 }
1247 }
1248 }
1249 }
1250 SvxNumRule aTmpRule1(aNum);
1251 ApplyNumRule(aTmpRule1,nIndex,mLevel,true);
1252 if (GetNBOIndexForNumRule(aTmpRule1,mLevel,nIndex)==nIndex+1) {
1253 if (pActualBullets[nIndex]->eType == eNBType::BULLETS) {
1254 BulletsSettings_Impl* pEntry = (BulletsSettings_Impl*) (pActualBullets[nIndex]->pBullets);

--- 12 unchanged lines hidden (view full) ---

1267
1268sal_Bool MixBulletsTypeMgr::ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel,sal_Bool isDefault,sal_Bool isResetSize)
1269{
1270 //if ( mLevel == (sal_uInt16)0xFFFF || nIndex>=DEFAULT_BULLET_TYPES )
1271 if ( nIndex>=DEFAULT_BULLET_TYPES )
1272 return sal_False;
1273 MixBulletsSettings_Impl* pCurrentBullets = pActualBullets[nIndex];
1274 if (isDefault) pCurrentBullets=pDefaultActualBullets[nIndex];
1247 }
1248 }
1249 }
1250 SvxNumRule aTmpRule1(aNum);
1251 ApplyNumRule(aTmpRule1,nIndex,mLevel,true);
1252 if (GetNBOIndexForNumRule(aTmpRule1,mLevel,nIndex)==nIndex+1) {
1253 if (pActualBullets[nIndex]->eType == eNBType::BULLETS) {
1254 BulletsSettings_Impl* pEntry = (BulletsSettings_Impl*) (pActualBullets[nIndex]->pBullets);

--- 12 unchanged lines hidden (view full) ---

1267
1268sal_Bool MixBulletsTypeMgr::ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel,sal_Bool isDefault,sal_Bool isResetSize)
1269{
1270 //if ( mLevel == (sal_uInt16)0xFFFF || nIndex>=DEFAULT_BULLET_TYPES )
1271 if ( nIndex>=DEFAULT_BULLET_TYPES )
1272 return sal_False;
1273 MixBulletsSettings_Impl* pCurrentBullets = pActualBullets[nIndex];
1274 if (isDefault) pCurrentBullets=pDefaultActualBullets[nIndex];
1275
1275
1276 if ( pCurrentBullets->eType == eNBType::BULLETS )
1277 {
1278 sal_Unicode cChar;
1279 cChar = ((BulletsSettings_Impl*)(pCurrentBullets->pBullets))->cBulletChar;
1280
1281 //Font& rActBulletFont = lcl_GetDefaultBulletFont();
1282 Font rActBulletFont = ((BulletsSettings_Impl*)(pCurrentBullets->pBullets))->aFont;
1283 sal_uInt16 nMask = 1;

--- 4 unchanged lines hidden (view full) ---

1288 {
1289 SvxNumberFormat aFmt(aNum.GetLevel(i));
1290 if (SVX_NUM_CHAR_SPECIAL !=aFmt.GetNumberingType()) isResetSize=true;
1291 aFmt.SetNumberingType( SVX_NUM_CHAR_SPECIAL );
1292 aFmt.SetBulletFont(&rActBulletFont);
1293 aFmt.SetBulletChar(cChar );
1294 aFmt.SetCharFmtName(sBulletCharFmtName);
1295 String aEmptyStr;
1276 if ( pCurrentBullets->eType == eNBType::BULLETS )
1277 {
1278 sal_Unicode cChar;
1279 cChar = ((BulletsSettings_Impl*)(pCurrentBullets->pBullets))->cBulletChar;
1280
1281 //Font& rActBulletFont = lcl_GetDefaultBulletFont();
1282 Font rActBulletFont = ((BulletsSettings_Impl*)(pCurrentBullets->pBullets))->aFont;
1283 sal_uInt16 nMask = 1;

--- 4 unchanged lines hidden (view full) ---

1288 {
1289 SvxNumberFormat aFmt(aNum.GetLevel(i));
1290 if (SVX_NUM_CHAR_SPECIAL !=aFmt.GetNumberingType()) isResetSize=true;
1291 aFmt.SetNumberingType( SVX_NUM_CHAR_SPECIAL );
1292 aFmt.SetBulletFont(&rActBulletFont);
1293 aFmt.SetBulletChar(cChar );
1294 aFmt.SetCharFmtName(sBulletCharFmtName);
1295 String aEmptyStr;
1296 aFmt.SetPrefix( aEmptyStr );
1296 aFmt.SetPrefix( aEmptyStr );
1297 aFmt.SetSuffix( aEmptyStr );
1298 if (isResetSize) aFmt.SetBulletRelSize(45);
1299 aNum.SetLevel(i, aFmt);
1300 }
1301 nMask <<= 1;
1302 }
1303 }else if ( pCurrentBullets->eType == eNBType::GRAPHICBULLETS )
1304 {

--- 21 unchanged lines hidden (view full) ---

1326 sal_Int16 eOrient = text::VertOrientation::LINE_CENTER;
1327 if (!isResetSize && aFmt.GetGraphicSize()!=Size(0,0)) aSize=aFmt.GetGraphicSize();
1328 else {
1329 if (aSize.Width()==0 && aSize.Height()==0) {
1330 aSize = SvxNumberFormat::GetGraphicSizeMM100( pEntry->pGrfObj );
1331 }
1332 aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)GetMapUnit());
1333 }
1297 aFmt.SetSuffix( aEmptyStr );
1298 if (isResetSize) aFmt.SetBulletRelSize(45);
1299 aNum.SetLevel(i, aFmt);
1300 }
1301 nMask <<= 1;
1302 }
1303 }else if ( pCurrentBullets->eType == eNBType::GRAPHICBULLETS )
1304 {

--- 21 unchanged lines hidden (view full) ---

1326 sal_Int16 eOrient = text::VertOrientation::LINE_CENTER;
1327 if (!isResetSize && aFmt.GetGraphicSize()!=Size(0,0)) aSize=aFmt.GetGraphicSize();
1328 else {
1329 if (aSize.Width()==0 && aSize.Height()==0) {
1330 aSize = SvxNumberFormat::GetGraphicSizeMM100( pEntry->pGrfObj );
1331 }
1332 aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)GetMapUnit());
1333 }
1334 SvxBrushItem aBrush(*(pEntry->pGrfObj), GPOS_AREA, SID_ATTR_BRUSH );
1335 aFmt.SetGraphicBrush( &aBrush, &aSize, &eOrient );
1334 SvxBrushItem aBrush(*(pEntry->pGrfObj), GPOS_AREA, SID_ATTR_BRUSH );
1335 aFmt.SetGraphicBrush( &aBrush, &aSize, &eOrient );
1336 }else
1337 {
1336 }else
1337 {
1338 Graphic aGraphic;
1339 if(GalleryExplorer::GetGraphicObj( GALLERY_THEME_BULLETS, pCurrentBullets->nIndexDefault, &aGraphic))
1338 Graphic aGraphic;
1339 if(GalleryExplorer::GetGraphicObj( GALLERY_THEME_BULLETS, pCurrentBullets->nIndexDefault, &aGraphic))
1340 {
1341 Size aSize = pEntry->aSize;
1342 sal_Int16 eOrient = text::VertOrientation::LINE_CENTER;
1343 if (!isResetSize && aFmt.GetGraphicSize()!=Size(0,0)) aSize=aFmt.GetGraphicSize();
1344 else {
1345 if (aSize.Width()==0 && aSize.Height()==0) {
1340 {
1341 Size aSize = pEntry->aSize;
1342 sal_Int16 eOrient = text::VertOrientation::LINE_CENTER;
1343 if (!isResetSize && aFmt.GetGraphicSize()!=Size(0,0)) aSize=aFmt.GetGraphicSize();
1344 else {
1345 if (aSize.Width()==0 && aSize.Height()==0) {
1346 aSize = SvxNumberFormat::GetGraphicSizeMM100(&aGraphic);
1346 aSize = SvxNumberFormat::GetGraphicSizeMM100(&aGraphic);
1347 }
1348 aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)GetMapUnit());
1349 }
1347 }
1348 aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)GetMapUnit());
1349 }
1350 SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH );
1351 aFmt.SetGraphicBrush( &aBrush, &aSize, &eOrient );
1350 SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH );
1351 aFmt.SetGraphicBrush( &aBrush, &aSize, &eOrient );
1352 }else
1353 aFmt.SetGraphic( sGrfName );
1352 }else
1353 aFmt.SetGraphic( sGrfName );
1354 }
1354 }
1355
1356 aNum.SetLevel(i, aFmt);
1357 }
1358 nMask <<= 1 ;
1359 }
1360 }
1355
1356 aNum.SetLevel(i, aFmt);
1357 }
1358 nMask <<= 1 ;
1359 }
1360 }
1361
1361
1362 return sal_True;
1363}
1364
1365String MixBulletsTypeMgr::GetDescription(sal_uInt16 nIndex,sal_Bool isDefault)
1366{
1367 String sRet;
1368 //sal_uInt16 nLength = 0;
1369 //nLength = sizeof(pActualBullets)/sizeof(BulletsSettings_Impl);

--- 58 unchanged lines hidden (view full) ---

1428 for(sal_uInt16 i=0;i<aTypeMgr.GetNumCount();i++)
1429 {
1430 NumberSettings_Impl* _pSet = aTypeMgr.GetNumSettingByIndex(i);
1431 if ( _pSet )
1432 {
1433 pNumberSettingsArr->GetObject(i)->nIndex = _pSet->nIndex;
1434 pNumberSettingsArr->GetObject(i)->nIndexDefault = _pSet->nIndexDefault;
1435 pNumberSettingsArr->GetObject(i)->sDescription = _pSet->sDescription;
1362 return sal_True;
1363}
1364
1365String MixBulletsTypeMgr::GetDescription(sal_uInt16 nIndex,sal_Bool isDefault)
1366{
1367 String sRet;
1368 //sal_uInt16 nLength = 0;
1369 //nLength = sizeof(pActualBullets)/sizeof(BulletsSettings_Impl);

--- 58 unchanged lines hidden (view full) ---

1428 for(sal_uInt16 i=0;i<aTypeMgr.GetNumCount();i++)
1429 {
1430 NumberSettings_Impl* _pSet = aTypeMgr.GetNumSettingByIndex(i);
1431 if ( _pSet )
1432 {
1433 pNumberSettingsArr->GetObject(i)->nIndex = _pSet->nIndex;
1434 pNumberSettingsArr->GetObject(i)->nIndexDefault = _pSet->nIndexDefault;
1435 pNumberSettingsArr->GetObject(i)->sDescription = _pSet->sDescription;
1436 pNumberSettingsArr->GetObject(i)->bIsCustomized = _pSet->bIsCustomized;
1436 pNumberSettingsArr->GetObject(i)->bIsCustomized = _pSet->bIsCustomized;
1437 if ( _pSet->pNumSetting )
1438 {
1439 pNumberSettingsArr->GetObject(i)->pNumSetting->nNumberType = _pSet->pNumSetting->nNumberType;
1440 pNumberSettingsArr->GetObject(i)->pNumSetting->nParentNumbering = _pSet->pNumSetting->nParentNumbering;
1441 pNumberSettingsArr->GetObject(i)->pNumSetting->sPrefix = _pSet->pNumSetting->sPrefix;
1442 pNumberSettingsArr->GetObject(i)->pNumSetting->sSuffix = _pSet->pNumSetting->sSuffix;
1443 pNumberSettingsArr->GetObject(i)->pNumSetting->sBulletChar = _pSet->pNumSetting->sBulletChar;
1444 pNumberSettingsArr->GetObject(i)->pNumSetting->sBulletFont = _pSet->pNumSetting->sBulletFont;
1445
1446 pNumberSettingsArr->GetObject(i)->pNumSetting->eLabelFollowedBy = _pSet->pNumSetting->eLabelFollowedBy;
1447 pNumberSettingsArr->GetObject(i)->pNumSetting->nTabValue = _pSet->pNumSetting->nTabValue;
1448 pNumberSettingsArr->GetObject(i)->pNumSetting->eNumAlign = _pSet->pNumSetting->eNumAlign;
1449 pNumberSettingsArr->GetObject(i)->pNumSetting->nNumAlignAt = _pSet->pNumSetting->nNumAlignAt;
1450 pNumberSettingsArr->GetObject(i)->pNumSetting->nNumIndentAt = _pSet->pNumSetting->nNumIndentAt;
1437 if ( _pSet->pNumSetting )
1438 {
1439 pNumberSettingsArr->GetObject(i)->pNumSetting->nNumberType = _pSet->pNumSetting->nNumberType;
1440 pNumberSettingsArr->GetObject(i)->pNumSetting->nParentNumbering = _pSet->pNumSetting->nParentNumbering;
1441 pNumberSettingsArr->GetObject(i)->pNumSetting->sPrefix = _pSet->pNumSetting->sPrefix;
1442 pNumberSettingsArr->GetObject(i)->pNumSetting->sSuffix = _pSet->pNumSetting->sSuffix;
1443 pNumberSettingsArr->GetObject(i)->pNumSetting->sBulletChar = _pSet->pNumSetting->sBulletChar;
1444 pNumberSettingsArr->GetObject(i)->pNumSetting->sBulletFont = _pSet->pNumSetting->sBulletFont;
1445
1446 pNumberSettingsArr->GetObject(i)->pNumSetting->eLabelFollowedBy = _pSet->pNumSetting->eLabelFollowedBy;
1447 pNumberSettingsArr->GetObject(i)->pNumSetting->nTabValue = _pSet->pNumSetting->nTabValue;
1448 pNumberSettingsArr->GetObject(i)->pNumSetting->eNumAlign = _pSet->pNumSetting->eNumAlign;
1449 pNumberSettingsArr->GetObject(i)->pNumSetting->nNumAlignAt = _pSet->pNumSetting->nNumAlignAt;
1450 pNumberSettingsArr->GetObject(i)->pNumSetting->nNumIndentAt = _pSet->pNumSetting->nNumIndentAt;
1451 }
1451 }
1452 }
1453 }
1454 */
1455 ImplLoad(String::CreateFromAscii("standard.syb"));
1456}
1457
1458void NumberingTypeMgr::Init()
1459{
1460 Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
1461 Reference < XInterface > xI = xMSF->createInstance(
1462 ::rtl::OUString::createFromAscii( "com.sun.star.text.DefaultNumberingProvider" ) );
1463 Reference<XDefaultNumberingProvider> xDefNum(xI, UNO_QUERY);
1452 }
1453 }
1454 */
1455 ImplLoad(String::CreateFromAscii("standard.syb"));
1456}
1457
1458void NumberingTypeMgr::Init()
1459{
1460 Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
1461 Reference < XInterface > xI = xMSF->createInstance(
1462 ::rtl::OUString::createFromAscii( "com.sun.star.text.DefaultNumberingProvider" ) );
1463 Reference<XDefaultNumberingProvider> xDefNum(xI, UNO_QUERY);
1464
1464
1465 if(xDefNum.is())
1466 {
1467 Sequence< Sequence< PropertyValue > > aNumberings;
1468 LanguageType eLang = Application::GetSettings().GetLanguage();
1469 Locale aLocale = SvxCreateLocale(eLang);
1470 try
1471 {
1472 aNumberings = xDefNum->getDefaultContinuousNumberingLevels( aLocale );
1473
1465 if(xDefNum.is())
1466 {
1467 Sequence< Sequence< PropertyValue > > aNumberings;
1468 LanguageType eLang = Application::GetSettings().GetLanguage();
1469 Locale aLocale = SvxCreateLocale(eLang);
1470 try
1471 {
1472 aNumberings = xDefNum->getDefaultContinuousNumberingLevels( aLocale );
1473
1474 sal_Int32 nLength = aNumberings.getLength() > DEFAULT_NUM_VALUSET_COUNT ? DEFAULT_NUM_VALUSET_COUNT :aNumberings.getLength();
1474 sal_Int32 nLength = aNumberings.getLength() > DEFAULT_NUM_VALUSET_COUNT ? DEFAULT_NUM_VALUSET_COUNT :aNumberings.getLength();
1475
1476 const Sequence<PropertyValue>* pValuesArr = aNumberings.getConstArray();
1477 for(sal_Int32 i = 0; i < nLength; i++)
1478 {
1479 NumSettings_ImplPtr pNew = lcl_CreateNumberingSettingsPtr(pValuesArr[i]);
1480 NumberSettings_Impl* pNumEntry = new NumberSettings_Impl;
1481 pNumEntry->nIndex = i + 1;
1482 pNumEntry->nIndexDefault = i;
1483 pNumEntry->pNumSetting = pNew;
1475
1476 const Sequence<PropertyValue>* pValuesArr = aNumberings.getConstArray();
1477 for(sal_Int32 i = 0; i < nLength; i++)
1478 {
1479 NumSettings_ImplPtr pNew = lcl_CreateNumberingSettingsPtr(pValuesArr[i]);
1480 NumberSettings_Impl* pNumEntry = new NumberSettings_Impl;
1481 pNumEntry->nIndex = i + 1;
1482 pNumEntry->nIndexDefault = i;
1483 pNumEntry->pNumSetting = pNew;
1484 //SetItemText( i + 1, SVX_RESSTR( RID_SVXSTR_SINGLENUM_DESCRIPTIONS + i ));
1485 {
1486 String sText;
1487 //const OUString sValue(C2U("Value"));
1488 Reference<XNumberingFormatter> xFormatter(xDefNum, UNO_QUERY);
1489 if(xFormatter.is() && aNumberings.getLength() > i)
1490 {
1491
1492 for (sal_uInt16 j=0;j<3;j++)
1493 {
1494 Sequence<PropertyValue> aLevel = aNumberings.getConstArray()[i];
1495 try
1496 {
1497 aLevel.realloc(aLevel.getLength() + 1);
1498 PropertyValue& rValue = aLevel.getArray()[aLevel.getLength() - 1];
1499 rValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value"));
1500 rValue.Value <<= (sal_Int32)(j + 1);
1501
1502 if (j!=0)
1503 sText += String::CreateFromAscii(" ");
1504
1505 sText+=String(xFormatter->makeNumberingString( aLevel, aLocale ));
1506 }
1507 catch(Exception&)
1508 {
1509 DBG_ERROR("Exception in DefaultNumberingProvider::makeNumberingString");
1510 }
1511 }
1512 }
1513 String aStrFromRES(SVX_RESSTR( RID_SVXSTR_SINGLENUM_DESCRIPTIONS));
1514 String aReplace = String::CreateFromAscii("%NUMBERINGSAMPLE");
1515 aStrFromRES.SearchAndReplace(aReplace,sText);
1516 pNumEntry->sDescription = aStrFromRES;
1517 }
1484 //SetItemText( i + 1, SVX_RESSTR( RID_SVXSTR_SINGLENUM_DESCRIPTIONS + i ));
1485// {
1486// String sText;
1487// //const OUString sValue(C2U("Value"));
1488// Reference<XNumberingFormatter> xFormatter(xDefNum, UNO_QUERY);
1489// if(xFormatter.is() && aNumberings.getLength() > i)
1490// {
1491
1492// for (sal_uInt16 j=0;j<3;j++)
1493// {
1494// Sequence<PropertyValue> aLevel = aNumberings.getConstArray()[i];
1495// try
1496// {
1497// aLevel.realloc(aLevel.getLength() + 1);
1498// PropertyValue& rValue = aLevel.getArray()[aLevel.getLength() - 1];
1499// rValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value"));
1500// rValue.Value <<= (sal_Int32)(j + 1);
1501//
1502// if (j!=0)
1503// sText += String::CreateFromAscii(" ");
1504//
1505// sText+=String(xFormatter->makeNumberingString( aLevel, aLocale ));
1506// }
1507// catch(Exception&)
1508// {
1509// DBG_ERROR("Exception in DefaultNumberingProvider::makeNumberingString");
1510// }
1511// }
1512// }
1513// String aStrFromRES(SVX_RESSTR( RID_SVXSTR_SINGLENUM_DESCRIPTIONS));
1514// String aReplace = String::CreateFromAscii("%NUMBERINGSAMPLE");
1515// aStrFromRES.SearchAndReplace(aReplace,sText);
1516// pNumEntry->sDescription = aStrFromRES;
1517// }
1518 // End modification
1519
1518 // End modification
1519
1520 //pNumEntry->sDescription = SVX_RESSTR( RID_SVXSTR_SINGLENUM_DESCRIPTION_0 + i );
1520 pNumEntry->sDescription = SVX_RESSTR( RID_SVXSTR_SINGLENUM_DESCRIPTION_0 + i );
1521 pNumberSettingsArr->Insert(pNumEntry, pNumberSettingsArr->Count());
1522 }
1523 }
1524 catch(Exception&)
1525 {
1526 }
1527 }
1528}

--- 21 unchanged lines hidden (view full) ---

1550 sal_Int16 eNType = _pSet->pNumSetting->nNumberType;
1551 String sLocalPreFix = _pSet->pNumSetting->sPrefix.getStr();
1552 String sLocalSuffix = _pSet->pNumSetting->sSuffix.getStr();
1553 if (sPreFix.CompareTo(sLocalPreFix)==COMPARE_EQUAL &&
1554 sSuffix.CompareTo(sLocalSuffix)==COMPARE_EQUAL &&
1555 eNumType == eNType )
1556 {
1557 return i+1;
1521 pNumberSettingsArr->Insert(pNumEntry, pNumberSettingsArr->Count());
1522 }
1523 }
1524 catch(Exception&)
1525 {
1526 }
1527 }
1528}

--- 21 unchanged lines hidden (view full) ---

1550 sal_Int16 eNType = _pSet->pNumSetting->nNumberType;
1551 String sLocalPreFix = _pSet->pNumSetting->sPrefix.getStr();
1552 String sLocalSuffix = _pSet->pNumSetting->sSuffix.getStr();
1553 if (sPreFix.CompareTo(sLocalPreFix)==COMPARE_EQUAL &&
1554 sSuffix.CompareTo(sLocalSuffix)==COMPARE_EQUAL &&
1555 eNumType == eNType )
1556 {
1557 return i+1;
1558 }
1558 }
1559 }
1560
1561
1562 return (sal_uInt16)0xFFFF;
1563}
1564
1565sal_Bool NumberingTypeMgr::RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel)
1566{
1559 }
1560
1561
1562 return (sal_uInt16)0xFFFF;
1563}
1564
1565sal_Bool NumberingTypeMgr::RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel)
1566{
1567 //if ( mLevel == (sal_uInt16)0xFFFF || mLevel == 0)
1567 //if ( mLevel == (sal_uInt16)0xFFFF || mLevel == 0)
1568 // return sal_False;
1569
1570 //if ( GetNBOIndexForNumRule(aNum,mLevel) != (sal_uInt16)0xFFFF )
1571 // return sal_False;
1572
1573 sal_uInt16 nActLv = IsSingleLevel(mLevel);
1574
1575 if ( nActLv == (sal_uInt16)0xFFFF )

--- 25 unchanged lines hidden (view full) ---

1601 String aReplace = String::CreateFromAscii("%LIST_NUM");
1602 String sNUM = String::CreateFromInt32( nIndex + 1 );
1603 aStrFromRES.SearchAndReplace(aReplace,sNUM);
1604 _pSet->sDescription = aStrFromRES;
1605 } else {
1606 _pSet->sDescription = GetDescription(nIndex,true);
1607 }
1608 ImplStore(String::CreateFromAscii("standard.syb"));
1568 // return sal_False;
1569
1570 //if ( GetNBOIndexForNumRule(aNum,mLevel) != (sal_uInt16)0xFFFF )
1571 // return sal_False;
1572
1573 sal_uInt16 nActLv = IsSingleLevel(mLevel);
1574
1575 if ( nActLv == (sal_uInt16)0xFFFF )

--- 25 unchanged lines hidden (view full) ---

1601 String aReplace = String::CreateFromAscii("%LIST_NUM");
1602 String sNUM = String::CreateFromInt32( nIndex + 1 );
1603 aStrFromRES.SearchAndReplace(aReplace,sNUM);
1604 _pSet->sDescription = aStrFromRES;
1605 } else {
1606 _pSet->sDescription = GetDescription(nIndex,true);
1607 }
1608 ImplStore(String::CreateFromAscii("standard.syb"));
1609 return sal_True;
1609 return sal_True;
1610}
1611
1612sal_Bool NumberingTypeMgr::ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel,sal_Bool isDefault,sal_Bool isResetSize)
1613{
1614 //if ( mLevel == (sal_uInt16)0xFFFF )
1615 // return sal_False;
1610}
1611
1612sal_Bool NumberingTypeMgr::ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel,sal_Bool isDefault,sal_Bool isResetSize)
1613{
1614 //if ( mLevel == (sal_uInt16)0xFFFF )
1615 // return sal_False;
1616
1616
1617 //DBG_ASSERT(pNumSettingsArr->Count() > nIndex, "wrong index");
1618 if(pNumberSettingsArr->Count() <= nIndex)
1619 return sal_False;
1620 NumberSettingsArr_Impl* pCurrentNumberSettingsArr=pNumberSettingsArr;
1621 if (isDefault) pCurrentNumberSettingsArr=pDefaultNumberSettingsArr;
1622 NumberSettings_ImplPtr _pSet = pCurrentNumberSettingsArr->GetObject(nIndex);
1623 sal_Int16 eNewType = _pSet->pNumSetting->nNumberType;
1624

--- 115 unchanged lines hidden (view full) ---

1740 Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
1741 Reference < XInterface > xI = xMSF->createInstance(
1742 ::rtl::OUString::createFromAscii( "com.sun.star.text.DefaultNumberingProvider" ) );
1743 Reference<XDefaultNumberingProvider> xDefNum(xI, UNO_QUERY);
1744
1745 if(xDefNum.is())
1746 {
1747 Sequence<Reference<XIndexAccess> > aOutlineAccess;
1617 //DBG_ASSERT(pNumSettingsArr->Count() > nIndex, "wrong index");
1618 if(pNumberSettingsArr->Count() <= nIndex)
1619 return sal_False;
1620 NumberSettingsArr_Impl* pCurrentNumberSettingsArr=pNumberSettingsArr;
1621 if (isDefault) pCurrentNumberSettingsArr=pDefaultNumberSettingsArr;
1622 NumberSettings_ImplPtr _pSet = pCurrentNumberSettingsArr->GetObject(nIndex);
1623 sal_Int16 eNewType = _pSet->pNumSetting->nNumberType;
1624

--- 115 unchanged lines hidden (view full) ---

1740 Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
1741 Reference < XInterface > xI = xMSF->createInstance(
1742 ::rtl::OUString::createFromAscii( "com.sun.star.text.DefaultNumberingProvider" ) );
1743 Reference<XDefaultNumberingProvider> xDefNum(xI, UNO_QUERY);
1744
1745 if(xDefNum.is())
1746 {
1747 Sequence<Reference<XIndexAccess> > aOutlineAccess;
1748 LanguageType eLang = Application::GetSettings().GetLanguage();
1748 LanguageType eLang = Application::GetSettings().GetLanguage();
1749 Locale aLocale = SvxCreateLocale(eLang);
1750 try
1751 {
1752 aOutlineAccess = xDefNum->getDefaultOutlineNumberings( aLocale );
1753
1754 SvxNumRule aDefNumRule( NUM_BULLET_REL_SIZE|NUM_CONTINUOUS|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE|NUM_SYMBOL_ALIGNMENT,10, sal_False ,
1755 SVX_RULETYPE_NUMBERING,SvxNumberFormat::LABEL_ALIGNMENT);
1756

--- 12 unchanged lines hidden (view full) ---

1769 Sequence<PropertyValue> aLevelProps;
1770 aValueAny >>= aLevelProps;
1771 NumSettings_ImplPtr pNew = lcl_CreateNumberingSettingsPtr(aLevelProps);
1772 SvxNumberFormat aNumFmt( aDefNumRule.GetLevel( nLevel) );
1773 pNew->eLabelFollowedBy = aNumFmt.GetLabelFollowedBy();
1774 pNew->nTabValue = aNumFmt.GetListtabPos();
1775 pNew->eNumAlign = aNumFmt.GetNumAdjust();
1776 pNew->nNumAlignAt = aNumFmt.GetFirstLineIndent();
1749 Locale aLocale = SvxCreateLocale(eLang);
1750 try
1751 {
1752 aOutlineAccess = xDefNum->getDefaultOutlineNumberings( aLocale );
1753
1754 SvxNumRule aDefNumRule( NUM_BULLET_REL_SIZE|NUM_CONTINUOUS|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE|NUM_SYMBOL_ALIGNMENT,10, sal_False ,
1755 SVX_RULETYPE_NUMBERING,SvxNumberFormat::LABEL_ALIGNMENT);
1756

--- 12 unchanged lines hidden (view full) ---

1769 Sequence<PropertyValue> aLevelProps;
1770 aValueAny >>= aLevelProps;
1771 NumSettings_ImplPtr pNew = lcl_CreateNumberingSettingsPtr(aLevelProps);
1772 SvxNumberFormat aNumFmt( aDefNumRule.GetLevel( nLevel) );
1773 pNew->eLabelFollowedBy = aNumFmt.GetLabelFollowedBy();
1774 pNew->nTabValue = aNumFmt.GetListtabPos();
1775 pNew->eNumAlign = aNumFmt.GetNumAdjust();
1776 pNew->nNumAlignAt = aNumFmt.GetFirstLineIndent();
1777 pNew->nNumIndentAt = aNumFmt.GetIndentAt();
1777 pNew->nNumIndentAt = aNumFmt.GetIndentAt();
1778 pItemArr->pNumSettingsArr->Insert( pNew, pItemArr->pNumSettingsArr->Count() );
1779 }
1780 }
1781 }
1782 catch(Exception&)
1783 {
1784 }
1785 }

--- 7 unchanged lines hidden (view full) ---

1793 sal_Bool bNotMatch = sal_False;
1794 OutlineSettings_Impl* pItemArr = pOutlineSettingsArrs[iDex];
1795 sal_uInt16 nCount = pItemArr->pNumSettingsArr->Count();
1796 for (sal_uInt16 iLevel=0;iLevel < nCount;iLevel++)
1797 {
1798 NumSettings_ImplPtr _pSet = pItemArr->pNumSettingsArr->GetObject(iLevel);
1799 sal_Int16 eNType = _pSet->nNumberType;
1800
1778 pItemArr->pNumSettingsArr->Insert( pNew, pItemArr->pNumSettingsArr->Count() );
1779 }
1780 }
1781 }
1782 catch(Exception&)
1783 {
1784 }
1785 }

--- 7 unchanged lines hidden (view full) ---

1793 sal_Bool bNotMatch = sal_False;
1794 OutlineSettings_Impl* pItemArr = pOutlineSettingsArrs[iDex];
1795 sal_uInt16 nCount = pItemArr->pNumSettingsArr->Count();
1796 for (sal_uInt16 iLevel=0;iLevel < nCount;iLevel++)
1797 {
1798 NumSettings_ImplPtr _pSet = pItemArr->pNumSettingsArr->GetObject(iLevel);
1799 sal_Int16 eNType = _pSet->nNumberType;
1800
1801 SvxNumberFormat aFmt(aNum.GetLevel(iLevel));
1801 SvxNumberFormat aFmt(aNum.GetLevel(iLevel));
1802 String sPreFix = aFmt.GetPrefix();
1803 String sSuffix = aFmt.GetSuffix();
1804 String sEmpty;
1802 String sPreFix = aFmt.GetPrefix();
1803 String sSuffix = aFmt.GetSuffix();
1804 String sEmpty;
1805 sal_Int16 eNumType = aFmt.GetNumberingType();
1806 if( eNumType == SVX_NUM_CHAR_SPECIAL)
1805 sal_Int16 eNumType = aFmt.GetNumberingType();
1806 if( eNumType == SVX_NUM_CHAR_SPECIAL)
1807 {
1808 sal_Unicode cChar = aFmt.GetBulletChar();
1809 sal_Unicode ccChar = _pSet->sBulletChar.getStr()[0];
1810 rtl::OUString sFont = _pSet->sBulletFont;
1811 if ( !((cChar == ccChar) && //pFont && sFont.compareTo(pFont->GetName()) &&
1812 _pSet->eLabelFollowedBy == aFmt.GetLabelFollowedBy() &&
1813 _pSet->nTabValue == aFmt.GetListtabPos() &&
1814 _pSet->eNumAlign == aFmt.GetNumAdjust() &&
1815 _pSet->nNumAlignAt == aFmt.GetFirstLineIndent() &&
1816 _pSet->nNumIndentAt == aFmt.GetIndentAt()))
1817 {
1818 bNotMatch = sal_True;
1819 break;
1820 }
1821 }else if ((eNumType&(~LINK_TOKEN)) == SVX_NUM_BITMAP ) {
1807 {
1808 sal_Unicode cChar = aFmt.GetBulletChar();
1809 sal_Unicode ccChar = _pSet->sBulletChar.getStr()[0];
1810 rtl::OUString sFont = _pSet->sBulletFont;
1811 if ( !((cChar == ccChar) && //pFont && sFont.compareTo(pFont->GetName()) &&
1812 _pSet->eLabelFollowedBy == aFmt.GetLabelFollowedBy() &&
1813 _pSet->nTabValue == aFmt.GetListtabPos() &&
1814 _pSet->eNumAlign == aFmt.GetNumAdjust() &&
1815 _pSet->nNumAlignAt == aFmt.GetFirstLineIndent() &&
1816 _pSet->nNumIndentAt == aFmt.GetIndentAt()))
1817 {
1818 bNotMatch = sal_True;
1819 break;
1820 }
1821 }else if ((eNumType&(~LINK_TOKEN)) == SVX_NUM_BITMAP ) {
1822 const SvxBrushItem* pBrsh1 = aFmt.GetBrush();
1822 const SvxBrushItem* pBrsh1 = aFmt.GetBrush();
1823 const SvxBrushItem* pBrsh2 = _pSet->pBrushItem;
1824 sal_Bool bIsMatch = false;
1825 if (pBrsh1==pBrsh2) bIsMatch = true;
1826 if (pBrsh1 && pBrsh2) {
1827 const Graphic* pGrf1 = pBrsh1->GetGraphic();;
1828 const Graphic* pGrf2 = pBrsh2->GetGraphic();;
1829 if (pGrf1==pGrf2) bIsMatch = true;
1830 if (pGrf1 && pGrf2) {
1831 if ( pGrf1->GetBitmap().IsEqual(pGrf2->GetBitmap()) &&
1832 _pSet->aSize==aFmt.GetGraphicSize())
1833 bIsMatch = true;
1834 }
1835 }
1836 if (!bIsMatch) {
1837 bNotMatch = sal_True;
1838 break;
1839 }
1840 } else
1823 const SvxBrushItem* pBrsh2 = _pSet->pBrushItem;
1824 sal_Bool bIsMatch = false;
1825 if (pBrsh1==pBrsh2) bIsMatch = true;
1826 if (pBrsh1 && pBrsh2) {
1827 const Graphic* pGrf1 = pBrsh1->GetGraphic();;
1828 const Graphic* pGrf2 = pBrsh2->GetGraphic();;
1829 if (pGrf1==pGrf2) bIsMatch = true;
1830 if (pGrf1 && pGrf2) {
1831 if ( pGrf1->GetBitmap().IsEqual(pGrf2->GetBitmap()) &&
1832 _pSet->aSize==aFmt.GetGraphicSize())
1833 bIsMatch = true;
1834 }
1835 }
1836 if (!bIsMatch) {
1837 bNotMatch = sal_True;
1838 break;
1839 }
1840 } else
1841 {
1842 if (!((sPreFix.CompareTo(_pSet->sPrefix.getStr())==COMPARE_EQUAL) &&
1841 {
1842 if (!((sPreFix.CompareTo(_pSet->sPrefix.getStr())==COMPARE_EQUAL) &&
1843 ( sSuffix.CompareTo(_pSet->sSuffix.getStr())==COMPARE_EQUAL ) &&
1844 eNumType == eNType &&
1845 _pSet->eLabelFollowedBy == aFmt.GetLabelFollowedBy() &&
1846 _pSet->nTabValue == aFmt.GetListtabPos() &&
1847 _pSet->eNumAlign == aFmt.GetNumAdjust() &&
1848 _pSet->nNumAlignAt == aFmt.GetFirstLineIndent() &&
1843 ( sSuffix.CompareTo(_pSet->sSuffix.getStr())==COMPARE_EQUAL ) &&
1844 eNumType == eNType &&
1845 _pSet->eLabelFollowedBy == aFmt.GetLabelFollowedBy() &&
1846 _pSet->nTabValue == aFmt.GetListtabPos() &&
1847 _pSet->eNumAlign == aFmt.GetNumAdjust() &&
1848 _pSet->nNumAlignAt == aFmt.GetFirstLineIndent() &&
1849 _pSet->nNumIndentAt == aFmt.GetIndentAt()))
1849 _pSet->nNumIndentAt == aFmt.GetIndentAt()))
1850 {
1851 bNotMatch = sal_True;
1852 break;
1853 }
1850 {
1851 bNotMatch = sal_True;
1852 break;
1853 }
1854 }
1854 }
1855 }
1856 if ( !bNotMatch )
1857 return iDex+1;
1858 }
1859
1855 }
1856 if ( !bNotMatch )
1857 return iDex+1;
1858 }
1859
1860
1860
1861 return (sal_uInt16)0xFFFF;
1862}
1863
1864sal_Bool OutlineTypeMgr::RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel)
1865{
1866 //if ( mLevel == 0 || mLevel == (sal_uInt16)0xFFFF )
1867 // return sal_False;
1868
1869 sal_uInt16 nLength = sizeof(pOutlineSettingsArrs)/sizeof(OutlineSettings_Impl*);
1870 if ( nIndex >= nLength )
1871 return sal_False;
1872
1873 OutlineSettings_Impl* pItemArr = pOutlineSettingsArrs[nIndex];
1874 sal_uInt16 nCount = pItemArr->pNumSettingsArr->Count();
1875 for (sal_uInt16 iLevel=0;iLevel < nCount;iLevel++)
1861 return (sal_uInt16)0xFFFF;
1862}
1863
1864sal_Bool OutlineTypeMgr::RelplaceNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel)
1865{
1866 //if ( mLevel == 0 || mLevel == (sal_uInt16)0xFFFF )
1867 // return sal_False;
1868
1869 sal_uInt16 nLength = sizeof(pOutlineSettingsArrs)/sizeof(OutlineSettings_Impl*);
1870 if ( nIndex >= nLength )
1871 return sal_False;
1872
1873 OutlineSettings_Impl* pItemArr = pOutlineSettingsArrs[nIndex];
1874 sal_uInt16 nCount = pItemArr->pNumSettingsArr->Count();
1875 for (sal_uInt16 iLevel=0;iLevel < nCount;iLevel++)
1876 {
1876 {
1877 SvxNumberFormat aFmt(aNum.GetLevel(iLevel));
1878 sal_Int16 eNumType = aFmt.GetNumberingType();
1879
1880 NumSettings_ImplPtr _pSet = pItemArr->pNumSettingsArr->GetObject(iLevel);
1881
1882 _pSet->eLabelFollowedBy = aFmt.GetLabelFollowedBy();
1883 _pSet->nTabValue = aFmt.GetListtabPos();
1884 _pSet->eNumAlign = aFmt.GetNumAdjust();
1885 _pSet->nNumAlignAt = aFmt.GetFirstLineIndent();
1886 _pSet->nNumIndentAt = aFmt.GetIndentAt();
1877 SvxNumberFormat aFmt(aNum.GetLevel(iLevel));
1878 sal_Int16 eNumType = aFmt.GetNumberingType();
1879
1880 NumSettings_ImplPtr _pSet = pItemArr->pNumSettingsArr->GetObject(iLevel);
1881
1882 _pSet->eLabelFollowedBy = aFmt.GetLabelFollowedBy();
1883 _pSet->nTabValue = aFmt.GetListtabPos();
1884 _pSet->eNumAlign = aFmt.GetNumAdjust();
1885 _pSet->nNumAlignAt = aFmt.GetFirstLineIndent();
1886 _pSet->nNumIndentAt = aFmt.GetIndentAt();
1887
1887
1888 if( eNumType == SVX_NUM_CHAR_SPECIAL)
1889 {
1890 sal_Unicode cChar = aFmt.GetBulletChar();
1891 OUString sChar(cChar);
1892 _pSet->sBulletChar = sChar;//OUString(cChar);
1893 if ( aFmt.GetBulletFont() )
1894 _pSet->sBulletFont = rtl::OUString(aFmt.GetBulletFont()->GetName());
1895 _pSet->nNumberType = eNumType;
1896 pItemArr->bIsCustomized = sal_True;
1897 }else if ((eNumType&(~LINK_TOKEN)) == SVX_NUM_BITMAP ) {
1898 if (_pSet->pBrushItem) {
1899 delete (_pSet->pBrushItem);
1900 _pSet->pBrushItem=NULL;
1901 }
1902 if (aFmt.GetBrush())
1903 _pSet->pBrushItem = new SvxBrushItem(*aFmt.GetBrush());
1904 _pSet->aSize = aFmt.GetGraphicSize();
1905 _pSet->nNumberType = eNumType;
1906 } else
1888 if( eNumType == SVX_NUM_CHAR_SPECIAL)
1889 {
1890 sal_Unicode cChar = aFmt.GetBulletChar();
1891 OUString sChar(cChar);
1892 _pSet->sBulletChar = sChar;//OUString(cChar);
1893 if ( aFmt.GetBulletFont() )
1894 _pSet->sBulletFont = rtl::OUString(aFmt.GetBulletFont()->GetName());
1895 _pSet->nNumberType = eNumType;
1896 pItemArr->bIsCustomized = sal_True;
1897 }else if ((eNumType&(~LINK_TOKEN)) == SVX_NUM_BITMAP ) {
1898 if (_pSet->pBrushItem) {
1899 delete (_pSet->pBrushItem);
1900 _pSet->pBrushItem=NULL;
1901 }
1902 if (aFmt.GetBrush())
1903 _pSet->pBrushItem = new SvxBrushItem(*aFmt.GetBrush());
1904 _pSet->aSize = aFmt.GetGraphicSize();
1905 _pSet->nNumberType = eNumType;
1906 } else
1907 {
1907 {
1908 _pSet->sPrefix = aFmt.GetPrefix();
1909 _pSet->sSuffix = aFmt.GetSuffix();
1910 _pSet->nNumberType = eNumType;
1911 if ( aFmt.GetBulletFont() )
1912 _pSet->sBulletFont = rtl::OUString(aFmt.GetBulletFont()->GetName());
1913 pItemArr->bIsCustomized = sal_True;
1908 _pSet->sPrefix = aFmt.GetPrefix();
1909 _pSet->sSuffix = aFmt.GetSuffix();
1910 _pSet->nNumberType = eNumType;
1911 if ( aFmt.GetBulletFont() )
1912 _pSet->sBulletFont = rtl::OUString(aFmt.GetBulletFont()->GetName());
1913 pItemArr->bIsCustomized = sal_True;
1914 }
1914 }
1915 }
1916 SvxNumRule aTmpRule1(aNum);
1917 SvxNumRule aTmpRule2(aNum);
1918 ApplyNumRule(aTmpRule1,nIndex,mLevel,true);
1919 ApplyNumRule(aTmpRule2,nIndex,mLevel,false);
1920 if (aTmpRule1==aTmpRule2) pItemArr->bIsCustomized=false;
1921 if (pItemArr->bIsCustomized) {
1922 String aStrFromRES = String(SVX_RESSTR( RID_SVXSTR_NUMBULLET_CUSTOM_MULTILEVEL_DESCRIPTION));
1923 String aReplace = String::CreateFromAscii("%LIST_NUM");
1924 String sNUM = String::CreateFromInt32( nIndex + 1 );
1925 aStrFromRES.SearchAndReplace(aReplace,sNUM);
1926 pItemArr->sDescription = aStrFromRES;
1927 } else {
1928 pItemArr->sDescription = GetDescription(nIndex,true);
1929 }
1930 ImplStore(String::CreateFromAscii("standard.syc"));
1915 }
1916 SvxNumRule aTmpRule1(aNum);
1917 SvxNumRule aTmpRule2(aNum);
1918 ApplyNumRule(aTmpRule1,nIndex,mLevel,true);
1919 ApplyNumRule(aTmpRule2,nIndex,mLevel,false);
1920 if (aTmpRule1==aTmpRule2) pItemArr->bIsCustomized=false;
1921 if (pItemArr->bIsCustomized) {
1922 String aStrFromRES = String(SVX_RESSTR( RID_SVXSTR_NUMBULLET_CUSTOM_MULTILEVEL_DESCRIPTION));
1923 String aReplace = String::CreateFromAscii("%LIST_NUM");
1924 String sNUM = String::CreateFromInt32( nIndex + 1 );
1925 aStrFromRES.SearchAndReplace(aReplace,sNUM);
1926 pItemArr->sDescription = aStrFromRES;
1927 } else {
1928 pItemArr->sDescription = GetDescription(nIndex,true);
1929 }
1930 ImplStore(String::CreateFromAscii("standard.syc"));
1931 return sal_True;
1931 return sal_True;
1932}
1933
1934sal_Bool OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 /* mLevel */,sal_Bool isDefault,sal_Bool isResetSize)
1935{
1936 //if ( mLevel == (sal_uInt16)0xFFFF )
1937 // return sal_False;
1938
1939 DBG_ASSERT(DEFAULT_NUM_VALUSET_COUNT > nIndex, "wrong index");
1940 if(DEFAULT_NUM_VALUSET_COUNT <= nIndex)
1941 return sal_False;
1942
1943 const FontList* pList = 0;
1944
1932}
1933
1934sal_Bool OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 /* mLevel */,sal_Bool isDefault,sal_Bool isResetSize)
1935{
1936 //if ( mLevel == (sal_uInt16)0xFFFF )
1937 // return sal_False;
1938
1939 DBG_ASSERT(DEFAULT_NUM_VALUSET_COUNT > nIndex, "wrong index");
1940 if(DEFAULT_NUM_VALUSET_COUNT <= nIndex)
1941 return sal_False;
1942
1943 const FontList* pList = 0;
1944
1945 OutlineSettings_Impl* pItemArr = pOutlineSettingsArrs[nIndex];
1945 OutlineSettings_Impl* pItemArr = pOutlineSettingsArrs[nIndex];
1946 if (isDefault) pItemArr=pDefaultOutlineSettingsArrs[nIndex];
1947
1948 //Font& rActBulletFont = lcl_GetDefaultBulletFont();
1946 if (isDefault) pItemArr=pDefaultOutlineSettingsArrs[nIndex];
1947
1948 //Font& rActBulletFont = lcl_GetDefaultBulletFont();
1949 NumSettingsArr_Impl *pNumSettingsArr=pItemArr->pNumSettingsArr;
1950
1949 NumSettingsArr_Impl *pNumSettingsArr=pItemArr->pNumSettingsArr;
1950
1951 NumSettings_ImplPtr pLevelSettings = 0;
1952 String sBulletCharFmtName = GetBulCharFmtName();
1953 for(sal_uInt16 i = 0; i < aNum.GetLevelCount(); i++)
1954 {
1955 if(pNumSettingsArr->Count() > i)
1956 pLevelSettings = pNumSettingsArr->GetObject(i);
1957
1958 if(!pLevelSettings)

--- 5 unchanged lines hidden (view full) ---

1964 if (pLevelSettings->nNumberType !=aFmt.GetNumberingType()) isResetSize=true;
1965 aFmt.SetNumberingType( pLevelSettings->nNumberType );
1966 sal_uInt16 nUpperLevelOrChar = (sal_uInt16)pLevelSettings->nParentNumbering;
1967 if(aFmt.GetNumberingType() == SVX_NUM_CHAR_SPECIAL)
1968 {
1969 if( pLevelSettings->sBulletFont.getLength() &&
1970 pLevelSettings->sBulletFont.compareTo(rActBulletFont.GetName()))
1971 {
1951 NumSettings_ImplPtr pLevelSettings = 0;
1952 String sBulletCharFmtName = GetBulCharFmtName();
1953 for(sal_uInt16 i = 0; i < aNum.GetLevelCount(); i++)
1954 {
1955 if(pNumSettingsArr->Count() > i)
1956 pLevelSettings = pNumSettingsArr->GetObject(i);
1957
1958 if(!pLevelSettings)

--- 5 unchanged lines hidden (view full) ---

1964 if (pLevelSettings->nNumberType !=aFmt.GetNumberingType()) isResetSize=true;
1965 aFmt.SetNumberingType( pLevelSettings->nNumberType );
1966 sal_uInt16 nUpperLevelOrChar = (sal_uInt16)pLevelSettings->nParentNumbering;
1967 if(aFmt.GetNumberingType() == SVX_NUM_CHAR_SPECIAL)
1968 {
1969 if( pLevelSettings->sBulletFont.getLength() &&
1970 pLevelSettings->sBulletFont.compareTo(rActBulletFont.GetName()))
1971 {
1972 //search for the font
1973 if(!pList)
1974 {
1975 SfxObjectShell* pCurDocShell = SfxObjectShell::Current();
1976 const SvxFontListItem* pFontListItem = (const SvxFontListItem* )pCurDocShell->GetItem( SID_ATTR_CHAR_FONTLIST );
1977 pList = pFontListItem ? pFontListItem->GetFontList() : 0;
1978 }
1979 if(pList && pList->IsAvailable( pLevelSettings->sBulletFont ) )
1980 {
1981 FontInfo aInfo = pList->Get(pLevelSettings->sBulletFont,WEIGHT_NORMAL, ITALIC_NONE);
1982 Font aFont(aInfo);
1983 aFmt.SetBulletFont(&aFont);
1984 }
1985 else
1986 {
1987 //if it cannot be found then create a new one
1988 Font aCreateFont( pLevelSettings->sBulletFont,String(), Size( 0, 14 ) );
1989 aCreateFont.SetCharSet( RTL_TEXTENCODING_DONTKNOW );
1990 aCreateFont.SetFamily( FAMILY_DONTKNOW );
1991 aCreateFont.SetPitch( PITCH_DONTKNOW );
1992 aCreateFont.SetWeight( WEIGHT_DONTKNOW );
1993 aCreateFont.SetTransparent( sal_True );
1994 aFmt.SetBulletFont( &aCreateFont );
1995 }
1972 //search for the font
1973 if(!pList)
1974 {
1975 SfxObjectShell* pCurDocShell = SfxObjectShell::Current();
1976 const SvxFontListItem* pFontListItem = (const SvxFontListItem* )pCurDocShell->GetItem( SID_ATTR_CHAR_FONTLIST );
1977 pList = pFontListItem ? pFontListItem->GetFontList() : 0;
1978 }
1979 if(pList && pList->IsAvailable( pLevelSettings->sBulletFont ) )
1980 {
1981 FontInfo aInfo = pList->Get(pLevelSettings->sBulletFont,WEIGHT_NORMAL, ITALIC_NONE);
1982 Font aFont(aInfo);
1983 aFmt.SetBulletFont(&aFont);
1984 }
1985 else
1986 {
1987 // If it cannot be found then create a new one
1988 Font aCreateFont( pLevelSettings->sBulletFont,String(), Size( 0, 14 ) );
1989 aCreateFont.SetCharSet( RTL_TEXTENCODING_DONTKNOW );
1990 aCreateFont.SetFamily( FAMILY_DONTKNOW );
1991 aCreateFont.SetPitch( PITCH_DONTKNOW );
1992 aCreateFont.SetWeight( WEIGHT_DONTKNOW );
1993 aCreateFont.SetTransparent( sal_True );
1994 aFmt.SetBulletFont( &aCreateFont );
1995 }
1996 }else
1997 aFmt.SetBulletFont( &rActBulletFont );
1996 }else
1997 aFmt.SetBulletFont( &rActBulletFont );
1998
1998
1999 sal_Unicode cChar = 0;
2000 if( pLevelSettings->sBulletChar.getLength() )
2001 cChar = pLevelSettings->sBulletChar.getStr()[0];
2002 if( Application::GetSettings().GetLayoutRTL() )
1999 sal_Unicode cChar = 0;
2000 if( pLevelSettings->sBulletChar.getLength() )
2001 cChar = pLevelSettings->sBulletChar.getStr()[0];
2002 if( Application::GetSettings().GetLayoutRTL() )
2003 {
2004 if( 0 == i && cChar == BulletsTypeMgr::aDynamicBulletTypes[5] )
2003 {
2004 if( 0 == i && cChar == BulletsTypeMgr::aDynamicBulletTypes[5] )
2005 cChar = BulletsTypeMgr::aDynamicRTLBulletTypes[5];
2006 else if( 1 == i )
2007 {
2008 const SvxNumberFormat& numberFmt = aNum.GetLevel(0);
2009 if( numberFmt.GetBulletChar() == BulletsTypeMgr::aDynamicRTLBulletTypes[5] )
2010 cChar = BulletsTypeMgr::aDynamicRTLBulletTypes[4];
2011 }
2012 }

--- 14 unchanged lines hidden (view full) ---

2027 }
2028 aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)GetMapUnit());
2029 aFmt.SetGraphicBrush( pLevelSettings->pBrushItem, &aSize, &eOrient );
2030 }
2031 } else
2032 {
2033 aFmt.SetIncludeUpperLevels(sal::static_int_cast< sal_uInt8 >(0 != nUpperLevelOrChar ? aNum.GetLevelCount() : 0));
2034 aFmt.SetCharFmtName(sBulletCharFmtName);
2005 cChar = BulletsTypeMgr::aDynamicRTLBulletTypes[5];
2006 else if( 1 == i )
2007 {
2008 const SvxNumberFormat& numberFmt = aNum.GetLevel(0);
2009 if( numberFmt.GetBulletChar() == BulletsTypeMgr::aDynamicRTLBulletTypes[5] )
2010 cChar = BulletsTypeMgr::aDynamicRTLBulletTypes[4];
2011 }
2012 }

--- 14 unchanged lines hidden (view full) ---

2027 }
2028 aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)GetMapUnit());
2029 aFmt.SetGraphicBrush( pLevelSettings->pBrushItem, &aSize, &eOrient );
2030 }
2031 } else
2032 {
2033 aFmt.SetIncludeUpperLevels(sal::static_int_cast< sal_uInt8 >(0 != nUpperLevelOrChar ? aNum.GetLevelCount() : 0));
2034 aFmt.SetCharFmtName(sBulletCharFmtName);
2035 if (isResetSize) aFmt.SetBulletRelSize(100);
2035 if (isResetSize) aFmt.SetBulletRelSize(100);
2036 }
2037 if(pNumSettingsArr->Count() > i) {
2038 aFmt.SetLabelFollowedBy(pLevelSettings->eLabelFollowedBy);
2039 aFmt.SetListtabPos(pLevelSettings->nTabValue);
2040 aFmt.SetNumAdjust(pLevelSettings->eNumAlign);
2041 aFmt.SetFirstLineIndent(pLevelSettings->nNumAlignAt);
2042 aFmt.SetIndentAt(pLevelSettings->nNumIndentAt);
2043 }

--- 35 unchanged lines hidden (view full) ---

2079 else
2080 {
2081 OutlineSettings_Impl* pItemArr = pOutlineSettingsArrs[nIndex];
2082 if ( pItemArr )
2083 {
2084 bRet = pItemArr->bIsCustomized;
2085 };
2086 }
2036 }
2037 if(pNumSettingsArr->Count() > i) {
2038 aFmt.SetLabelFollowedBy(pLevelSettings->eLabelFollowedBy);
2039 aFmt.SetListtabPos(pLevelSettings->nTabValue);
2040 aFmt.SetNumAdjust(pLevelSettings->eNumAlign);
2041 aFmt.SetFirstLineIndent(pLevelSettings->nNumAlignAt);
2042 aFmt.SetIndentAt(pLevelSettings->nNumIndentAt);
2043 }

--- 35 unchanged lines hidden (view full) ---

2079 else
2080 {
2081 OutlineSettings_Impl* pItemArr = pOutlineSettingsArrs[nIndex];
2082 if ( pItemArr )
2083 {
2084 bRet = pItemArr->bIsCustomized;
2085 };
2086 }
2087
2087
2088 return bRet;
2089}
2090
2091
2092}}
2093
2094/* vim: set noet sw=4 ts=4: */
2088 return bRet;
2089}
2090
2091
2092}}
2093
2094/* vim: set noet sw=4 ts=4: */