textsh1.cxx (eb39ad03) | textsh1.cxx (1ff378ef) |
---|---|
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 --- 112 unchanged lines hidden (view full) --- 121#include <unotools/syslocaleoptions.hxx> 122#include <doc.hxx> 123#include <view.hxx> 124#include <ndtxt.hxx> 125#include <pam.hxx> 126#include <sfx2/objface.hxx> 127#include <langhelper.hxx> 128 | 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 --- 112 unchanged lines hidden (view full) --- 121#include <unotools/syslocaleoptions.hxx> 122#include <doc.hxx> 123#include <view.hxx> 124#include <ndtxt.hxx> 125#include <pam.hxx> 126#include <sfx2/objface.hxx> 127#include <langhelper.hxx> 128 |
129#ifndef _NBDTMGFACT_HXX 130#include <svx/nbdtmgfact.hxx> 131#endif 132#ifndef _NBDTMG_HXX 133#include <svx/nbdtmg.hxx> 134#endif 135 136 137#include <numrule.hxx> 138 139 |
|
129using namespace ::com::sun::star; | 140using namespace ::com::sun::star; |
141using namespace svx::sidebar; |
|
130 131 132void lcl_CharDialog( SwWrtShell &rWrtSh, sal_Bool bUseDialog, sal_uInt16 nSlot,const SfxItemSet *pArgs, SfxRequest *pReq ) 133{ 134 FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &rWrtSh.GetView())); 135 SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); 136 SfxItemSet aCoreSet( rWrtSh.GetView().GetPool(), 137 RES_CHRATR_BEGIN, RES_CHRATR_END-1, --- 885 unchanged lines hidden (view full) --- 1023 } 1024 } 1025 1026 if( SFX_ITEM_SET == pSet->GetItemState(FN_NUMBER_NEWSTART) ) 1027 { 1028 //SetNumRuleStart(sal_True) restarts the numbering at the value 1029 //that is defined at the starting point of the numbering level 1030 //otherwise the SetNodeNumStart() value determines the start | 142 143 144void lcl_CharDialog( SwWrtShell &rWrtSh, sal_Bool bUseDialog, sal_uInt16 nSlot,const SfxItemSet *pArgs, SfxRequest *pReq ) 145{ 146 FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &rWrtSh.GetView())); 147 SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); 148 SfxItemSet aCoreSet( rWrtSh.GetView().GetPool(), 149 RES_CHRATR_BEGIN, RES_CHRATR_END-1, --- 885 unchanged lines hidden (view full) --- 1035 } 1036 } 1037 1038 if( SFX_ITEM_SET == pSet->GetItemState(FN_NUMBER_NEWSTART) ) 1039 { 1040 //SetNumRuleStart(sal_True) restarts the numbering at the value 1041 //that is defined at the starting point of the numbering level 1042 //otherwise the SetNodeNumStart() value determines the start |
1031 //if it's set to something different than USHRT_MAX | 1043 //if it's set to something different than (sal_uInt16)0xFFFF |
1032 1033 sal_Bool bStart = ((SfxBoolItem&)pSet->Get(FN_NUMBER_NEWSTART)).GetValue(); 1034 // --> OD 2007-06-11 #b6560525# | 1044 1045 sal_Bool bStart = ((SfxBoolItem&)pSet->Get(FN_NUMBER_NEWSTART)).GetValue(); 1046 // --> OD 2007-06-11 #b6560525# |
1035 // Default value for restart value has to be USHRT_MAX | 1047 // Default value for restart value has to be (sal_uInt16)0xFFFF |
1036 // in order to indicate that the restart value of the list 1037 // style has to be used on restart. | 1048 // in order to indicate that the restart value of the list 1049 // style has to be used on restart. |
1038 sal_uInt16 nNumStart = USHRT_MAX; | 1050 sal_uInt16 nNumStart = (sal_uInt16)0xFFFF; |
1039 // <-- 1040 if( SFX_ITEM_SET == pSet->GetItemState(FN_NUMBER_NEWSTART_AT) ) 1041 { 1042 nNumStart = ((SfxUInt16Item&)pSet->Get(FN_NUMBER_NEWSTART_AT)).GetValue(); 1043 } 1044 rWrtSh.SetNumRuleStart(bStart); 1045 rWrtSh.SetNodeNumStart(nNumStart); 1046 } --- 630 unchanged lines hidden (view full) --- 1677 aRangeText ); 1678 1679 rSet.Put( aItem ); 1680 } 1681 else 1682 rSet.DisableItem(nWhich); 1683 } 1684 break; | 1051 // <-- 1052 if( SFX_ITEM_SET == pSet->GetItemState(FN_NUMBER_NEWSTART_AT) ) 1053 { 1054 nNumStart = ((SfxUInt16Item&)pSet->Get(FN_NUMBER_NEWSTART_AT)).GetValue(); 1055 } 1056 rWrtSh.SetNumRuleStart(bStart); 1057 rWrtSh.SetNodeNumStart(nNumStart); 1058 } --- 630 unchanged lines hidden (view full) --- 1689 aRangeText ); 1690 1691 rSet.Put( aItem ); 1692 } 1693 else 1694 rSet.DisableItem(nWhich); 1695 } 1696 break; |
1697 case FN_NUM_NUMBERING_ON: 1698 rSet.Put(SfxBoolItem(FN_NUM_NUMBERING_ON,rSh.SelectionHasNumber())); 1699 break; 1700 case FN_NUM_BULLET_ON: 1701 rSet.Put(SfxBoolItem(FN_NUM_BULLET_ON,rSh.SelectionHasBullet())); 1702 break; 1703 case FN_BUL_NUM_RULE_INDEX: 1704 case FN_NUM_NUM_RULE_INDEX: 1705 { 1706 SwNumRule* pCurRule = (SwNumRule*)(GetShell().GetCurNumRule()); 1707 sal_uInt16 nActNumLvl = (sal_uInt16)0xFFFF; 1708 rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,DEFAULT_NONE)); 1709 rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,DEFAULT_NONE)); 1710 if( pCurRule ) 1711 { 1712 nActNumLvl = GetShell().GetNumLevel(); 1713 if( nActNumLvl < MAXLEVEL ) 1714 { 1715 nActNumLvl = 1<<nActNumLvl; 1716 } 1717 SvxNumRule aSvxRule = pCurRule->MakeSvxNumRule(); 1718 if ( GetShell().HasBullet()) 1719 { 1720 rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,(sal_uInt16)0xFFFF)); 1721 rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,(sal_uInt16)0xFFFF)); 1722 NBOTypeMgrBase* pBullets = NBOutlineTypeMgrFact::CreateInstance(eNBOType::MIXBULLETS); 1723 if ( pBullets ) 1724 { 1725 sal_uInt16 nBulIndex = pBullets->GetNBOIndexForNumRule(aSvxRule,nActNumLvl); 1726 rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,nBulIndex)); 1727 } 1728 }else if ( GetShell().HasNumber() ) 1729 { 1730 rSet.Put(SfxUInt16Item(FN_BUL_NUM_RULE_INDEX,(sal_uInt16)0xFFFF)); 1731 rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,(sal_uInt16)0xFFFF)); 1732 NBOTypeMgrBase* pNumbering = NBOutlineTypeMgrFact::CreateInstance(eNBOType::NUMBERING); 1733 if ( pNumbering ) 1734 { 1735 sal_uInt16 nBulIndex = pNumbering->GetNBOIndexForNumRule(aSvxRule,nActNumLvl); 1736 rSet.Put(SfxUInt16Item(FN_NUM_NUM_RULE_INDEX,nBulIndex)); 1737 } 1738 } 1739 } 1740 } 1741 break; |
|
1685 case FN_NUM_CONTINUE: 1686 { 1687 // --> OD 2009-08-26 #i86492# 1688 // Allow continuation of previous list, even if at current cursor 1689 // a list is active. 1690// if ( rSh.GetCurNumRule() ) 1691// rSet.DisableItem(nWhich); 1692// else --- 82 unchanged lines hidden (view full) --- 1775 } 1776 } 1777 if( bChgd ) 1778 { 1779 rSh.ChgPageDesc( nFrom, aDesc ); 1780 1781 if( !bCrsrSet && bOn ) 1782 bCrsrSet = rSh.SetCrsrInHdFt( | 1742 case FN_NUM_CONTINUE: 1743 { 1744 // --> OD 2009-08-26 #i86492# 1745 // Allow continuation of previous list, even if at current cursor 1746 // a list is active. 1747// if ( rSh.GetCurNumRule() ) 1748// rSet.DisableItem(nWhich); 1749// else --- 82 unchanged lines hidden (view full) --- 1832 } 1833 } 1834 if( bChgd ) 1835 { 1836 rSh.ChgPageDesc( nFrom, aDesc ); 1837 1838 if( !bCrsrSet && bOn ) 1839 bCrsrSet = rSh.SetCrsrInHdFt( |
1783 !rStyleName.Len() ? USHRT_MAX : nFrom, | 1840 !rStyleName.Len() ? (sal_uInt16)0xFFFF : nFrom, |
1784 bHeader ); 1785 } 1786 } 1787 } 1788 rSh.EndUndo( UNDO_HEADER_FOOTER ); // #i7983# 1789 rSh.EndAllAction(); 1790} 1791 | 1841 bHeader ); 1842 } 1843 } 1844 } 1845 rSh.EndUndo( UNDO_HEADER_FOOTER ); // #i7983# 1846 rSh.EndAllAction(); 1847} 1848 |