drviews2.cxx (d5370dc8) | drviews2.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 --- 49 unchanged lines hidden (view full) --- 58#include <svx/xlnwtit.hxx> 59#include <svx/svdoattr.hxx> 60#include <svx/xlnstwit.hxx> 61#include <svx/sdtmfitm.hxx> 62#include <svx/sdtagitm.hxx> 63#include <svx/xlnedwit.hxx> 64#include <svx/fontworkbar.hxx> 65 | 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 --- 49 unchanged lines hidden (view full) --- 58#include <svx/xlnwtit.hxx> 59#include <svx/svdoattr.hxx> 60#include <svx/xlnstwit.hxx> 61#include <svx/sdtmfitm.hxx> 62#include <svx/sdtagitm.hxx> 63#include <svx/xlnedwit.hxx> 64#include <svx/fontworkbar.hxx> 65 |
66#include <editeng/escpitem.hxx> 67#include <editeng/kernitem.hxx> 68#include <editeng/wghtitem.hxx> 69#include <editeng/postitem.hxx> 70#include <editeng/udlnitem.hxx> 71#include <editeng/crsditem.hxx> 72#include <editeng/cntritem.hxx> 73#include <editeng/shdditem.hxx> 74#include <svx/xtable.hxx> 75#include <svx/svdobj.hxx> 76#include <editeng/outlobj.hxx> 77#include <editeng/flstitem.hxx> 78#include <editeng/scripttypeitem.hxx> 79#include <editeng/fontitem.hxx> 80#include <editeng/fhgtitem.hxx> 81#include <editeng/colritem.hxx> 82#include <editeng/brshitem.hxx> 83 84#include <svl/whiter.hxx> 85 |
|
66#include <svx/svxdlg.hxx> 67#include <svx/dialogs.hrc> 68 69#include <sfx2/viewfrm.hxx> 70#include "sdgrffilter.hxx" 71 72#include "app.hrc" 73#include "glob.hrc" --- 918 unchanged lines hidden (view full) --- 992 } 993 994 if(HasCurrentFunction()) 995 { 996 GetCurrentFunction()->Activate(); 997 } 998} 999 | 86#include <svx/svxdlg.hxx> 87#include <svx/dialogs.hrc> 88 89#include <sfx2/viewfrm.hxx> 90#include "sdgrffilter.hxx" 91 92#include "app.hrc" 93#include "glob.hrc" --- 918 unchanged lines hidden (view full) --- 1012 } 1013 1014 if(HasCurrentFunction()) 1015 { 1016 GetCurrentFunction()->Activate(); 1017 } 1018} 1019 |
1020void DrawViewShell::ExecChar( SfxRequest &rReq ) 1021{ 1022 SdDrawDocument* pDoc = GetDoc(); 1023 if (!pDoc || !mpDrawView) 1024 return; |
|
1000 | 1025 |
1026 SfxItemSet aEditAttr( pDoc->GetPool() ); 1027 mpDrawView->GetAttributes( aEditAttr ); |
|
1001 | 1028 |
1029 //modified by wj for sym2_1580, if put old itemset into new set, 1030 //when mpDrawView->SetAttributes(aNewAttr) it will invalidate all the item 1031 // and use old attr to update all the attributes 1032// SfxItemSet aNewAttr( GetPool(), 1033// EE_ITEMS_START, EE_ITEMS_END ); 1034// aNewAttr.Put( aEditAttr, sal_False ); 1035 SfxItemSet aNewAttr( pDoc->GetPool() ); 1036 //modified end |
|
1002 | 1037 |
1038 sal_uInt16 nSId = rReq.GetSlot(); 1039 1040 MapSlot( nSId ); 1041 1042 switch ( nSId ) 1043 { 1044 case SID_ATTR_CHAR_FONT: 1045 if( rReq.GetArgs() ) 1046 { 1047 SFX_REQUEST_ARG( rReq, pItem, SvxFontItem, SID_ATTR_CHAR_FONT , sal_False ); 1048 if (pItem) 1049 { 1050 aNewAttr.Put(*pItem); 1051 } 1052 } 1053 break; 1054 case SID_ATTR_CHAR_FONTHEIGHT: 1055 if( rReq.GetArgs() ) 1056 { 1057 SFX_REQUEST_ARG( rReq, pItem, SvxFontHeightItem, SID_ATTR_CHAR_FONTHEIGHT , sal_False ); 1058 if (pItem) 1059 { 1060 aNewAttr.Put(*pItem); 1061 } 1062 } 1063 break; 1064 case SID_ATTR_CHAR_WEIGHT: 1065 if( rReq.GetArgs() ) 1066 { 1067 //const SvxWeightItem *pItem = (const SvxWeightItem*) rReq.GetArg( SID_ATTR_CHAR_WEIGHT, sal_False, TYPE(SvxWeightItem) ); 1068 SFX_REQUEST_ARG( rReq, pItem, SvxWeightItem, SID_ATTR_CHAR_WEIGHT , sal_False ); 1069 if (pItem) 1070 { 1071 aNewAttr.Put(*pItem); 1072 } 1073 } 1074 break; 1075 case SID_ATTR_CHAR_POSTURE: 1076 if( rReq.GetArgs() ) 1077 { 1078 //const SvxPostureItem *pItem = (const SvxPostureItem*) rReq.GetArg( SID_ATTR_CHAR_POSTURE, sal_False, TYPE(SvxPostureItem) ); 1079 SFX_REQUEST_ARG( rReq, pItem, SvxPostureItem, SID_ATTR_CHAR_POSTURE , sal_False ); 1080 if (pItem) 1081 { 1082 aNewAttr.Put(*pItem); 1083 } 1084 } 1085 break; 1086 case SID_ATTR_CHAR_UNDERLINE: 1087 if( rReq.GetArgs() ) 1088 { 1089 //<<modify by wj for sym2_1873 1090 //SFX_REQUEST_ARG( rReq, pItem, SvxTextLineItem, SID_ATTR_CHAR_UNDERLINE , sal_False ); 1091 SFX_REQUEST_ARG( rReq, pItem, SvxUnderlineItem, SID_ATTR_CHAR_UNDERLINE , sal_False ); 1092 //end>> 1093 if (pItem) 1094 { 1095 aNewAttr.Put(*pItem); 1096 } 1097 else 1098 { 1099 FontUnderline eFU = ( (const SvxUnderlineItem&) aEditAttr.Get( EE_CHAR_UNDERLINE ) ).GetLineStyle(); 1100 aNewAttr.Put( SvxUnderlineItem( eFU != UNDERLINE_NONE ?UNDERLINE_NONE : UNDERLINE_SINGLE, EE_CHAR_UNDERLINE ) ); 1101 }//aNewAttr.Put( (const SvxUnderlineItem&)aEditAttr.Get( EE_CHAR_UNDERLINE ) ); 1102 } 1103 break; 1104 case SID_ATTR_CHAR_SHADOWED: 1105 if( rReq.GetArgs() ) 1106 { 1107 SFX_REQUEST_ARG( rReq, pItem, SvxShadowedItem, SID_ATTR_CHAR_SHADOWED , sal_False ); 1108 if (pItem) 1109 { 1110 aNewAttr.Put(*pItem); 1111 } 1112 } 1113 break; 1114 case SID_ATTR_CHAR_STRIKEOUT: 1115 if( rReq.GetArgs() ) 1116 { 1117 SFX_REQUEST_ARG( rReq, pItem, SvxCrossedOutItem, SID_ATTR_CHAR_STRIKEOUT , sal_False ); 1118 if (pItem) 1119 { 1120 aNewAttr.Put(*pItem); 1121 } 1122 } 1123 break; 1124 case SID_ATTR_CHAR_COLOR: 1125 if( rReq.GetArgs() ) 1126 { 1127 SFX_REQUEST_ARG( rReq, pItem, SvxColorItem, SID_ATTR_CHAR_COLOR , sal_False ); 1128 if (pItem) 1129 { 1130 aNewAttr.Put(*pItem); 1131 } 1132 } 1133 break; 1134 case SID_ATTR_CHAR_KERNING: 1135 if( rReq.GetArgs() ) 1136 { 1137 SFX_REQUEST_ARG( rReq, pItem, SvxKerningItem, SID_ATTR_CHAR_KERNING , sal_False ); 1138 if (pItem) 1139 { 1140 aNewAttr.Put(*pItem); 1141 } 1142 } 1143 break; 1144 case SID_SET_SUB_SCRIPT: 1145 if( rReq.GetArgs() ) 1146 { 1147 SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT ); 1148 SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&) 1149 aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue(); 1150 if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT ) 1151 aItem.SetEscapement( SVX_ESCAPEMENT_OFF ); 1152 else 1153 aItem.SetEscapement( SVX_ESCAPEMENT_SUBSCRIPT ); 1154 aNewAttr.Put( aItem ); 1155 } 1156 break; 1157 case SID_SET_SUPER_SCRIPT: 1158 if( rReq.GetArgs() ) 1159 { 1160 SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT ); 1161 SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&) 1162 aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue(); 1163 if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT ) 1164 aItem.SetEscapement( SVX_ESCAPEMENT_OFF ); 1165 else 1166 aItem.SetEscapement( SVX_ESCAPEMENT_SUPERSCRIPT ); 1167 aNewAttr.Put( aItem ); 1168 } 1169 break; 1170 default: 1171 ; 1172 } 1173 1174 mpDrawView->SetAttributes(aNewAttr); 1175 rReq.Done(); 1176 Cancel(); 1177} 1178 1179 |
|
1003/** This method consists basically of three parts: 1004 1. Process the arguments of the SFX request. 1005 2. Use the model to create a new page or duplicate an existing one. 1006 3. Update the tab control and switch to the new page. 1007*/ 1008SdPage* DrawViewShell::CreateOrDuplicatePage ( 1009 SfxRequest& rRequest, 1010 PageKind ePageKind, --- 7 unchanged lines hidden (view full) --- 1018 { 1019 mpDrawView->SdrEndTextEdit(); 1020 } 1021 pNewPage = ViewShell::CreateOrDuplicatePage (rRequest, ePageKind, pPage, nInsertPosition); 1022 } 1023 return pNewPage; 1024} 1025 | 1180/** This method consists basically of three parts: 1181 1. Process the arguments of the SFX request. 1182 2. Use the model to create a new page or duplicate an existing one. 1183 3. Update the tab control and switch to the new page. 1184*/ 1185SdPage* DrawViewShell::CreateOrDuplicatePage ( 1186 SfxRequest& rRequest, 1187 PageKind ePageKind, --- 7 unchanged lines hidden (view full) --- 1195 { 1196 mpDrawView->SdrEndTextEdit(); 1197 } 1198 pNewPage = ViewShell::CreateOrDuplicatePage (rRequest, ePageKind, pPage, nInsertPosition); 1199 } 1200 return pNewPage; 1201} 1202 |
1203void DrawViewShell::ExecutePropPanelAttr (SfxRequest& rReq) 1204{ 1205 if(SlideShow::IsRunning( GetViewShellBase() )) 1206 return; 1207 1208 SdDrawDocument* pDoc = GetDoc(); 1209 if (!pDoc || !mpDrawView) 1210 return; 1211 1212 sal_uInt16 nSId = rReq.GetSlot(); 1213 SfxItemSet aAttrs( pDoc->GetPool() ); 1214 1215 switch ( nSId ) 1216 { 1217 case SID_TABLE_VERT_NONE: 1218 case SID_TABLE_VERT_CENTER: 1219 case SID_TABLE_VERT_BOTTOM: 1220 SdrTextVertAdjust eTVA = SDRTEXTVERTADJUST_TOP; 1221 if (nSId == SID_TABLE_VERT_CENTER) 1222 eTVA = SDRTEXTVERTADJUST_CENTER; 1223 else if (nSId == SID_TABLE_VERT_BOTTOM) 1224 eTVA = SDRTEXTVERTADJUST_BOTTOM; 1225 1226 aAttrs.Put( SdrTextVertAdjustItem(eTVA) ); 1227 mpDrawView->SetAttributes(aAttrs); 1228 1229 break; 1230 } 1231} 1232 1233void DrawViewShell::GetStatePropPanelAttr(SfxItemSet& rSet) 1234{ 1235 SfxWhichIter aIter( rSet ); 1236 sal_uInt16 nWhich = aIter.FirstWhich(); 1237 1238 SdDrawDocument* pDoc = GetDoc(); 1239 if (!pDoc || !mpDrawView) 1240 return; 1241 1242 SfxItemSet aAttrs( pDoc->GetPool() ); 1243 mpDrawView->GetAttributes( aAttrs ); 1244 1245 while ( nWhich ) 1246 { 1247 sal_uInt16 nSlotId = SfxItemPool::IsWhich(nWhich) 1248 ? GetPool().GetSlotId(nWhich) 1249 : nWhich; 1250 switch ( nSlotId ) 1251 { 1252 case SID_TABLE_VERT_NONE: 1253 case SID_TABLE_VERT_CENTER: 1254 case SID_TABLE_VERT_BOTTOM: 1255 sal_Bool bContour = sal_False; 1256 SfxItemState eConState = aAttrs.GetItemState( SDRATTR_TEXT_CONTOURFRAME ); 1257 if( eConState != SFX_ITEM_DONTCARE ) 1258 { 1259 bContour = ( ( const SdrTextContourFrameItem& )aAttrs.Get( SDRATTR_TEXT_CONTOURFRAME ) ).GetValue(); 1260 } 1261 if (bContour) break; 1262 1263 SfxItemState eVState = aAttrs.GetItemState( SDRATTR_TEXT_VERTADJUST ); 1264 //SfxItemState eHState = aAttrs.GetItemState( SDRATTR_TEXT_HORZADJUST ); 1265 1266 //if(SFX_ITEM_DONTCARE != eVState && SFX_ITEM_DONTCARE != eHState) 1267 if(SFX_ITEM_DONTCARE != eVState) 1268 { 1269 SdrTextVertAdjust eTVA = (SdrTextVertAdjust)((const SdrTextVertAdjustItem&)aAttrs.Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); 1270 sal_Bool bSet = nSlotId == SID_TABLE_VERT_NONE && eTVA == SDRTEXTVERTADJUST_TOP|| 1271 nSlotId == SID_TABLE_VERT_CENTER && eTVA == SDRTEXTVERTADJUST_CENTER || 1272 nSlotId == SID_TABLE_VERT_BOTTOM && eTVA == SDRTEXTVERTADJUST_BOTTOM; 1273 rSet.Put(SfxBoolItem(nSlotId, bSet)); 1274 } 1275 else 1276 { 1277 rSet.Put(SfxBoolItem(nSlotId, sal_False)); 1278 } 1279 break; 1280 } 1281 nWhich = aIter.NextWhich(); 1282 } 1283} 1284 |
|
1026} // end of namespace sd | 1285} // end of namespace sd |