LibreOffice Module sc (master)  1
vbaborders.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 #include "vbaborders.hxx"
20 
21 #include <sal/macros.h>
22 #include <cppuhelper/implbase.hxx>
23 #include <ooo/vba/excel/XlBordersIndex.hpp>
24 #include <ooo/vba/excel/XlBorderWeight.hpp>
25 #include <ooo/vba/excel/XlLineStyle.hpp>
26 #include <ooo/vba/excel/XlColorIndex.hpp>
27 #include <com/sun/star/beans/XPropertySet.hpp>
28 #include <com/sun/star/table/TableBorder.hpp>
29 #include <com/sun/star/table/XCellRange.hpp>
30 #include <com/sun/star/table/XColumnRowRange.hpp>
31 
32 #include "vbapalette.hxx"
33 
34 using namespace ::com::sun::star;
35 using namespace ::ooo::vba;
36 using namespace ::ooo::vba::excel;
37 
38 typedef ::cppu::WeakImplHelper<container::XIndexAccess > RangeBorders_Base;
40 
41 // #TODO sort these indexes to match the order in which Excel iterates over the
42 // borders, the enumeration will match the order in this list
43 const sal_Int16 supportedIndexTable[] = { XlBordersIndex::xlEdgeLeft, XlBordersIndex::xlEdgeTop, XlBordersIndex::xlEdgeBottom, XlBordersIndex::xlEdgeRight, XlBordersIndex::xlDiagonalDown, XlBordersIndex::xlDiagonalUp, XlBordersIndex::xlInsideVertical, XlBordersIndex::xlInsideHorizontal };
44 
45 constexpr OUStringLiteral sTableBorder = u"TableBorder";
46 
47 // Equiv widths in 1/100 mm
48 const sal_Int32 OOLineThin = 26;
49 const sal_Int32 OOLineMedium = 88;
50 const sal_Int32 OOLineThick = 141;
51 const sal_Int32 OOLineHairline = 2;
52 
53 namespace {
54 
55 class ScVbaBorder : public ScVbaBorder_Base
56 {
57 private:
58  uno::Reference< beans::XPropertySet > m_xProps;
59  sal_Int32 m_LineType;
60  ScVbaPalette m_Palette;
61  void setBorderLine( const table::BorderLine& rBorderLine )
62  {
63  table::TableBorder aTableBorder;
64  m_xProps->getPropertyValue( sTableBorder ) >>= aTableBorder;
65 
66  switch ( m_LineType )
67  {
68  case XlBordersIndex::xlEdgeLeft:
69  aTableBorder.IsLeftLineValid = true;
70  aTableBorder.LeftLine= rBorderLine;
71  break;
72  case XlBordersIndex::xlEdgeTop:
73  aTableBorder.IsTopLineValid = true;
74  aTableBorder.TopLine = rBorderLine;
75  break;
76 
77  case XlBordersIndex::xlEdgeBottom:
78  aTableBorder.IsBottomLineValid = true;
79  aTableBorder.BottomLine = rBorderLine;
80  break;
81  case XlBordersIndex::xlEdgeRight:
82  aTableBorder.IsRightLineValid = true;
83  aTableBorder.RightLine = rBorderLine;
84  break;
85  case XlBordersIndex::xlInsideVertical:
86  aTableBorder.IsVerticalLineValid = true;
87  aTableBorder.VerticalLine = rBorderLine;
88  break;
89  case XlBordersIndex::xlInsideHorizontal:
90  aTableBorder.IsHorizontalLineValid = true;
91  aTableBorder.HorizontalLine = rBorderLine;
92  break;
93  case XlBordersIndex::xlDiagonalDown:
94  case XlBordersIndex::xlDiagonalUp:
95  // #TODO have to ignore at the moment, would be
96  // nice to investigate what we can do here
97  break;
98  default:
99  return;
100  }
101  m_xProps->setPropertyValue( sTableBorder, uno::makeAny(aTableBorder) );
102  }
103 
104  bool getBorderLine( table::BorderLine& rBorderLine )
105  {
106  table::TableBorder aTableBorder;
107  m_xProps->getPropertyValue( sTableBorder ) >>= aTableBorder;
108  switch ( m_LineType )
109  {
110  case XlBordersIndex::xlEdgeLeft:
111  if ( aTableBorder.IsLeftLineValid )
112  rBorderLine = aTableBorder.LeftLine;
113  break;
114  case XlBordersIndex::xlEdgeTop:
115  if ( aTableBorder.IsTopLineValid )
116  rBorderLine = aTableBorder.TopLine;
117  break;
118 
119  case XlBordersIndex::xlEdgeBottom:
120  if ( aTableBorder.IsBottomLineValid )
121  rBorderLine = aTableBorder.BottomLine;
122  break;
123  case XlBordersIndex::xlEdgeRight:
124  if ( aTableBorder.IsRightLineValid )
125  rBorderLine = aTableBorder.RightLine;
126  break;
127  case XlBordersIndex::xlInsideVertical:
128  if ( aTableBorder.IsVerticalLineValid )
129  rBorderLine = aTableBorder.VerticalLine;
130  break;
131  case XlBordersIndex::xlInsideHorizontal:
132  if ( aTableBorder.IsHorizontalLineValid )
133  rBorderLine = aTableBorder.HorizontalLine;
134  break;
135 
136  case XlBordersIndex::xlDiagonalDown:
137  case XlBordersIndex::xlDiagonalUp:
138  // #TODO have to ignore at the moment, would be
139  // nice to investigate what we can do here
140  break;
141  default:
142  return false;
143  }
144  return true;
145  }
146 
147 protected:
148  virtual OUString getServiceImplName() override
149  {
150  return "ScVbaBorder";
151  }
152  virtual css::uno::Sequence<OUString> getServiceNames() override
153  {
154  static uno::Sequence< OUString > const aServiceNames
155  {
156  "ooo.vba.excel.Border"
157  };
158  return aServiceNames;
159  }
160 public:
161  ScVbaBorder( const uno::Reference< beans::XPropertySet > & xProps, const uno::Reference< uno::XComponentContext >& xContext, sal_Int32 lineType, const ScVbaPalette& rPalette) : ScVbaBorder_Base( uno::Reference< XHelperInterface >( xProps, uno::UNO_QUERY ), xContext ), m_xProps( xProps ), m_LineType( lineType ), m_Palette( rPalette ) {}
162 
163  // XBorder
164  uno::Any SAL_CALL getColor() override
165  {
166  table::BorderLine aBorderLine;
167  if ( getBorderLine( aBorderLine ) )
168  return uno::makeAny( OORGBToXLRGB( Color(ColorTransparency, aBorderLine.Color) ) );
169  throw uno::RuntimeException("No Implementation available" );
170  }
171  void SAL_CALL setColor( const uno::Any& _color ) override
172  {
173  sal_Int32 nColor = 0;
174  _color >>= nColor;
175  table::BorderLine aBorderLine;
176  if ( !getBorderLine( aBorderLine ) )
177  throw uno::RuntimeException("No Implementation available" );
178 
179  aBorderLine.Color = XLRGBToOORGB( nColor );
180  setBorderLine( aBorderLine );
181 
182  }
183 
184  uno::Any SAL_CALL getColorIndex() override
185  {
186  sal_Int32 nColor = 0;
187  XLRGBToOORGB( getColor() ) >>= nColor;
188  uno::Reference< container::XIndexAccess > xIndex = m_Palette.getPalette();
189  sal_Int32 nElems = xIndex->getCount();
190  sal_Int32 nIndex = -1;
191  for ( sal_Int32 count=0; count<nElems; ++count )
192  {
193  sal_Int32 nPaletteColor = 0;
194  xIndex->getByIndex( count ) >>= nPaletteColor;
195  if ( nPaletteColor == nColor )
196  {
197  nIndex = count + 1;
198  break;
199  }
200  }
201  return uno::makeAny(nIndex);
202  }
203 
204  void SAL_CALL setColorIndex( const uno::Any& _colorindex ) override
205  {
206  sal_Int32 nColor = 0;
207  _colorindex >>= nColor;
208  if ( !nColor || nColor == XlColorIndex::xlColorIndexAutomatic )
209  nColor = 1;
210  setColor( OORGBToXLRGB( m_Palette.getPalette()->getByIndex( --nColor ) ) );
211  }
212  uno::Any SAL_CALL getWeight() override
213  {
214  table::BorderLine aBorderLine;
215  if ( getBorderLine( aBorderLine ) )
216  {
217  switch ( aBorderLine.OuterLineWidth )
218  {
219  case 0: // Thin = default OO thickness
220  case OOLineThin:
221  return uno::makeAny( XlBorderWeight::xlThin );
222  case OOLineMedium:
223  return uno::makeAny( XlBorderWeight::xlMedium );
224  case OOLineThick:
225  return uno::makeAny( XlBorderWeight::xlThick );
226  case OOLineHairline:
227  return uno::makeAny( XlBorderWeight::xlHairline );
228  default:
229  break;
230  }
231  }
232  throw uno::RuntimeException("Method failed" );
233  }
234  void SAL_CALL setWeight( const uno::Any& _weight ) override
235  {
236  sal_Int32 nWeight = 0;
237  _weight >>= nWeight;
238  table::BorderLine aBorderLine;
239  if ( !getBorderLine( aBorderLine ) )
240  throw uno::RuntimeException("Method failed" );
241 
242  switch ( nWeight )
243  {
244  case XlBorderWeight::xlThin:
245  aBorderLine.OuterLineWidth = OOLineThin;
246  break;
247  case XlBorderWeight::xlMedium:
248  aBorderLine.OuterLineWidth = OOLineMedium;
249  break;
250  case XlBorderWeight::xlThick:
251  aBorderLine.OuterLineWidth = OOLineThick;
252  break;
253  case XlBorderWeight::xlHairline:
254  aBorderLine.OuterLineWidth = OOLineHairline;
255  break;
256  default:
257  throw uno::RuntimeException("Bad param" );
258  }
259  setBorderLine( aBorderLine );
260 
261  }
262 
263  void SAL_CALL setTintAndShade( const uno::Any& /*rAny*/ ) override
264  {
265  // TODO implement
266  }
267  uno::Any SAL_CALL getTintAndShade() override
268  {
269  // TODO implement
270  return uno::makeAny(static_cast<double>(0));
271  }
272 
273  uno::Any SAL_CALL getLineStyle() override
274  {
275  // always return xlContinuous;
276  return uno::makeAny( XlLineStyle::xlContinuous );
277  }
278  void SAL_CALL setLineStyle( const uno::Any& _linestyle ) override
279  {
280  // Urk no choice but to silently ignore we don't support this attribute
281  // #TODO would be nice to support the excel line styles
282  sal_Int32 nLineStyle = 0;
283  _linestyle >>= nLineStyle;
284  table::BorderLine aBorderLine;
285  if ( !getBorderLine( aBorderLine ) )
286  throw uno::RuntimeException("Method failed" );
287 
288  switch ( nLineStyle )
289  {
290  case XlLineStyle::xlContinuous:
291  case XlLineStyle::xlDash:
292  case XlLineStyle::xlDashDot:
293  case XlLineStyle::xlDashDotDot:
294  case XlLineStyle::xlDot:
295  case XlLineStyle::xlDouble:
296  case XlLineStyle::xlLineStyleNone:
297  case XlLineStyle::xlSlantDashDot:
298  break;
299  default:
300  throw uno::RuntimeException("Bad param" );
301  }
302  setBorderLine( aBorderLine );
303 
304  }
305 };
306 
307 class RangeBorders : public RangeBorders_Base
308 {
309 private:
310  uno::Reference< table::XCellRange > m_xRange;
311  uno::Reference< uno::XComponentContext > m_xContext;
312  ScVbaPalette m_Palette;
313  sal_Int32 getTableIndex( sal_Int32 nConst )
314  {
315  // okay return position of the index in the table
316  sal_Int32 nIndexes = getCount();
317  sal_Int32 realIndex = 0;
318  const sal_Int16* pTableEntry = supportedIndexTable;
319  for ( ; realIndex < nIndexes; ++realIndex, ++pTableEntry )
320  {
321  if ( *pTableEntry == nConst )
322  return realIndex;
323  }
324  return getCount(); // error condition
325  }
326 public:
327  RangeBorders( const uno::Reference< table::XCellRange >& xRange, const uno::Reference< uno::XComponentContext > & xContext, const ScVbaPalette& rPalette ) : m_xRange( xRange ), m_xContext( xContext ), m_Palette( rPalette )
328  {
329  }
330  // XIndexAccess
331  virtual ::sal_Int32 SAL_CALL getCount( ) override
332  {
334  }
335  virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) override
336  {
337 
338  sal_Int32 nIndex = getTableIndex( Index );
339  if ( nIndex >= 0 && nIndex < getCount() )
340  {
341  uno::Reference< beans::XPropertySet > xProps( m_xRange, uno::UNO_QUERY_THROW );
342  return uno::makeAny( uno::Reference< excel::XBorder >( new ScVbaBorder( xProps, m_xContext, supportedIndexTable[ nIndex ], m_Palette )) );
343  }
344  throw lang::IndexOutOfBoundsException();
345  }
346  virtual uno::Type SAL_CALL getElementType( ) override
347  {
349  }
350  virtual sal_Bool SAL_CALL hasElements( ) override
351  {
352  return true;
353  }
354 };
355 
356 }
357 
358 static uno::Reference< container::XIndexAccess >
359 rangeToBorderIndexAccess( const uno::Reference< table::XCellRange >& xRange, const uno::Reference< uno::XComponentContext > & xContext, const ScVbaPalette& rPalette )
360 {
361  return new RangeBorders( xRange, xContext, rPalette );
362 }
363 
364 namespace {
365 
366 class RangeBorderEnumWrapper : public EnumerationHelper_BASE
367 {
368  uno::Reference<container::XIndexAccess > m_xIndexAccess;
369  sal_Int32 nIndex;
370 public:
371  explicit RangeBorderEnumWrapper( const uno::Reference< container::XIndexAccess >& xIndexAccess ) : m_xIndexAccess( xIndexAccess ), nIndex( 0 ) {}
372  virtual sal_Bool SAL_CALL hasMoreElements( ) override
373  {
374  return ( nIndex < m_xIndexAccess->getCount() );
375  }
376 
377  virtual uno::Any SAL_CALL nextElement( ) override
378  {
379  if ( nIndex < m_xIndexAccess->getCount() )
380  return m_xIndexAccess->getByIndex( nIndex++ );
381  throw container::NoSuchElementException();
382  }
383 };
384 
385 }
386 
387 ScVbaBorders::ScVbaBorders( const uno::Reference< XHelperInterface >& xParent,
388  const uno::Reference< uno::XComponentContext > & xContext,
389  const uno::Reference< table::XCellRange >& xRange,
390  const ScVbaPalette& rPalette )
391  : ScVbaBorders_BASE( xParent, xContext, rangeToBorderIndexAccess( xRange ,xContext, rPalette ) ), bRangeIsSingleCell( false )
392 {
393  uno::Reference< table::XColumnRowRange > xColumnRowRange(xRange, uno::UNO_QUERY_THROW );
394  if ( xColumnRowRange->getRows()->getCount() == 1 && xColumnRowRange->getColumns()->getCount() == 1 )
395  bRangeIsSingleCell = true;
396  m_xProps.set( xRange, uno::UNO_QUERY_THROW );
397 }
398 
399 uno::Reference< container::XEnumeration >
401 {
402  return new RangeBorderEnumWrapper( m_xIndexAccess );
403 }
404 
405 uno::Any
406 ScVbaBorders::createCollectionObject( const css::uno::Any& aSource )
407 {
408  return aSource; // it's already a Border object
409 }
410 
411 uno::Type
413 {
415 }
416 
417 uno::Any
418 ScVbaBorders::getItemByIntIndex( const sal_Int32 nIndex )
419 {
420  return createCollectionObject( m_xIndexAccess->getByIndex( nIndex ) );
421 }
422 
424 {
425  sal_Int32 count = getCount();
426  uno::Any color;
427  for( sal_Int32 i = 0; i < count ; i++ )
428  {
429  if( XlBordersIndex::xlDiagonalDown != supportedIndexTable[i] && XlBordersIndex::xlDiagonalUp != supportedIndexTable[i] )
430  {
431  uno::Reference< XBorder > xBorder( getItemByIntIndex( supportedIndexTable[i] ), uno::UNO_QUERY_THROW );
432  if( color.hasValue() )
433  {
434  if( color != xBorder->getColor() )
435  return uno::makeAny( uno::Reference< uno::XInterface >() );
436  }
437  else
438  color = xBorder->getColor();
439  }
440  }
441  return color;
442 }
443 void SAL_CALL ScVbaBorders::setColor( const uno::Any& _color )
444 {
445  sal_Int32 count = getCount();
446  for( sal_Int32 i = 0; i < count ; i++ )
447  {
448  uno::Reference< XBorder > xBorder( getItemByIntIndex( supportedIndexTable[i] ), uno::UNO_QUERY_THROW );
449  xBorder->setColor( _color );
450  }
451 }
453 {
454  sal_Int32 count = getCount();
455  uno::Any nColorIndex;
456  for( sal_Int32 i = 0; i < count ; i++ )
457  {
458  if( XlBordersIndex::xlDiagonalDown != supportedIndexTable[i] && XlBordersIndex::xlDiagonalUp != supportedIndexTable[i] )
459  {
460  uno::Reference< XBorder > xBorder( getItemByIntIndex( supportedIndexTable[i] ), uno::UNO_QUERY_THROW );
461  if( nColorIndex.hasValue() )
462  {
463  if( nColorIndex != xBorder->getColorIndex() )
464  return uno::makeAny( uno::Reference< uno::XInterface >() );
465  }
466  else
467  nColorIndex = xBorder->getColorIndex();
468  }
469  }
470  return nColorIndex;
471 }
472 void SAL_CALL ScVbaBorders::setColorIndex( const uno::Any& _colorindex )
473 {
474  sal_Int32 count = getCount();
475  for( sal_Int32 i = 0; i < count ; i++ )
476  {
477  uno::Reference< XBorder > xBorder( getItemByIntIndex( supportedIndexTable[i] ), uno::UNO_QUERY_THROW );
478  xBorder->setColorIndex( _colorindex );
479  }
480 }
481 
482 static bool
483 lcl_areAllLineWidthsSame( const table::TableBorder& maTableBorder, bool bIsCell )
484 {
485 
486  bool bRes = false;
487  if (bIsCell)
488  {
489  bRes = ((maTableBorder.TopLine.OuterLineWidth == maTableBorder.BottomLine.OuterLineWidth) &&
490 (maTableBorder.TopLine.OuterLineWidth == maTableBorder.LeftLine.OuterLineWidth) &&
491 (maTableBorder.TopLine.OuterLineWidth == maTableBorder.RightLine.OuterLineWidth));
492  }
493  else
494  {
495  bRes = ((maTableBorder.TopLine.OuterLineWidth == maTableBorder.BottomLine.OuterLineWidth) &&
496 (maTableBorder.TopLine.OuterLineWidth == maTableBorder.LeftLine.OuterLineWidth) &&
497 (maTableBorder.TopLine.OuterLineWidth == maTableBorder.HorizontalLine.OuterLineWidth) &&
498 (maTableBorder.TopLine.OuterLineWidth == maTableBorder.VerticalLine.OuterLineWidth) &&
499 (maTableBorder.TopLine.OuterLineWidth == maTableBorder.RightLine.OuterLineWidth));
500  }
501  return bRes;
502 }
503 
505 {
506  table::TableBorder aTableBorder;
507  m_xProps->getPropertyValue( sTableBorder ) >>= aTableBorder;
508 
509  sal_Int32 aLinestyle = XlLineStyle::xlLineStyleNone;
510 
511  if ( lcl_areAllLineWidthsSame( aTableBorder, bRangeIsSingleCell ))
512  {
513  if (aTableBorder.TopLine.LineDistance != 0)
514  {
515  aLinestyle = XlLineStyle::xlDouble;
516  }
517  else if ( aTableBorder.TopLine.OuterLineWidth != 0 )
518  {
519  aLinestyle = XlLineStyle::xlContinuous;
520  }
521  }
522  return uno::makeAny( aLinestyle );
523 }
524 void SAL_CALL ScVbaBorders::setLineStyle( const uno::Any& _linestyle )
525 {
526  sal_Int32 count = getCount();
527  for( sal_Int32 i = 0; i < count ; i++ )
528  {
529  uno::Reference< XBorder > xBorder( getItemByIntIndex( supportedIndexTable[i] ), uno::UNO_QUERY_THROW );
530  xBorder->setLineStyle( _linestyle );
531  }
532 }
534 {
535  sal_Int32 count = getCount();
536  uno::Any weight;
537  for( sal_Int32 i = 0; i < count ; i++ )
538  {
539  if( XlBordersIndex::xlDiagonalDown != supportedIndexTable[i] && XlBordersIndex::xlDiagonalUp != supportedIndexTable[i] )
540  {
541  uno::Reference< XBorder > xBorder( getItemByIntIndex( supportedIndexTable[i] ), uno::UNO_QUERY_THROW );
542  if( weight.hasValue() )
543  {
544  if( weight != xBorder->getWeight() )
545  return uno::makeAny( uno::Reference< uno::XInterface >() );
546  }
547  else
548  weight = xBorder->getWeight();
549  }
550  }
551  return weight;
552 }
553 
555 {
556  // TODO implement
557  return uno::makeAny(static_cast<double>(0));
558 }
559 
560 void SAL_CALL ScVbaBorders::setTintAndShade(const uno::Any& /*rAny*/)
561 {
562  // TODO implement
563 }
564 
565 void SAL_CALL ScVbaBorders::setWeight( const uno::Any& _weight )
566 {
567  sal_Int32 count = getCount();
568  for( sal_Int32 i = 0; i < count ; i++ )
569  {
570  uno::Reference< XBorder > xBorder( getItemByIntIndex( supportedIndexTable[i] ), uno::UNO_QUERY_THROW );
571  xBorder->setWeight( _weight );
572  }
573 }
574 
575 OUString
577 {
578  return "ScVbaBorders";
579 }
580 
581 uno::Sequence< OUString >
583 {
584  static uno::Sequence< OUString > const aServiceNames
585  {
586  "ooo.vba.excel.Borders"
587  };
588  return aServiceNames;
589 }
590 
591 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const sal_Int32 OOLineThin
Definition: vbaborders.cxx:48
bool hasValue()
sal_Int32 nIndex
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: vbaborders.cxx:400
css::uno::Reference< css::beans::XPropertySet > m_xProps
Definition: vbaborders.hxx:36
virtual css::uno::Any SAL_CALL getColorIndex() override
Definition: vbaborders.cxx:452
const sal_Int32 OOLineMedium
Definition: vbaborders.cxx:49
virtual void SAL_CALL setWeight(const css::uno::Any &) override
Definition: vbaborders.cxx:565
Sequence< OUString > aServiceNames
virtual void SAL_CALL setColorIndex(const css::uno::Any &_colorindex) override
Definition: vbaborders.cxx:472
sal_Int32 XLRGBToOORGB(sal_Int32 nCol)
const sal_Int32 OOLineHairline
Definition: vbaborders.cxx:51
::cppu::WeakImplHelper< css::container::XEnumeration > EnumerationHelper_BASE
ScVbaBorders(const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::table::XCellRange > &xRange, const ScVbaPalette &rPalette)
Definition: vbaborders.cxx:387
bool bRangeIsSingleCell
Definition: vbaborders.hxx:35
virtual css::uno::Sequence< OUString > getServiceNames()=0
virtual css::uno::Type SAL_CALL getElementType() override
Definition: vbaborders.cxx:412
virtual css::uno::Any getItemByIntIndex(const sal_Int32 nIndex) override
Definition: vbaborders.cxx:418
virtual css::uno::Any SAL_CALL getLineStyle() override
Definition: vbaborders.cxx:504
static uno::Reference< container::XIndexAccess > rangeToBorderIndexAccess(const uno::Reference< table::XCellRange > &xRange, const uno::Reference< uno::XComponentContext > &xContext, const ScVbaPalette &rPalette)
Definition: vbaborders.cxx:359
virtual css::uno::Any SAL_CALL getWeight() override
Definition: vbaborders.cxx:533
#define SAL_N_ELEMENTS(arr)
virtual OUString getServiceImplName() override
Definition: vbaborders.cxx:576
virtual css::uno::Any createCollectionObject(const css::uno::Any &aSource) override
Definition: vbaborders.cxx:406
int i
constexpr OUStringLiteral sTableBorder
Definition: vbaborders.cxx:45
virtual void SAL_CALL setTintAndShade(const css::uno::Any &) override
Definition: vbaborders.cxx:560
virtual css::uno::Any SAL_CALL getTintAndShade() override
Definition: vbaborders.cxx:554
sal_Int32 OORGBToXLRGB(sal_Int32 nCol)
float u
unsigned char sal_Bool
static bool lcl_areAllLineWidthsSame(const table::TableBorder &maTableBorder, bool bIsCell)
Definition: vbaborders.cxx:483
css::uno::Type const & get()
ColorTransparency
const sal_Int16 supportedIndexTable[]
Definition: vbaborders.cxx:43
InheritedHelperInterfaceWeakImpl< excel::XBorder > ScVbaBorder_Base
Definition: vbaborders.cxx:39
virtual css::uno::Sequence< OUString > getServiceNames() override
Definition: vbaborders.cxx:582
Reference< XPropertySet > m_xProps
virtual void SAL_CALL setLineStyle(const css::uno::Any &_linestyle) override
Definition: vbaborders.cxx:524
Reference< XComponentContext > m_xContext
::cppu::WeakImplHelper< container::XIndexAccess > RangeBorders_Base
Definition: vbaborders.cxx:38
virtual css::uno::Any SAL_CALL getColor() override
Definition: vbaborders.cxx:423
virtual void SAL_CALL setColor(const css::uno::Any &_color) override
Definition: vbaborders.cxx:443
const sal_Int32 OOLineThick
Definition: vbaborders.cxx:50
struct _ADOIndex Index
virtual ::sal_Int32 SAL_CALL getCount() override
css::uno::Reference< css::container::XIndexAccess > getPalette() const
Definition: vbapalette.cxx:100