backgrnd.cxx (97e8a929) | backgrnd.cxx (28bcfa49) |
---|---|
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 --- 387 unchanged lines hidden (view full) --- 396 0 != ( pItem = pShell->GetItem( SID_HTML_MODE ) ) ) ) 397 { 398 nHtmlMode = ((SfxUInt16Item*)pItem)->GetValue(); 399 } 400 401 FillColorValueSets_Impl(); 402 403 aBackgroundColorSet.SetSelectHdl( HDL(BackgroundColorHdl_Impl) ); | 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 --- 387 unchanged lines hidden (view full) --- 396 0 != ( pItem = pShell->GetItem( SID_HTML_MODE ) ) ) ) 397 { 398 nHtmlMode = ((SfxUInt16Item*)pItem)->GetValue(); 399 } 400 401 FillColorValueSets_Impl(); 402 403 aBackgroundColorSet.SetSelectHdl( HDL(BackgroundColorHdl_Impl) ); |
404 aBackgroundColorSet.SetStyle(aBackgroundColorSet.GetStyle() | WB_ITEMBORDER | WB_NAMEFIELD | WB_NONEFIELD); 405 aBackgroundColorSet.SetText(SVX_RESSTR(RID_SVXSTR_TRANSPARENT)); 406 aBackgroundColorSet.SetAccessibleName(aBackgroundColorBox.GetText()); |
|
404 FreeResource(); 405 406 aBtnBrowse.SetAccessibleRelationMemberOf(&aGbFile); 407 aWndPosition.SetAccessibleRelationMemberOf(&aGbPosition); 408 aWndPosition.SetAccessibleRelationLabeledBy(&aBtnPosition); 409 aBackgroundColorSet.SetAccessibleRelationLabeledBy(&aBackgroundColorBox); 410} 411 --- 778 unchanged lines hidden (view full) --- 1190 1191 F"ullen des Farb-Sets 1192*/ 1193 1194{ 1195 SfxObjectShell* pDocSh = SfxObjectShell::Current(); 1196 const SfxPoolItem* pItem = NULL; 1197 XColorList* pColorTable = NULL; | 407 FreeResource(); 408 409 aBtnBrowse.SetAccessibleRelationMemberOf(&aGbFile); 410 aWndPosition.SetAccessibleRelationMemberOf(&aGbPosition); 411 aWndPosition.SetAccessibleRelationLabeledBy(&aBtnPosition); 412 aBackgroundColorSet.SetAccessibleRelationLabeledBy(&aBackgroundColorBox); 413} 414 --- 778 unchanged lines hidden (view full) --- 1193 1194 F"ullen des Farb-Sets 1195*/ 1196 1197{ 1198 SfxObjectShell* pDocSh = SfxObjectShell::Current(); 1199 const SfxPoolItem* pItem = NULL; 1200 XColorList* pColorTable = NULL; |
1198 const Size aSize15x15 = Size( 15, 15 ); 1199 FASTBOOL bOwn = sal_False; | 1201 bool bOwn(false); 1202 long nColorCount(0); |
1200 1201 if ( pDocSh && ( 0 != ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) ) ) | 1203 1204 if ( pDocSh && ( 0 != ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) ) ) |
1205 { |
|
1202 pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable(); | 1206 pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable(); |
1207 } |
|
1203 1204 if ( !pColorTable ) 1205 { | 1208 1209 if ( !pColorTable ) 1210 { |
1206 bOwn = sal_True; | 1211 bOwn = true; |
1207 pColorTable = new XColorList( SvtPathOptions().GetPalettePath() ); 1208 } 1209 1210 if ( pColorTable ) 1211 { | 1212 pColorTable = new XColorList( SvtPathOptions().GetPalettePath() ); 1213 } 1214 1215 if ( pColorTable ) 1216 { |
1212 short i = 0; 1213 long nCount = pColorTable->Count(); 1214 XColorEntry* pEntry = NULL; 1215 Color aColWhite( COL_WHITE ); 1216 String aStrWhite( EditResId( RID_SVXITEMS_COLOR_WHITE ) ); 1217 WinBits nBits = ( aBackgroundColorSet.GetStyle() | WB_ITEMBORDER | WB_NAMEFIELD | WB_NONEFIELD ); 1218 aBackgroundColorSet.SetText( SVX_RESSTR( RID_SVXSTR_TRANSPARENT ) ); 1219 aBackgroundColorSet.SetStyle( nBits ); 1220 aBackgroundColorSet.SetAccessibleName(aBackgroundColorBox.GetText()); 1221 for ( i = 0; i < nCount; i++ ) 1222 { 1223 pEntry = pColorTable->GetColor(i); 1224 aBackgroundColorSet.InsertItem( i + 1, pEntry->GetColor(), pEntry->GetName() ); 1225 } | 1217 nColorCount = pColorTable->Count(); 1218 aBackgroundColorSet.Clear(); 1219 aBackgroundColorSet.addEntriesForXColorList(*pColorTable); |
1226 | 1220 |
1227 while ( i < 80 ) 1228 { 1229 aBackgroundColorSet.InsertItem( i + 1, aColWhite, aStrWhite ); 1230 i++; 1231 } | 1221 if(bOwn) 1222 { 1223 delete pColorTable; 1224 } 1225 } |
1232 | 1226 |
1233 if ( nCount > 80 ) 1234 { 1235 aBackgroundColorSet.SetStyle( nBits | WB_VSCROLL ); 1236 } 1237 } | 1227 const WinBits nBits(aBackgroundColorSet.GetStyle() | WB_ITEMBORDER | WB_NAMEFIELD | WB_NONEFIELD); 1228 aBackgroundColorSet.SetStyle(nBits); 1229 aBackgroundColorSet.SetColCount(aBackgroundColorSet.getColumnCount()); |
1238 | 1230 |
1239 if ( bOwn ) 1240 delete pColorTable; | 1231 // here we have enough space to the left, so layout with fixed column size 1232 // and fixed height, adapt width. Apply the adapted width by moving the left 1233 // edge of the control to the left, keeping the right edge aligned 1234 // with the original position 1235 const Point aCurrentPosContainer(aBorderWin.GetPosPixel()); 1236 const Size aCurrentSizeContainer(aBorderWin.GetOutputSizePixel()); 1237 const Size aCurrentSizeContent(aBackgroundColorSet.GetOutputSizePixel()); 1238 const Size aNewSizeContent(aBackgroundColorSet.layoutToGivenHeight(aCurrentSizeContent.Height() - 4, nColorCount)); 1239 const Size aNewSizeContainer(aNewSizeContent.Width() + 4, aNewSizeContent.Height() + 4); 1240 const Point aNewPos((aCurrentPosContainer.X() + aCurrentSizeContainer.Width()) - aNewSizeContainer.Width(), aCurrentPosContainer.Y()); |
1241 | 1241 |
1242 aBackgroundColorSet.SetColCount( 10 ); 1243 aBackgroundColorSet.SetLineCount( 10 ); 1244 aBackgroundColorSet.CalcWindowSizePixel( aSize15x15 ); 1245 | 1242 aBorderWin.SetOutputSizePixel(aNewSizeContainer); 1243 aBackgroundColorSet.SetOutputSizePixel(aNewSizeContent); 1244 aBorderWin.SetPosSizePixel(aNewPos, aNewSizeContainer); |
1246} 1247 1248//------------------------------------------------------------------------ 1249 1250 1251 1252//------------------------------------------------------------------------ 1253 --- 731 unchanged lines hidden --- | 1245} 1246 1247//------------------------------------------------------------------------ 1248 1249 1250 1251//------------------------------------------------------------------------ 1252 --- 731 unchanged lines hidden --- |