LibreOffice Module sc (master)  1
datauno.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 
20 #include <datauno.hxx>
21 
22 #include <svl/hint.hxx>
23 #include <svl/numformat.hxx>
24 #include <svl/sharedstringpool.hxx>
25 #include <vcl/svapp.hxx>
26 #include <unotools/charclass.hxx>
27 #include <osl/diagnose.h>
28 
29 #include <com/sun/star/awt/XBitmap.hpp>
30 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
31 #include <com/sun/star/util/SortField.hpp>
32 #include <com/sun/star/table/TableSortField.hpp>
33 #include <com/sun/star/beans/PropertyAttribute.hpp>
34 #include <com/sun/star/table/TableOrientation.hpp>
35 #include <com/sun/star/table/CellRangeAddress.hpp>
36 #include <com/sun/star/sheet/DataImportMode.hpp>
37 #include <com/sun/star/sheet/FilterFieldType.hpp>
38 #include <com/sun/star/sheet/FilterOperator2.hpp>
39 #include <com/sun/star/sheet/TableFilterField2.hpp>
40 
41 #include <dapiuno.hxx>
42 #include <cellsuno.hxx>
43 #include <miscuno.hxx>
44 #include <targuno.hxx>
45 #include <rangeutl.hxx>
46 #include <dbdata.hxx>
47 #include <docsh.hxx>
48 #include <dbdocfun.hxx>
49 #include <unonames.hxx>
50 #include <globalnames.hxx>
51 #include <convuno.hxx>
52 #include <hints.hxx>
53 #include <attrib.hxx>
54 #include <dpshttab.hxx>
55 #include <queryentry.hxx>
56 #include <dputil.hxx>
57 #include <sortparam.hxx>
58 #include <dpobject.hxx>
59 #include <filterentries.hxx>
60 
61 #include <comphelper/extract.hxx>
64 
65 #include <memory>
66 
67 using namespace com::sun::star;
68 using namespace css::sheet;
69 
70 // everything without Which-ID, map only for PropertySetInfo
71 
73 {
74  // some old property names are for 5.2 compatibility
75 
76  static const SfxItemPropertyMapEntry aSubTotalPropertyMap_Impl[] =
77  {
85  { SC_UNONAME_MAXFLD, 0, cppu::UnoType<sal_Int32>::get(), beans::PropertyAttribute::READONLY, 0},
90  { u"", 0, css::uno::Type(), 0, 0 }
91  };
92  return aSubTotalPropertyMap_Impl;
93 }
94 
96 {
97  static const SfxItemPropertyMapEntry aFilterPropertyMap_Impl[] =
98  {
102  { SC_UNONAME_MAXFLD, 0, cppu::UnoType<sal_Int32>::get(), beans::PropertyAttribute::READONLY, 0},
108  { u"", 0, css::uno::Type(), 0, 0 }
109  };
110  return aFilterPropertyMap_Impl;
111 }
112 
114 {
115  static const SfxItemPropertyMapEntry aDBRangePropertyMap_Impl[] =
116  {
120  { SC_UNONAME_ISUSER, 0, cppu::UnoType<bool>::get(), beans::PropertyAttribute::READONLY, 0 },
122  { SC_UNO_LINKDISPBIT, 0, cppu::UnoType<awt::XBitmap>::get(), beans::PropertyAttribute::READONLY, 0 },
123  { SC_UNO_LINKDISPNAME, 0, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::READONLY, 0 },
127  { SC_UNONAME_TOKENINDEX,0, cppu::UnoType<sal_Int32>::get(), beans::PropertyAttribute::READONLY, 0 },
131  { u"", 0, css::uno::Type(), 0, 0 }
132  };
133  return aDBRangePropertyMap_Impl;
134 }
135 
136 SC_SIMPLE_SERVICE_INFO( ScConsolidationDescriptor, "ScConsolidationDescriptor", "com.sun.star.sheet.ConsolidationDescriptor" )
137 SC_SIMPLE_SERVICE_INFO( ScDatabaseRangesObj, "ScDatabaseRangesObj", "com.sun.star.sheet.DatabaseRanges" )
138 SC_SIMPLE_SERVICE_INFO( ScFilterDescriptorBase, "ScFilterDescriptorBase", "com.sun.star.sheet.SheetFilterDescriptor" )
139 SC_SIMPLE_SERVICE_INFO( ScSubTotalDescriptorBase, "ScSubTotalDescriptorBase", "com.sun.star.sheet.SubTotalDescriptor" )
140 SC_SIMPLE_SERVICE_INFO( ScSubTotalFieldObj, "ScSubTotalFieldObj", "com.sun.star.sheet.SubTotalField" )
141 
142 sheet::GeneralFunction ScDataUnoConversion::SubTotalToGeneral( ScSubTotalFunc eSubTotal )
143 {
144  sheet::GeneralFunction eGeneral;
145  switch (eSubTotal)
146  {
147  case SUBTOTAL_FUNC_NONE: eGeneral = sheet::GeneralFunction_NONE; break;
148  case SUBTOTAL_FUNC_AVE: eGeneral = sheet::GeneralFunction_AVERAGE; break;
149  case SUBTOTAL_FUNC_CNT: eGeneral = sheet::GeneralFunction_COUNTNUMS; break;
150  case SUBTOTAL_FUNC_CNT2: eGeneral = sheet::GeneralFunction_COUNT; break;
151  case SUBTOTAL_FUNC_MAX: eGeneral = sheet::GeneralFunction_MAX; break;
152  case SUBTOTAL_FUNC_MIN: eGeneral = sheet::GeneralFunction_MIN; break;
153  case SUBTOTAL_FUNC_PROD: eGeneral = sheet::GeneralFunction_PRODUCT; break;
154  case SUBTOTAL_FUNC_STD: eGeneral = sheet::GeneralFunction_STDEV; break;
155  case SUBTOTAL_FUNC_STDP: eGeneral = sheet::GeneralFunction_STDEVP; break;
156  case SUBTOTAL_FUNC_SUM: eGeneral = sheet::GeneralFunction_SUM; break;
157  case SUBTOTAL_FUNC_VAR: eGeneral = sheet::GeneralFunction_VAR; break;
158  case SUBTOTAL_FUNC_VARP: eGeneral = sheet::GeneralFunction_VARP; break;
159  default:
160  OSL_FAIL("SubTotalToGeneral: wrong enum");
161  eGeneral = sheet::GeneralFunction_NONE;
162  break;
163  }
164  return eGeneral;
165 }
166 
167 void ScImportDescriptor::FillProperties( uno::Sequence<beans::PropertyValue>& rSeq, const ScImportParam& rParam )
168 {
169  OSL_ENSURE( rSeq.getLength() == GetPropertyCount(), "wrong Count" );
170 
171  beans::PropertyValue* pArray = rSeq.getArray();
172 
173  sheet::DataImportMode eMode = sheet::DataImportMode_NONE;
174  if ( rParam.bImport )
175  {
176  if ( rParam.bSql )
177  eMode = sheet::DataImportMode_SQL;
178  else if ( rParam.nType == ScDbQuery )
179  eMode = sheet::DataImportMode_QUERY;
180  else
181  eMode = sheet::DataImportMode_TABLE; // type always ScDbQuery or ScDbTable
182  }
183 
184  svx::ODataAccessDescriptor aDescriptor;
185  aDescriptor.setDataSource(rParam.aDBName);
187  {
188  pArray[0].Name = SC_UNONAME_DBNAME;
189  pArray[0].Value <<= rParam.aDBName;
190  }
192  {
193  pArray[0].Name = SC_UNONAME_CONRES;
194  pArray[0].Value <<= rParam.aDBName;
195  }
196 
197  pArray[1].Name = SC_UNONAME_SRCTYPE;
198  pArray[1].Value <<= eMode;
199 
200  pArray[2].Name = SC_UNONAME_SRCOBJ;
201  pArray[2].Value <<= rParam.aStatement;
202 
203  pArray[3].Name = SC_UNONAME_ISNATIVE;
204  pArray[3].Value <<= rParam.bNative;
205 }
206 
207 void ScImportDescriptor::FillImportParam( ScImportParam& rParam, const uno::Sequence<beans::PropertyValue>& rSeq )
208 {
209  OUString aStrVal;
210  for (const beans::PropertyValue& rProp : rSeq)
211  {
212  OUString aPropName(rProp.Name);
213 
214  if (aPropName == SC_UNONAME_ISNATIVE)
215  rParam.bNative = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
216  else if (aPropName == SC_UNONAME_DBNAME)
217  {
218  if ( rProp.Value >>= aStrVal )
219  rParam.aDBName = aStrVal;
220  }
221  else if (aPropName == SC_UNONAME_CONRES)
222  {
223  if ( rProp.Value >>= aStrVal )
224  rParam.aDBName = aStrVal;
225  }
226  else if (aPropName == SC_UNONAME_SRCOBJ)
227  {
228  if ( rProp.Value >>= aStrVal )
229  rParam.aStatement = aStrVal;
230  }
231  else if (aPropName == SC_UNONAME_SRCTYPE)
232  {
234  sheet::DataImportMode eMode = static_cast<sheet::DataImportMode>(ScUnoHelpFunctions::GetEnumFromAny( rProp.Value ));
235  switch (eMode)
236  {
237  case sheet::DataImportMode_NONE:
238  rParam.bImport = false;
239  break;
240  case sheet::DataImportMode_SQL:
241  rParam.bImport = true;
242  rParam.bSql = true;
243  break;
244  case sheet::DataImportMode_TABLE:
245  rParam.bImport = true;
246  rParam.bSql = false;
247  rParam.nType = ScDbTable;
248  break;
249  case sheet::DataImportMode_QUERY:
250  rParam.bImport = true;
251  rParam.bSql = false;
252  rParam.nType = ScDbQuery;
253  break;
254  default:
255  OSL_FAIL("wrong mode");
256  rParam.bImport = false;
257  }
258  }
259  }
260 }
261 
262 void ScSortDescriptor::FillProperties( uno::Sequence<beans::PropertyValue>& rSeq, const ScSortParam& rParam )
263 {
264  OSL_ENSURE( rSeq.getLength() == GetPropertyCount(), "wrong count" );
265 
266  beans::PropertyValue* pArray = rSeq.getArray();
267 
268  // gather Uno values together
269 
270  table::CellAddress aOutPos;
271  aOutPos.Sheet = rParam.nDestTab;
272  aOutPos.Column = rParam.nDestCol;
273  aOutPos.Row = rParam.nDestRow;
274 
275  sal_uInt16 nSortCount = 0;
276  while ( nSortCount < rParam.GetSortKeyCount() && rParam.maKeyState[nSortCount].bDoSort )
277  ++nSortCount;
278 
279  uno::Sequence<table::TableSortField> aFields(nSortCount);
280  if (nSortCount)
281  {
282  table::TableSortField* pFieldArray = aFields.getArray();
283  for (sal_uInt16 i=0; i<nSortCount; i++)
284  {
285  pFieldArray[i].Field = rParam.maKeyState[i].nField;
286  pFieldArray[i].IsAscending = rParam.maKeyState[i].bAscending;
287  pFieldArray[i].FieldType = table::TableSortFieldType_AUTOMATIC; // always automatic
288  pFieldArray[i].IsCaseSensitive = rParam.bCaseSens;
289  pFieldArray[i].CollatorLocale = rParam.aCollatorLocale;
290  pFieldArray[i].CollatorAlgorithm = rParam.aCollatorAlgorithm;
291  }
292  }
293 
294  // fill the sequence
295 
296  pArray[0].Name = SC_UNONAME_ISSORTCOLUMNS;
297  pArray[0].Value <<= !rParam.bByRow;
298 
299  pArray[1].Name = SC_UNONAME_CONTHDR;
300  pArray[1].Value <<= rParam.bHasHeader;
301 
302  pArray[2].Name = SC_UNONAME_MAXFLD;
303  pArray[2].Value <<= static_cast<sal_Int32>( rParam.GetSortKeyCount() );
304 
305  pArray[3].Name = SC_UNONAME_SORTFLD;
306  pArray[3].Value <<= aFields;
307 
308  pArray[4].Name = SC_UNONAME_BINDFMT;
309  pArray[4].Value <<= rParam.aDataAreaExtras.mbCellFormats;
310 
311  pArray[5].Name = SC_UNONAME_COPYOUT;
312  pArray[5].Value <<= !rParam.bInplace;
313 
314  pArray[6].Name = SC_UNONAME_OUTPOS;
315  pArray[6].Value <<= aOutPos;
316 
317  pArray[7].Name = SC_UNONAME_ISULIST;
318  pArray[7].Value <<= rParam.bUserDef;
319 
320  pArray[8].Name = SC_UNONAME_UINDEX;
321  pArray[8].Value <<= static_cast<sal_Int32>( rParam.nUserIndex );
322 }
323 
324 void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence<beans::PropertyValue>& rSeq )
325 {
326  sal_Int32 nSortSize = static_cast<sal_Int32>(rParam.GetSortKeyCount());
327 
328  for (const beans::PropertyValue& rProp : rSeq)
329  {
330  OUString aPropName(rProp.Name);
331 
332  if (aPropName == SC_UNONAME_ORIENT)
333  {
335  table::TableOrientation eOrient = static_cast<table::TableOrientation>(ScUnoHelpFunctions::GetEnumFromAny( rProp.Value ));
336  rParam.bByRow = ( eOrient != table::TableOrientation_COLUMNS );
337  }
338  else if (aPropName == SC_UNONAME_ISSORTCOLUMNS)
339  {
340  rParam.bByRow = !::cppu::any2bool(rProp.Value);
341  }
342  else if (aPropName == SC_UNONAME_CONTHDR)
343  rParam.bHasHeader = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
344  else if (aPropName == SC_UNONAME_MAXFLD)
345  {
346  sal_Int32 nVal;
347  if ( (rProp.Value >>= nVal) && nVal > nSortSize )
348  {
351  }
352  }
353  else if (aPropName == SC_UNONAME_SORTFLD)
354  {
355  uno::Sequence<util::SortField> aSeq;
356  uno::Sequence<table::TableSortField> aNewSeq;
357  if ( rProp.Value >>= aSeq )
358  {
359  sal_Int32 nCount = aSeq.getLength();
360  sal_Int32 i;
361  if ( nCount > static_cast<sal_Int32>( rParam.GetSortKeyCount() ) )
362  {
363  // tdf#105301 - increase the size of the sorting keys
364  nSortSize = nCount;
365  rParam.maKeyState.resize(nCount);
366  }
367  const util::SortField* pFieldArray = aSeq.getConstArray();
368  for (i=0; i<nCount; i++)
369  {
370  rParam.maKeyState[i].nField = static_cast<SCCOLROW>( pFieldArray[i].Field );
371  rParam.maKeyState[i].bAscending = pFieldArray[i].SortAscending;
372 
373  // FieldType is ignored
374  rParam.maKeyState[i].bDoSort = true;
375  }
376  for (i=nCount; i<nSortSize; i++)
377  rParam.maKeyState[i].bDoSort = false;
378  }
379  else if ( rProp.Value >>= aNewSeq )
380  {
381  sal_Int32 nCount = aNewSeq.getLength();
382  sal_Int32 i;
383  if ( nCount > nSortSize )
384  {
385  nCount = nSortSize;
386  rParam.maKeyState.resize(nCount);
387  }
388  const table::TableSortField* pFieldArray = aNewSeq.getConstArray();
389  for (i=0; i<nCount; i++)
390  {
391  rParam.maKeyState[i].nField = static_cast<SCCOLROW>( pFieldArray[i].Field );
392  rParam.maKeyState[i].bAscending = pFieldArray[i].IsAscending;
393 
394  // only one is possible, sometime we should make it possible to have different for every entry
395  rParam.bCaseSens = pFieldArray[i].IsCaseSensitive;
396  rParam.aCollatorLocale = pFieldArray[i].CollatorLocale;
397  rParam.aCollatorAlgorithm = pFieldArray[i].CollatorAlgorithm;
398 
399  // FieldType is ignored
400  rParam.maKeyState[i].bDoSort = true;
401  }
402  for (i=nCount; i<nSortSize; i++)
403  rParam.maKeyState[i].bDoSort = false;
404  }
405  }
406  else if (aPropName == SC_UNONAME_ISCASE)
407  {
408  rParam.bCaseSens = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
409  }
410  else if (aPropName == SC_UNONAME_BINDFMT)
412  else if (aPropName == SC_UNONAME_COPYOUT)
413  rParam.bInplace = !ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
414  else if (aPropName == SC_UNONAME_OUTPOS)
415  {
416  table::CellAddress aAddress;
417  if ( rProp.Value >>= aAddress )
418  {
419  rParam.nDestTab = aAddress.Sheet;
420  rParam.nDestCol = static_cast<SCCOL>(aAddress.Column);
421  rParam.nDestRow = static_cast<SCROW>(aAddress.Row);
422  }
423  }
424  else if (aPropName == SC_UNONAME_ISULIST)
425  rParam.bUserDef = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
426  else if (aPropName == SC_UNONAME_UINDEX)
427  {
428  sal_Int32 nVal = 0;
429  if ( rProp.Value >>= nVal )
430  rParam.nUserIndex = static_cast<sal_uInt16>(nVal);
431  }
432  else if (aPropName == SC_UNONAME_COLLLOC)
433  {
434  rProp.Value >>= rParam.aCollatorLocale;
435  }
436  else if (aPropName == SC_UNONAME_COLLALG)
437  {
438  OUString sStr;
439  if ( rProp.Value >>= sStr )
440  rParam.aCollatorAlgorithm = sStr;
441  }
442  }
443 }
444 
446  xParent( pDesc ),
447  nPos( nP )
448 {
449  OSL_ENSURE(pDesc, "ScSubTotalFieldObj: Parent is 0");
450 }
451 
453 {
454 }
455 
456 // XSubTotalField
457 
459 {
460  SolarMutexGuard aGuard;
461  ScSubTotalParam aParam;
462  xParent->GetData(aParam);
463 
464  return aParam.nField[nPos];
465 }
466 
467 void SAL_CALL ScSubTotalFieldObj::setGroupColumn( sal_Int32 nGroupColumn )
468 {
469  SolarMutexGuard aGuard;
470  ScSubTotalParam aParam;
471  xParent->GetData(aParam);
472 
473  aParam.nField[nPos] = static_cast<SCCOL>(nGroupColumn);
474 
475  xParent->PutData(aParam);
476 }
477 
478 uno::Sequence<sheet::SubTotalColumn> SAL_CALL ScSubTotalFieldObj::getSubTotalColumns()
479 {
480  SolarMutexGuard aGuard;
481  ScSubTotalParam aParam;
482  xParent->GetData(aParam);
483 
484  SCCOL nCount = aParam.nSubTotals[nPos];
485  uno::Sequence<sheet::SubTotalColumn> aSeq(nCount);
486  sheet::SubTotalColumn* pAry = aSeq.getArray();
487  for (SCCOL i=0; i<nCount; i++)
488  {
489  pAry[i].Column = aParam.pSubTotals[nPos][i];
490  pAry[i].Function = ScDataUnoConversion::SubTotalToGeneral(
491  aParam.pFunctions[nPos][i] );
492  }
493  return aSeq;
494 }
495 
497  const uno::Sequence<sheet::SubTotalColumn>& aSubTotalColumns )
498 {
499  SolarMutexGuard aGuard;
500  ScSubTotalParam aParam;
501  xParent->GetData(aParam);
502 
503  sal_uInt32 nColCount = aSubTotalColumns.getLength();
504  if ( nColCount <= sal::static_int_cast<sal_uInt32>(SCCOL_MAX) )
505  {
506  SCCOL nCount = static_cast<SCCOL>(nColCount);
507  aParam.nSubTotals[nPos] = nCount;
508  if (nCount != 0)
509  {
510  aParam.pSubTotals[nPos].reset(new SCCOL[nCount]);
511  aParam.pFunctions[nPos].reset(new ScSubTotalFunc[nCount]);
512 
513  const sheet::SubTotalColumn* pAry = aSubTotalColumns.getConstArray();
514  for (SCCOL i=0; i<nCount; i++)
515  {
516  aParam.pSubTotals[nPos][i] = static_cast<SCCOL>(pAry[i].Column);
517  aParam.pFunctions[nPos][i] = ScDPUtil::toSubTotalFunc(static_cast<ScGeneralFunction>(pAry[i].Function));
518  }
519  }
520  else
521  {
522  aParam.pSubTotals[nPos].reset();
523  aParam.pFunctions[nPos].reset();
524  }
525  }
527 
528  xParent->PutData(aParam);
529 }
530 
532  aPropSet( lcl_GetSubTotalPropertyMap() )
533 {
534 }
535 
537 {
538 }
539 
540 // XSubTotalDescriptor
541 
543 {
544  if ( nIndex < getCount() )
545  return new ScSubTotalFieldObj( this, nIndex );
546  return nullptr;
547 }
548 
550 {
551  SolarMutexGuard aGuard;
552  ScSubTotalParam aParam;
553  GetData(aParam);
554 
555  for (bool & rn : aParam.bGroupActive)
556  rn = false;
557 
559 
560  PutData(aParam);
561 }
562 
564  const uno::Sequence<sheet::SubTotalColumn>& aSubTotalColumns,
565  sal_Int32 nGroupColumn )
566 {
567  SolarMutexGuard aGuard;
568  ScSubTotalParam aParam;
569  GetData(aParam);
570 
571  sal_uInt16 nPos = 0;
572  while ( nPos < MAXSUBTOTAL && aParam.bGroupActive[nPos] )
573  ++nPos;
574 
575  sal_uInt32 nColCount = aSubTotalColumns.getLength();
576 
577  if ( nPos >= MAXSUBTOTAL || nColCount > sal::static_int_cast<sal_uInt32>(SCCOL_MAX) )
578  // too many fields / columns
579  throw uno::RuntimeException(); // no other exceptions specified
580 
581  aParam.bGroupActive[nPos] = true;
582  aParam.nField[nPos] = static_cast<SCCOL>(nGroupColumn);
583 
584  aParam.pSubTotals[nPos].reset();
585  aParam.pFunctions[nPos].reset();
586 
587  SCCOL nCount = static_cast<SCCOL>(nColCount);
588  aParam.nSubTotals[nPos] = nCount;
589  if (nCount != 0)
590  {
591  aParam.pSubTotals[nPos].reset(new SCCOL[nCount]);
592  aParam.pFunctions[nPos].reset(new ScSubTotalFunc[nCount]);
593 
594  const sheet::SubTotalColumn* pAry = aSubTotalColumns.getConstArray();
595  for (SCCOL i=0; i<nCount; i++)
596  {
597  aParam.pSubTotals[nPos][i] = static_cast<SCCOL>(pAry[i].Column);
598  aParam.pFunctions[nPos][i] = ScDPUtil::toSubTotalFunc(static_cast<ScGeneralFunction>(pAry[i].Function));
599  }
600  }
601  else
602  {
603  aParam.pSubTotals[nPos].reset();
604  aParam.pFunctions[nPos].reset();
605  }
606 
607  PutData(aParam);
608 }
609 
610 // flags/settings as properties
611 
612 // XEnumerationAccess
613 
614 uno::Reference<container::XEnumeration> SAL_CALL ScSubTotalDescriptorBase::createEnumeration()
615 {
616  SolarMutexGuard aGuard;
617  return new ScIndexEnumeration(this, "com.sun.star.sheet.SubTotalFieldsEnumeration");
618 }
619 
620 // XIndexAccess
621 
623 {
624  SolarMutexGuard aGuard;
625  ScSubTotalParam aParam;
626  GetData(aParam);
627 
628  sal_uInt16 nCount = 0;
629  while ( nCount < MAXSUBTOTAL && aParam.bGroupActive[nCount] )
630  ++nCount;
631  return nCount;
632 }
633 
634 uno::Any SAL_CALL ScSubTotalDescriptorBase::getByIndex( sal_Int32 nIndex )
635 {
636  SolarMutexGuard aGuard;
637  uno::Reference<sheet::XSubTotalField> xField(GetObjectByIndex_Impl(static_cast<sal_uInt16>(nIndex)));
638  if (!xField.is())
639  throw lang::IndexOutOfBoundsException();
640 
641  return uno::Any(xField);
642 }
643 
645 {
646  SolarMutexGuard aGuard;
648 }
649 
651 {
652  SolarMutexGuard aGuard;
653  return ( getCount() != 0 );
654 }
655 
656 // XPropertySet
657 
658 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScSubTotalDescriptorBase::getPropertySetInfo()
659 {
660  SolarMutexGuard aGuard;
661  static uno::Reference<beans::XPropertySetInfo> aRef(
663  return aRef;
664 }
665 
667  const OUString& aPropertyName, const uno::Any& aValue )
668 {
669  SolarMutexGuard aGuard;
670  ScSubTotalParam aParam;
671  GetData(aParam);
672 
673  // some old property names are for 5.2 compatibility
674 
675  if (aPropertyName == SC_UNONAME_CASE || aPropertyName == SC_UNONAME_ISCASE )
677  else if (aPropertyName == SC_UNONAME_FORMATS || aPropertyName == SC_UNONAME_BINDFMT )
679  else if (aPropertyName == SC_UNONAME_ENABSORT )
680  aParam.bDoSort = ScUnoHelpFunctions::GetBoolFromAny( aValue );
681  else if (aPropertyName == SC_UNONAME_SORTASC )
683  else if (aPropertyName == SC_UNONAME_INSBRK )
685  else if (aPropertyName == SC_UNONAME_ULIST || aPropertyName == SC_UNONAME_ENUSLIST )
686  aParam.bUserDef = ScUnoHelpFunctions::GetBoolFromAny( aValue );
687  else if (aPropertyName == SC_UNONAME_UINDEX || aPropertyName == SC_UNONAME_USINDEX )
688  {
689  sal_Int32 nVal = 0;
690  if ( aValue >>= nVal )
691  aParam.nUserIndex = static_cast<sal_uInt16>(nVal);
692  }
693  else if (aPropertyName == SC_UNONAME_MAXFLD )
694  {
695  sal_Int32 nVal = 0;
696  if ( (aValue >>= nVal) && nVal > sal::static_int_cast<sal_Int32>(MAXSUBTOTAL) )
697  {
698  throw lang::IllegalArgumentException();
699  }
700  }
701 
702  PutData(aParam);
703 }
704 
705 uno::Any SAL_CALL ScSubTotalDescriptorBase::getPropertyValue( const OUString& aPropertyName )
706 {
707  SolarMutexGuard aGuard;
708  ScSubTotalParam aParam;
709  GetData(aParam);
710 
711  uno::Any aRet;
712 
713  // some old property names are for 5.2 compatibility
714 
715  if (aPropertyName == SC_UNONAME_CASE || aPropertyName == SC_UNONAME_ISCASE )
716  aRet <<= aParam.bCaseSens;
717  else if (aPropertyName == SC_UNONAME_FORMATS || aPropertyName == SC_UNONAME_BINDFMT )
718  aRet <<= aParam.bIncludePattern;
719  else if (aPropertyName == SC_UNONAME_ENABSORT )
720  aRet <<= aParam.bDoSort;
721  else if (aPropertyName == SC_UNONAME_SORTASC )
722  aRet <<= aParam.bAscending;
723  else if (aPropertyName == SC_UNONAME_INSBRK )
724  aRet <<= aParam.bPagebreak;
725  else if (aPropertyName == SC_UNONAME_ULIST || aPropertyName == SC_UNONAME_ENUSLIST )
726  aRet <<= aParam.bUserDef;
727  else if (aPropertyName == SC_UNONAME_UINDEX || aPropertyName == SC_UNONAME_USINDEX )
728  aRet <<= static_cast<sal_Int32>(aParam.nUserIndex);
729  else if (aPropertyName == SC_UNONAME_MAXFLD )
730  aRet <<= sal_Int32(MAXSUBTOTAL);
731 
732  return aRet;
733 }
734 
736 
737 // XUnoTunnel
738 
740 
742 {
743 }
744 
746 {
747 }
748 
750 {
751  rParam = aStoredParam; // query for interface
752 }
753 
755 {
756  aStoredParam = rParam; // set by the interface
757 }
758 
760 {
761  aStoredParam = rNew; // set from outside
762 }
763 
765  mxParent(pPar)
766 {
767 }
768 
770 {
771 }
772 
774 {
775  if (mxParent.is())
776  mxParent->GetSubTotalParam( rParam );
777 }
778 
780 {
781  if (mxParent.is())
782  mxParent->SetSubTotalParam( rParam );
783 }
784 
786 {
787 }
788 
790 {
791 }
792 
794 {
795  aParam = rNew;
796 }
797 
798 // XConsolidationDescriptor
799 
800 sheet::GeneralFunction SAL_CALL ScConsolidationDescriptor::getFunction()
801 {
802  SolarMutexGuard aGuard;
804 }
805 
806 void SAL_CALL ScConsolidationDescriptor::setFunction( sheet::GeneralFunction nFunction )
807 {
808  SolarMutexGuard aGuard;
809  aParam.eFunction = ScDPUtil::toSubTotalFunc(static_cast<ScGeneralFunction>(nFunction));
810 }
811 
812 uno::Sequence<table::CellRangeAddress> SAL_CALL ScConsolidationDescriptor::getSources()
813 {
814  SolarMutexGuard aGuard;
815  sal_uInt16 nCount = aParam.nDataAreaCount;
816  if (!aParam.pDataAreas)
817  nCount = 0;
818  table::CellRangeAddress aRange;
819  uno::Sequence<table::CellRangeAddress> aSeq(nCount);
820  table::CellRangeAddress* pAry = aSeq.getArray();
821  for (sal_uInt16 i=0; i<nCount; i++)
822  {
823  ScArea const & rArea = aParam.pDataAreas[i];
824  aRange.Sheet = rArea.nTab;
825  aRange.StartColumn = rArea.nColStart;
826  aRange.StartRow = rArea.nRowStart;
827  aRange.EndColumn = rArea.nColEnd;
828  aRange.EndRow = rArea.nRowEnd;
829  pAry[i] = aRange;
830  }
831  return aSeq;
832 }
833 
835  const uno::Sequence<table::CellRangeAddress>& aSources )
836 {
837  SolarMutexGuard aGuard;
838  sal_uInt16 nCount = static_cast<sal_uInt16>(aSources.getLength());
839  if (nCount)
840  {
841  const table::CellRangeAddress* pAry = aSources.getConstArray();
842  std::unique_ptr<ScArea[]> pNew(new ScArea[nCount]);
843  sal_uInt16 i;
844  for (i=0; i<nCount; i++)
845  pNew[i] = ScArea( pAry[i].Sheet,
846  static_cast<SCCOL>(pAry[i].StartColumn), pAry[i].StartRow,
847  static_cast<SCCOL>(pAry[i].EndColumn), pAry[i].EndRow );
848 
849  aParam.SetAreas( std::move(pNew), nCount ); // copy everything
850  }
851  else
853 }
854 
856 {
857  SolarMutexGuard aGuard;
858  table::CellAddress aPos;
859  aPos.Column = aParam.nCol;
860  aPos.Row = aParam.nRow;
861  aPos.Sheet = aParam.nTab;
862  return aPos;
863 }
864 
866  const table::CellAddress& aStartOutputPosition )
867 {
868  SolarMutexGuard aGuard;
869  aParam.nCol = static_cast<SCCOL>(aStartOutputPosition.Column);
870  aParam.nRow = static_cast<SCROW>(aStartOutputPosition.Row);
871  aParam.nTab = aStartOutputPosition.Sheet;
872 }
873 
875 {
876  SolarMutexGuard aGuard;
877  return aParam.bByCol;
878 }
879 
881 {
882  SolarMutexGuard aGuard;
883  aParam.bByCol = bUseColumnHeaders;
884 }
885 
887 {
888  SolarMutexGuard aGuard;
889  return aParam.bByRow;
890 }
891 
893 {
894  SolarMutexGuard aGuard;
895  aParam.bByRow = bUseRowHeaders;
896 }
897 
899 {
900  SolarMutexGuard aGuard;
901  return aParam.bReferenceData;
902 }
903 
905 {
906  SolarMutexGuard aGuard;
907  aParam.bReferenceData = bInsertLinks;
908 }
909 
911  aPropSet( lcl_GetFilterPropertyMap() ),
912  pDocSh(pDocShell)
913 {
914  if (pDocSh)
915  pDocSh->GetDocument().AddUnoObject(*this);
916 }
917 
919 {
920  SolarMutexGuard g;
921 
922  if (pDocSh)
924 }
925 
927 {
928  if ( rHint.GetId() == SfxHintId::Dying )
929  {
930  pDocSh = nullptr; // invalid
931  }
932 }
933 
934 // XSheetFilterDescriptor and XSheetFilterDescriptor2
935 
936 uno::Sequence<sheet::TableFilterField> SAL_CALL ScFilterDescriptorBase::getFilterFields()
937 {
938  SolarMutexGuard aGuard;
939  ScQueryParam aParam;
940  GetData(aParam);
941 
942  SCSIZE nEntries = aParam.GetEntryCount(); // allocated entries in Param
943  SCSIZE nCount = 0; // active
944  while ( nCount < nEntries &&
945  aParam.GetEntry(nCount).bDoQuery )
946  ++nCount;
947 
948  sheet::TableFilterField aField;
949  uno::Sequence<sheet::TableFilterField> aSeq(static_cast<sal_Int32>(nCount));
950  sheet::TableFilterField* pAry = aSeq.getArray();
951  for (SCSIZE i=0; i<nCount; i++)
952  {
953  const ScQueryEntry& rEntry = aParam.GetEntry(i);
954  if (rEntry.GetQueryItems().empty())
955  continue;
956 
957  const ScQueryEntry::Item& rItem = rEntry.GetQueryItems().front();
958 
959  aField.Connection = (rEntry.eConnect == SC_AND) ? sheet::FilterConnection_AND :
960  sheet::FilterConnection_OR;
961  aField.Field = rEntry.nField;
962  aField.IsNumeric = rItem.meType != ScQueryEntry::ByString;
963  aField.StringValue = rItem.maString.getString();
964  aField.NumericValue = rItem.mfVal;
965 
966  switch (rEntry.eOp) // ScQueryOp
967  {
968  case SC_EQUAL:
969  {
970  aField.Operator = sheet::FilterOperator_EQUAL;
971  if (rEntry.IsQueryByEmpty())
972  {
973  aField.Operator = sheet::FilterOperator_EMPTY;
974  aField.NumericValue = 0;
975  }
976  else if (rEntry.IsQueryByNonEmpty())
977  {
978  aField.Operator = sheet::FilterOperator_NOT_EMPTY;
979  aField.NumericValue = 0;
980  }
981  }
982  break;
983  case SC_LESS: aField.Operator = sheet::FilterOperator_LESS; break;
984  case SC_GREATER: aField.Operator = sheet::FilterOperator_GREATER; break;
985  case SC_LESS_EQUAL: aField.Operator = sheet::FilterOperator_LESS_EQUAL; break;
986  case SC_GREATER_EQUAL: aField.Operator = sheet::FilterOperator_GREATER_EQUAL; break;
987  case SC_NOT_EQUAL: aField.Operator = sheet::FilterOperator_NOT_EQUAL; break;
988  case SC_TOPVAL: aField.Operator = sheet::FilterOperator_TOP_VALUES; break;
989  case SC_BOTVAL: aField.Operator = sheet::FilterOperator_BOTTOM_VALUES; break;
990  case SC_TOPPERC: aField.Operator = sheet::FilterOperator_TOP_PERCENT; break;
991  case SC_BOTPERC: aField.Operator = sheet::FilterOperator_BOTTOM_PERCENT; break;
992  default:
993  OSL_FAIL("wrong filter enum");
994  aField.Operator = sheet::FilterOperator_EMPTY;
995  }
996  pAry[i] = aField;
997  }
998  return aSeq;
999 }
1000 
1001 namespace {
1002 
1003 template<typename T>
1004 void convertQueryEntryToUno(const ScQueryEntry& rEntry, T& rField)
1005 {
1006  rField.Connection = (rEntry.eConnect == SC_AND) ? sheet::FilterConnection_AND : sheet::FilterConnection_OR;
1007  rField.Field = rEntry.nField;
1008 
1009  switch (rEntry.eOp) // ScQueryOp
1010  {
1011  case SC_EQUAL: rField.Operator = sheet::FilterOperator2::EQUAL; break;
1012  case SC_LESS: rField.Operator = sheet::FilterOperator2::LESS; break;
1013  case SC_GREATER: rField.Operator = sheet::FilterOperator2::GREATER; break;
1014  case SC_LESS_EQUAL: rField.Operator = sheet::FilterOperator2::LESS_EQUAL; break;
1015  case SC_GREATER_EQUAL: rField.Operator = sheet::FilterOperator2::GREATER_EQUAL; break;
1016  case SC_NOT_EQUAL: rField.Operator = sheet::FilterOperator2::NOT_EQUAL; break;
1017  case SC_TOPVAL: rField.Operator = sheet::FilterOperator2::TOP_VALUES; break;
1018  case SC_BOTVAL: rField.Operator = sheet::FilterOperator2::BOTTOM_VALUES; break;
1019  case SC_TOPPERC: rField.Operator = sheet::FilterOperator2::TOP_PERCENT; break;
1020  case SC_BOTPERC: rField.Operator = sheet::FilterOperator2::BOTTOM_PERCENT; break;
1021  case SC_CONTAINS: rField.Operator = sheet::FilterOperator2::CONTAINS; break;
1022  case SC_DOES_NOT_CONTAIN: rField.Operator = sheet::FilterOperator2::DOES_NOT_CONTAIN; break;
1023  case SC_BEGINS_WITH: rField.Operator = sheet::FilterOperator2::BEGINS_WITH; break;
1024  case SC_DOES_NOT_BEGIN_WITH: rField.Operator = sheet::FilterOperator2::DOES_NOT_BEGIN_WITH; break;
1025  case SC_ENDS_WITH: rField.Operator = sheet::FilterOperator2::ENDS_WITH; break;
1026  case SC_DOES_NOT_END_WITH: rField.Operator = sheet::FilterOperator2::DOES_NOT_END_WITH; break;
1027  default:
1028  OSL_FAIL("Unknown filter operator value.");
1029  rField.Operator = sheet::FilterOperator2::EMPTY;
1030  }
1031 }
1032 
1033 template<typename T>
1034 void convertUnoToQueryEntry(const T& rField, ScQueryEntry& rEntry)
1035 {
1036  rEntry.bDoQuery = true;
1037  rEntry.eConnect = (rField.Connection == sheet::FilterConnection_AND) ? SC_AND : SC_OR;
1038  rEntry.nField = rField.Field;
1039 
1040  switch (rField.Operator) // FilterOperator
1041  {
1042  case sheet::FilterOperator2::EQUAL: rEntry.eOp = SC_EQUAL; break;
1043  case sheet::FilterOperator2::LESS: rEntry.eOp = SC_LESS; break;
1044  case sheet::FilterOperator2::GREATER: rEntry.eOp = SC_GREATER; break;
1045  case sheet::FilterOperator2::LESS_EQUAL: rEntry.eOp = SC_LESS_EQUAL; break;
1046  case sheet::FilterOperator2::GREATER_EQUAL: rEntry.eOp = SC_GREATER_EQUAL; break;
1047  case sheet::FilterOperator2::NOT_EQUAL: rEntry.eOp = SC_NOT_EQUAL; break;
1048  case sheet::FilterOperator2::TOP_VALUES: rEntry.eOp = SC_TOPVAL; break;
1049  case sheet::FilterOperator2::BOTTOM_VALUES: rEntry.eOp = SC_BOTVAL; break;
1050  case sheet::FilterOperator2::TOP_PERCENT: rEntry.eOp = SC_TOPPERC; break;
1051  case sheet::FilterOperator2::BOTTOM_PERCENT: rEntry.eOp = SC_BOTPERC; break;
1052  case sheet::FilterOperator2::CONTAINS: rEntry.eOp = SC_CONTAINS; break;
1053  case sheet::FilterOperator2::DOES_NOT_CONTAIN: rEntry.eOp = SC_DOES_NOT_CONTAIN; break;
1054  case sheet::FilterOperator2::BEGINS_WITH: rEntry.eOp = SC_BEGINS_WITH; break;
1055  case sheet::FilterOperator2::DOES_NOT_BEGIN_WITH: rEntry.eOp = SC_DOES_NOT_BEGIN_WITH;break;
1056  case sheet::FilterOperator2::ENDS_WITH: rEntry.eOp = SC_ENDS_WITH; break;
1057  case sheet::FilterOperator2::DOES_NOT_END_WITH: rEntry.eOp = SC_DOES_NOT_END_WITH; break;
1058  case sheet::FilterOperator2::EMPTY:
1059  rEntry.SetQueryByEmpty();
1060  break;
1061  case sheet::FilterOperator2::NOT_EMPTY:
1062  rEntry.SetQueryByNonEmpty();
1063  break;
1064  default:
1065  OSL_FAIL("Unknown filter operator type.");
1066  rEntry.eOp = SC_EQUAL;
1067  }
1068 }
1069 
1070 void fillQueryParam(
1071  ScQueryParam& rParam, ScDocument* pDoc,
1072  const uno::Sequence<sheet::TableFilterField2>& aFilterFields)
1073 {
1074  size_t nCount = static_cast<size_t>(aFilterFields.getLength());
1075  rParam.Resize(nCount);
1076 
1077  const sheet::TableFilterField2* pAry = aFilterFields.getConstArray();
1078  svl::SharedStringPool& rPool = pDoc->GetSharedStringPool();
1079  for (size_t i = 0; i < nCount; ++i)
1080  {
1081  ScQueryEntry& rEntry = rParam.GetEntry(i);
1082  convertUnoToQueryEntry(pAry[i], rEntry);
1083 
1084  if (pAry[i].Operator != sheet::FilterOperator2::EMPTY && pAry[i].Operator != sheet::FilterOperator2::NOT_EMPTY)
1085  {
1086  ScQueryEntry::QueryItemsType& rItems = rEntry.GetQueryItems();
1087  rItems.resize(1);
1088  ScQueryEntry::Item& rItem = rItems.front();
1089  rItem.meType = pAry[i].IsNumeric ? ScQueryEntry::ByValue : ScQueryEntry::ByString;
1090  rItem.mfVal = pAry[i].NumericValue;
1091  rItem.maString = rPool.intern(pAry[i].StringValue);
1092 
1093  if (rItem.meType == ScQueryEntry::ByValue)
1094  {
1095  OUString aStr;
1096  pDoc->GetFormatTable()->GetInputLineString(rItem.mfVal, 0, aStr);
1097  rItem.maString = rPool.intern(aStr);
1098  }
1099  }
1100  }
1101 
1102  size_t nParamCount = rParam.GetEntryCount(); // if below eight Param isn't resized
1103  for (size_t i = nCount; i < nParamCount; ++i)
1104  rParam.GetEntry(i).bDoQuery = false; // reset surplus fields
1105 }
1106 
1107 void fillQueryParam(
1108  ScQueryParam& rParam, ScDocument* pDoc,
1109  const uno::Sequence<sheet::TableFilterField3>& aFilterFields)
1110 {
1111  size_t nCount = static_cast<size_t>(aFilterFields.getLength());
1112  rParam.Resize(nCount);
1113 
1114  svl::SharedStringPool& rPool = pDoc->GetSharedStringPool();
1115  const sheet::TableFilterField3* pAry = aFilterFields.getConstArray();
1116  for (size_t i = 0; i < nCount; ++i)
1117  {
1118  ScQueryEntry& rEntry = rParam.GetEntry(i);
1119  convertUnoToQueryEntry(pAry[i], rEntry);
1120 
1121  if (pAry[i].Operator != sheet::FilterOperator2::EMPTY && pAry[i].Operator != sheet::FilterOperator2::NOT_EMPTY)
1122  {
1123  ScQueryEntry::QueryItemsType& rItems = rEntry.GetQueryItems();
1124  rItems.clear();
1125  const uno::Sequence<sheet::FilterFieldValue>& rVals = pAry[i].Values;
1126  for (const auto& rVal : rVals)
1127  {
1128  ScQueryEntry::Item aItem;
1129  switch (rVal.FilterType)
1130  {
1131  case FilterFieldType::NUMERIC:
1132  aItem.meType = ScQueryEntry::ByValue;
1133  break;
1134  case FilterFieldType::STRING:
1136  break;
1137  case FilterFieldType::DATE:
1138  aItem.meType = ScQueryEntry::ByDate;
1139  break;
1140  case FilterFieldType::TEXT_COLOR:
1142  break;
1143  case FilterFieldType::BACKGROUND_COLOR:
1145  break;
1146  }
1147  aItem.mfVal = rVal.NumericValue;
1148  aItem.maString = rPool.intern(rVal.StringValue);
1149 
1150  if (aItem.meType == ScQueryEntry::ByValue)
1151  {
1152  OUString aStr;
1153  pDoc->GetFormatTable()->GetInputLineString(aItem.mfVal, 0, aStr);
1154  aItem.maString = rPool.intern(aStr);
1155  }
1156  else if (aItem.meType == ScQueryEntry::ByTextColor
1158  {
1159  aItem.maColor = Color(ColorTransparency, rVal.ColorValue);
1160  }
1161 
1162  // filter all dates starting with the given date filter YYYY or YYYY-MM and filter all datetimes
1163  // starting with the given datetime filter YYYY-MM-DD, YYYY-MM-DD HH, or YYYY-MM-DD HH:MM
1164  if( aItem.meType == ScQueryEntry::ByDate && aItem.maString.getLength() < 19 )
1165  {
1166  ScFilterEntries aFilterEntries;
1167  pDoc->GetFilterEntries(rEntry.nField, rParam.nRow1, rParam.nTab, aFilterEntries);
1168  for( const auto& rFilter : aFilterEntries )
1169  {
1170  if( rFilter.GetString().startsWith(rVal.StringValue) )
1171  {
1172  aItem.maString = rPool.intern(rFilter.GetString());
1173  rItems.push_back(aItem);
1174  }
1175  }
1176  }
1177  else
1178  {
1179  rItems.push_back(aItem);
1180  }
1181  }
1182  }
1183  }
1184 
1185  size_t nParamCount = rParam.GetEntryCount(); // if below eight Param isn't resized
1186  for (size_t i = nCount; i < nParamCount; ++i)
1187  rParam.GetEntry(i).bDoQuery = false; // reset surplus fields
1188 }
1189 
1190 }
1191 
1192 uno::Sequence<sheet::TableFilterField2> SAL_CALL ScFilterDescriptorBase::getFilterFields2()
1193 {
1194  SolarMutexGuard aGuard;
1195  ScQueryParam aParam;
1196  GetData(aParam);
1197 
1198  SCSIZE nEntries = aParam.GetEntryCount(); // allocated entries in Param
1199  SCSIZE nCount = 0; // active
1200  while ( nCount < nEntries &&
1201  aParam.GetEntry(nCount).bDoQuery )
1202  ++nCount;
1203 
1204  sheet::TableFilterField2 aField;
1205  uno::Sequence<sheet::TableFilterField2> aSeq(static_cast<sal_Int32>(nCount));
1206  sheet::TableFilterField2* pAry = aSeq.getArray();
1207  for (SCSIZE i=0; i<nCount; i++)
1208  {
1209  const ScQueryEntry& rEntry = aParam.GetEntry(i);
1210  convertQueryEntryToUno(rEntry, aField);
1211 
1212  bool bByEmpty = false;
1213  if (aField.Operator == sheet::FilterOperator2::EQUAL)
1214  {
1215  if (rEntry.IsQueryByEmpty())
1216  {
1217  aField.Operator = sheet::FilterOperator2::EMPTY;
1218  aField.NumericValue = 0;
1219  bByEmpty = true;
1220  }
1221  else if (rEntry.IsQueryByNonEmpty())
1222  {
1223  aField.Operator = sheet::FilterOperator2::NOT_EMPTY;
1224  aField.NumericValue = 0;
1225  bByEmpty = true;
1226  }
1227  }
1228 
1229  if (!bByEmpty && !rEntry.GetQueryItems().empty())
1230  {
1231  const ScQueryEntry::Item& rItem = rEntry.GetQueryItems().front();
1232  aField.IsNumeric = rItem.meType != ScQueryEntry::ByString;
1233  aField.StringValue = rItem.maString.getString();
1234  aField.NumericValue = rItem.mfVal;
1235  }
1236 
1237  pAry[i] = aField;
1238  }
1239  return aSeq;
1240 }
1241 
1242 uno::Sequence<sheet::TableFilterField3> SAL_CALL ScFilterDescriptorBase::getFilterFields3()
1243 {
1244  SolarMutexGuard aGuard;
1245  ScQueryParam aParam;
1246  GetData(aParam);
1247 
1248  SCSIZE nEntries = aParam.GetEntryCount(); // allocated entries in Param
1249  SCSIZE nCount = 0; // active
1250  while ( nCount < nEntries &&
1251  aParam.GetEntry(nCount).bDoQuery )
1252  ++nCount;
1253 
1254  sheet::TableFilterField3 aField;
1255  uno::Sequence<sheet::TableFilterField3> aSeq(static_cast<sal_Int32>(nCount));
1256  sheet::TableFilterField3* pAry = aSeq.getArray();
1257  for (SCSIZE i = 0; i < nCount; ++i)
1258  {
1259  const ScQueryEntry& rEntry = aParam.GetEntry(i);
1260  convertQueryEntryToUno(rEntry, aField);
1261 
1262  bool bByEmpty = false;
1263  if (aField.Operator == sheet::FilterOperator2::EQUAL)
1264  {
1265  if (rEntry.IsQueryByEmpty())
1266  {
1267  aField.Operator = sheet::FilterOperator2::EMPTY;
1268  aField.Values.realloc(1);
1269  aField.Values.getArray()[0].NumericValue = 0;
1270  bByEmpty = true;
1271  }
1272  else if (rEntry.IsQueryByNonEmpty())
1273  {
1274  aField.Operator = sheet::FilterOperator2::NOT_EMPTY;
1275  aField.Values.realloc(1);
1276  aField.Values.getArray()[0].NumericValue = 0;
1277  bByEmpty = true;
1278  }
1279  }
1280 
1281  if (!bByEmpty)
1282  {
1283  const ScQueryEntry::QueryItemsType& rItems = rEntry.GetQueryItems();
1284  size_t nItemCount = rItems.size();
1285  aField.Values.realloc(nItemCount);
1286  auto pValues = aField.Values.getArray();
1287  size_t j = 0;
1288  for (const auto& rItem : rItems)
1289  {
1290  pValues[j].IsNumeric = rItem.meType != ScQueryEntry::ByString;
1291  pValues[j].StringValue = rItem.maString.getString();
1292  pValues[j].NumericValue = rItem.mfVal;
1293  ++j;
1294  }
1295  }
1296 
1297  pAry[i] = aField;
1298  }
1299  return aSeq;
1300 }
1301 
1303  const uno::Sequence<sheet::TableFilterField>& aFilterFields )
1304 {
1305  SolarMutexGuard aGuard;
1306  ScQueryParam aParam;
1307  GetData(aParam);
1308 
1309  SCSIZE nCount = static_cast<SCSIZE>(aFilterFields.getLength());
1310  aParam.Resize( nCount );
1311 
1312  ScDocument& rDoc = pDocSh->GetDocument();
1314  const sheet::TableFilterField* pAry = aFilterFields.getConstArray();
1315  SCSIZE i;
1316  for (i=0; i<nCount; i++)
1317  {
1318  ScQueryEntry& rEntry = aParam.GetEntry(i);
1319  ScQueryEntry::QueryItemsType& rItems = rEntry.GetQueryItems();
1320  rItems.resize(1);
1321  ScQueryEntry::Item& rItem = rItems.front();
1322  rEntry.bDoQuery = true;
1323  rEntry.eConnect = (pAry[i].Connection == sheet::FilterConnection_AND) ? SC_AND : SC_OR;
1324  rEntry.nField = pAry[i].Field;
1325  rItem.meType = pAry[i].IsNumeric ? ScQueryEntry::ByValue : ScQueryEntry::ByString;
1326  rItem.mfVal = pAry[i].NumericValue;
1327  rItem.maString = rPool.intern(pAry[i].StringValue);
1328 
1329  if (rItem.meType != ScQueryEntry::ByString)
1330  {
1331  OUString aStr;
1332  rDoc.GetFormatTable()->GetInputLineString(rItem.mfVal, 0, aStr);
1333  rItem.maString = rPool.intern(aStr);
1334  }
1335 
1336  switch (pAry[i].Operator) // FilterOperator
1337  {
1338  case sheet::FilterOperator_EQUAL: rEntry.eOp = SC_EQUAL; break;
1339  case sheet::FilterOperator_LESS: rEntry.eOp = SC_LESS; break;
1340  case sheet::FilterOperator_GREATER: rEntry.eOp = SC_GREATER; break;
1341  case sheet::FilterOperator_LESS_EQUAL: rEntry.eOp = SC_LESS_EQUAL; break;
1342  case sheet::FilterOperator_GREATER_EQUAL: rEntry.eOp = SC_GREATER_EQUAL; break;
1343  case sheet::FilterOperator_NOT_EQUAL: rEntry.eOp = SC_NOT_EQUAL; break;
1344  case sheet::FilterOperator_TOP_VALUES: rEntry.eOp = SC_TOPVAL; break;
1345  case sheet::FilterOperator_BOTTOM_VALUES: rEntry.eOp = SC_BOTVAL; break;
1346  case sheet::FilterOperator_TOP_PERCENT: rEntry.eOp = SC_TOPPERC; break;
1347  case sheet::FilterOperator_BOTTOM_PERCENT: rEntry.eOp = SC_BOTPERC; break;
1348  case sheet::FilterOperator_EMPTY:
1349  rEntry.SetQueryByEmpty();
1350  break;
1351  case sheet::FilterOperator_NOT_EMPTY:
1352  rEntry.SetQueryByNonEmpty();
1353  break;
1354  default:
1355  OSL_FAIL("Wrong query enum");
1356  rEntry.eOp = SC_EQUAL;
1357  }
1358  }
1359 
1360  SCSIZE nParamCount = aParam.GetEntryCount(); // if below eight Param isn't resized
1361  for (i=nCount; i<nParamCount; i++)
1362  aParam.GetEntry(i).bDoQuery = false; // reset surplus fields
1363 
1364  PutData(aParam);
1365 }
1366 
1368  const uno::Sequence<sheet::TableFilterField2>& aFilterFields )
1369 {
1370  SolarMutexGuard aGuard;
1371  ScQueryParam aParam;
1372  GetData(aParam);
1373  fillQueryParam(aParam, &pDocSh->GetDocument(), aFilterFields);
1374  PutData(aParam);
1375 }
1376 
1378  const uno::Sequence<sheet::TableFilterField3>& aFilterFields )
1379 {
1380  SolarMutexGuard aGuard;
1381  ScQueryParam aParam;
1382  GetData(aParam);
1383  fillQueryParam(aParam, &pDocSh->GetDocument(), aFilterFields);
1384  PutData(aParam);
1385 }
1386 
1387 // Rest sind Properties
1388 
1389 // XPropertySet
1390 
1391 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScFilterDescriptorBase::getPropertySetInfo()
1392 {
1393  SolarMutexGuard aGuard;
1394  static uno::Reference<beans::XPropertySetInfo> aRef(
1396  return aRef;
1397 }
1398 
1400  const OUString& aPropertyName, const uno::Any& aValue )
1401 {
1402  SolarMutexGuard aGuard;
1403  ScQueryParam aParam;
1404  GetData(aParam);
1405 
1406  if (aPropertyName == SC_UNONAME_CONTHDR)
1408  else if (aPropertyName == SC_UNONAME_COPYOUT)
1409  aParam.bInplace = !(ScUnoHelpFunctions::GetBoolFromAny( aValue ));
1410  else if (aPropertyName == SC_UNONAME_ISCASE)
1411  aParam.bCaseSens = ScUnoHelpFunctions::GetBoolFromAny( aValue );
1412  else if (aPropertyName == SC_UNONAME_MAXFLD)
1413  {
1414  // silently ignored
1415  }
1416  else if (aPropertyName == SC_UNONAME_ORIENT)
1417  {
1419  table::TableOrientation eOrient = static_cast<table::TableOrientation>(ScUnoHelpFunctions::GetEnumFromAny( aValue ));
1420  aParam.bByRow = ( eOrient != table::TableOrientation_COLUMNS );
1421  }
1422  else if (aPropertyName == SC_UNONAME_OUTPOS)
1423  {
1424  table::CellAddress aAddress;
1425  if ( aValue >>= aAddress )
1426  {
1427  aParam.nDestTab = aAddress.Sheet;
1428  aParam.nDestCol = static_cast<SCCOL>(aAddress.Column);
1429  aParam.nDestRow = static_cast<SCROW>(aAddress.Row);
1430  }
1431  }
1432  else if (aPropertyName == SC_UNONAME_SAVEOUT)
1433  aParam.bDestPers = ScUnoHelpFunctions::GetBoolFromAny( aValue );
1434  else if (aPropertyName == SC_UNONAME_SKIPDUP)
1435  aParam.bDuplicate = !(ScUnoHelpFunctions::GetBoolFromAny( aValue ));
1436  else if (aPropertyName == SC_UNONAME_USEREGEX)
1439 
1440  PutData(aParam);
1441 }
1442 
1443 uno::Any SAL_CALL ScFilterDescriptorBase::getPropertyValue( const OUString& aPropertyName )
1444 {
1445  SolarMutexGuard aGuard;
1446  ScQueryParam aParam;
1447  GetData(aParam);
1448 
1449  uno::Any aRet;
1450 
1451  if (aPropertyName == SC_UNONAME_CONTHDR )
1452  aRet <<= aParam.bHasHeader;
1453  else if (aPropertyName == SC_UNONAME_COPYOUT )
1454  aRet <<= !(aParam.bInplace);
1455  else if (aPropertyName == SC_UNONAME_ISCASE )
1456  aRet <<= aParam.bCaseSens;
1457  else if (aPropertyName == SC_UNONAME_MAXFLD )
1458  aRet <<= static_cast<sal_Int32>(aParam.GetEntryCount());
1459  else if (aPropertyName == SC_UNONAME_ORIENT )
1460  {
1461  table::TableOrientation eOrient = aParam.bByRow ? table::TableOrientation_ROWS :
1462  table::TableOrientation_COLUMNS;
1463  aRet <<= eOrient;
1464  }
1465  else if (aPropertyName == SC_UNONAME_OUTPOS )
1466  {
1467  table::CellAddress aOutPos;
1468  aOutPos.Sheet = aParam.nDestTab;
1469  aOutPos.Column = aParam.nDestCol;
1470  aOutPos.Row = aParam.nDestRow;
1471  aRet <<= aOutPos;
1472  }
1473  else if (aPropertyName == SC_UNONAME_SAVEOUT )
1474  aRet <<= aParam.bDestPers;
1475  else if (aPropertyName == SC_UNONAME_SKIPDUP )
1476  aRet <<= !(aParam.bDuplicate);
1477  else if (aPropertyName == SC_UNONAME_USEREGEX )
1479 
1480  return aRet;
1481 }
1482 
1484 
1486  :
1487  ScFilterDescriptorBase(pDocShell)
1488 {
1489 }
1490 
1492 {
1493 }
1494 
1496 {
1497  rParam = aStoredParam; // query for interface
1498 }
1499 
1501 {
1502  aStoredParam = rParam; // set by the interface
1503 }
1504 
1506 {
1507  aStoredParam = rNew; // set from outside
1508 }
1509 
1511  ScFilterDescriptorBase(pDocShell),
1512  mxParent(pPar)
1513 {
1514 }
1515 
1517 {
1518 }
1519 
1521 {
1522  if (mxParent.is())
1523  mxParent->GetQueryParam( rParam );
1524 }
1525 
1527 {
1528  if (mxParent.is())
1529  mxParent->SetQueryParam( rParam );
1530 }
1531 
1533  ScFilterDescriptorBase(pDocShell),
1534  mxParent(pPar)
1535 {
1536 }
1537 
1539 {
1540 }
1541 
1543 {
1544  if (mxParent.is())
1545  {
1546  ScDPObject* pDPObj = mxParent->GetDPObject();
1547  if (pDPObj && pDPObj->IsSheetData())
1548  rParam = pDPObj->GetSheetDesc()->GetQueryParam();
1549  }
1550 }
1551 
1553 {
1554  if (!mxParent.is())
1555  return;
1556 
1557  ScDPObject* pDPObj = mxParent->GetDPObject();
1558  if (pDPObj)
1559  {
1560  ScSheetSourceDesc aSheetDesc(&mxParent->GetDocShell()->GetDocument());
1561  if (pDPObj->IsSheetData())
1562  aSheetDesc = *pDPObj->GetSheetDesc();
1563  aSheetDesc.SetQueryParam(rParam);
1564  pDPObj->SetSheetDesc(aSheetDesc);
1565  mxParent->SetDPObject(pDPObj);
1566  }
1567 }
1568 
1570  pDocShell( pDocSh ),
1571  aName( rNm ),
1572  aPropSet( lcl_GetDBRangePropertyMap() ),
1573  bIsUnnamed(false),
1574  aTab( 0 )
1575 {
1577 }
1578 
1580  pDocShell( pDocSh ),
1582  aPropSet( lcl_GetDBRangePropertyMap() ),
1583  bIsUnnamed(true),
1584  aTab( nTab )
1585 {
1587 }
1588 
1590 {
1591  SolarMutexGuard g;
1592 
1593  if (pDocShell)
1595 }
1596 
1598 {
1599 
1600  if ( rHint.GetId() == SfxHintId::Dying )
1601  pDocShell = nullptr;
1602  else if ( auto pRefreshHint = dynamic_cast<const ScDBRangeRefreshedHint*>(&rHint) )
1603  {
1604  ScDBData* pDBData = GetDBData_Impl();
1605  ScImportParam aParam;
1606  pDBData->GetImportParam(aParam);
1607  if (aParam == pRefreshHint->GetImportParam())
1608  Refreshed_Impl();
1609  }
1610 }
1611 
1612 // Help functions
1613 
1615 {
1616  ScDBData* pRet = nullptr;
1617  if (pDocShell)
1618  {
1619  if (bIsUnnamed)
1620  {
1622  }
1623  else
1624  {
1626  if (pNames)
1627  {
1629  if (p)
1630  pRet = p;
1631  }
1632  }
1633  }
1634  return pRet;
1635 }
1636 
1637 // XNamed
1638 
1639 OUString SAL_CALL ScDatabaseRangeObj::getName()
1640 {
1641  SolarMutexGuard aGuard;
1642  return aName;
1643 }
1644 
1645 void SAL_CALL ScDatabaseRangeObj::setName( const OUString& aNewName )
1646 {
1647  SolarMutexGuard aGuard;
1648  if (pDocShell)
1649  {
1650  ScDBDocFunc aFunc(*pDocShell);
1651  bool bOk = aFunc.RenameDBRange( aName, aNewName );
1652  if (bOk)
1653  aName = aNewName;
1654  }
1655 }
1656 
1657 // XDatabaseRange
1658 
1659 table::CellRangeAddress SAL_CALL ScDatabaseRangeObj::getDataArea()
1660 {
1661  SolarMutexGuard aGuard;
1662  table::CellRangeAddress aAddress;
1664  if (pData)
1665  {
1666  ScRange aRange;
1667  pData->GetArea(aRange);
1668  aAddress.Sheet = aRange.aStart.Tab();
1669  aAddress.StartColumn = aRange.aStart.Col();
1670  aAddress.StartRow = aRange.aStart.Row();
1671  aAddress.EndColumn = aRange.aEnd.Col();
1672  aAddress.EndRow = aRange.aEnd.Row();
1673  }
1674  return aAddress;
1675 }
1676 
1677 void SAL_CALL ScDatabaseRangeObj::setDataArea( const table::CellRangeAddress& aDataArea )
1678 {
1679  SolarMutexGuard aGuard;
1681  if ( pDocShell && pData )
1682  {
1683  ScDBData aNewData( *pData );
1685  aNewData.SetArea( aDataArea.Sheet, static_cast<SCCOL>(aDataArea.StartColumn), static_cast<SCROW>(aDataArea.StartRow),
1686  static_cast<SCCOL>(aDataArea.EndColumn), static_cast<SCROW>(aDataArea.EndRow) );
1687  ScDBDocFunc aFunc(*pDocShell);
1688  aFunc.ModifyDBData(aNewData);
1689  }
1690 }
1691 
1692 uno::Sequence<beans::PropertyValue> SAL_CALL ScDatabaseRangeObj::getSortDescriptor()
1693 {
1694  SolarMutexGuard aGuard;
1695  ScSortParam aParam;
1696  const ScDBData* pData = GetDBData_Impl();
1697  if (pData)
1698  {
1699  pData->GetSortParam(aParam);
1700 
1701  // SortDescriptor contains the counted fields inside the area
1702  ScRange aDBRange;
1703  pData->GetArea(aDBRange);
1704  SCCOLROW nFieldStart = aParam.bByRow ? static_cast<SCCOLROW>(aDBRange.aStart.Col()) : static_cast<SCCOLROW>(aDBRange.aStart.Row());
1705  for (sal_uInt16 i=0; i<aParam.GetSortKeyCount(); i++)
1706  if ( aParam.maKeyState[i].bDoSort && aParam.maKeyState[i].nField >= nFieldStart )
1707  aParam.maKeyState[i].nField -= nFieldStart;
1708  }
1709 
1710  uno::Sequence<beans::PropertyValue> aSeq( ScSortDescriptor::GetPropertyCount() );
1711  ScSortDescriptor::FillProperties( aSeq, aParam );
1712  return aSeq;
1713 }
1714 
1716 {
1717  const ScDBData* pData = GetDBData_Impl();
1718  if (!pData)
1719  return;
1720 
1721  pData->GetQueryParam(rQueryParam);
1722 
1723  // FilterDescriptor contains the counted fields inside the area
1724  ScRange aDBRange;
1725  pData->GetArea(aDBRange);
1726  SCCOLROW nFieldStart = rQueryParam.bByRow ? static_cast<SCCOLROW>(aDBRange.aStart.Col()) : static_cast<SCCOLROW>(aDBRange.aStart.Row());
1727  SCSIZE nCount = rQueryParam.GetEntryCount();
1728  for (SCSIZE i=0; i<nCount; i++)
1729  {
1730  ScQueryEntry& rEntry = rQueryParam.GetEntry(i);
1731  if (rEntry.bDoQuery && rEntry.nField >= nFieldStart)
1732  rEntry.nField -= nFieldStart;
1733  }
1734 }
1735 
1737 {
1738  const ScDBData* pData = GetDBData_Impl();
1739  if (!pData)
1740  return;
1741 
1742  // FilterDescriptor contains the counted fields inside the area
1743  ScQueryParam aParam(rQueryParam);
1744  ScRange aDBRange;
1745  pData->GetArea(aDBRange);
1746  SCCOLROW nFieldStart = aParam.bByRow ? static_cast<SCCOLROW>(aDBRange.aStart.Col()) : static_cast<SCCOLROW>(aDBRange.aStart.Row());
1747 
1748  SCSIZE nCount = aParam.GetEntryCount();
1749  for (SCSIZE i=0; i<nCount; i++)
1750  {
1751  ScQueryEntry& rEntry = aParam.GetEntry(i);
1752  if (rEntry.bDoQuery)
1753  rEntry.nField += nFieldStart;
1754  }
1755 
1756  ScDBData aNewData( *pData );
1757  aNewData.SetQueryParam(aParam);
1758  aNewData.SetHeader(aParam.bHasHeader); // not in ScDBData::SetQueryParam
1759  ScDBDocFunc aFunc(*pDocShell);
1760  aFunc.ModifyDBData(aNewData);
1761 }
1762 
1763 uno::Reference<sheet::XSheetFilterDescriptor> SAL_CALL ScDatabaseRangeObj::getFilterDescriptor()
1764 {
1765  SolarMutexGuard aGuard;
1766  return new ScRangeFilterDescriptor(pDocShell, this);
1767 }
1768 
1770 {
1771  const ScDBData* pData = GetDBData_Impl();
1772  if (!pData)
1773  return;
1774 
1775  pData->GetSubTotalParam(rSubTotalParam);
1776 
1777  // FilterDescriptor contains the counted fields inside the area
1778  ScRange aDBRange;
1779  pData->GetArea(aDBRange);
1780  SCCOL nFieldStart = aDBRange.aStart.Col();
1781  for (sal_uInt16 i=0; i<MAXSUBTOTAL; i++)
1782  {
1783  if ( rSubTotalParam.bGroupActive[i] )
1784  {
1785  if ( rSubTotalParam.nField[i] >= nFieldStart )
1786  rSubTotalParam.nField[i] = sal::static_int_cast<SCCOL>( rSubTotalParam.nField[i] - nFieldStart );
1787  for (SCCOL j=0; j<rSubTotalParam.nSubTotals[i]; j++)
1788  if ( rSubTotalParam.pSubTotals[i][j] >= nFieldStart )
1789  rSubTotalParam.pSubTotals[i][j] =
1790  sal::static_int_cast<SCCOL>( rSubTotalParam.pSubTotals[i][j] - nFieldStart );
1791  }
1792  }
1793 }
1794 
1796 {
1797  const ScDBData* pData = GetDBData_Impl();
1798  if (!pData)
1799  return;
1800 
1801  // FilterDescriptor contains the counted fields inside the area
1802  ScSubTotalParam aParam(rSubTotalParam);
1803  ScRange aDBRange;
1804  pData->GetArea(aDBRange);
1805  SCCOL nFieldStart = aDBRange.aStart.Col();
1806  for (sal_uInt16 i=0; i<MAXSUBTOTAL; i++)
1807  {
1808  if ( aParam.bGroupActive[i] )
1809  {
1810  aParam.nField[i] = sal::static_int_cast<SCCOL>( aParam.nField[i] + nFieldStart );
1811  for (SCCOL j=0; j<aParam.nSubTotals[i]; j++)
1812  aParam.pSubTotals[i][j] = sal::static_int_cast<SCCOL>( aParam.pSubTotals[i][j] + nFieldStart );
1813  }
1814  }
1815 
1816  ScDBData aNewData( *pData );
1817  aNewData.SetSubTotalParam(aParam);
1818  ScDBDocFunc aFunc(*pDocShell);
1819  aFunc.ModifyDBData(aNewData);
1820 }
1821 
1822 uno::Reference<sheet::XSubTotalDescriptor> SAL_CALL ScDatabaseRangeObj::getSubTotalDescriptor()
1823 {
1824  SolarMutexGuard aGuard;
1825  return new ScRangeSubTotalDescriptor(this);
1826 }
1827 
1828 uno::Sequence<beans::PropertyValue> SAL_CALL ScDatabaseRangeObj::getImportDescriptor()
1829 {
1830  SolarMutexGuard aGuard;
1831  ScImportParam aParam;
1832  const ScDBData* pData = GetDBData_Impl();
1833  if (pData)
1834  pData->GetImportParam(aParam);
1835 
1836  uno::Sequence<beans::PropertyValue> aSeq( ScImportDescriptor::GetPropertyCount() );
1837  ScImportDescriptor::FillProperties( aSeq, aParam );
1838  return aSeq;
1839 }
1840 
1841 // XRefreshable
1842 
1844 {
1845  SolarMutexGuard aGuard;
1847  if ( !(pDocShell && pData) )
1848  return;
1849 
1850  ScDBDocFunc aFunc(*pDocShell);
1851 
1852  // repeat import?
1853  bool bContinue = true;
1854  ScImportParam aImportParam;
1855  pData->GetImportParam( aImportParam );
1856  if (aImportParam.bImport && !pData->HasImportSelection())
1857  {
1858  SCTAB nTab;
1859  SCCOL nDummyCol;
1860  SCROW nDummyRow;
1861  pData->GetArea( nTab, nDummyCol,nDummyRow,nDummyCol,nDummyRow );
1862  bContinue = aFunc.DoImport( nTab, aImportParam, nullptr );
1863  }
1864 
1865  // if no error then internal operations (sort, query, subtotal)
1866  if (bContinue)
1867  aFunc.RepeatDB( pData->GetName(), true, bIsUnnamed, aTab );
1868 }
1869 
1871  const uno::Reference<util::XRefreshListener >& xListener )
1872 {
1873  SolarMutexGuard aGuard;
1874  aRefreshListeners.emplace_back( xListener );
1875 
1876  // hold one additional ref to keep this object alive as long as there are listeners
1877  if ( aRefreshListeners.size() == 1 )
1878  acquire();
1879 }
1880 
1882  const uno::Reference<util::XRefreshListener >& xListener )
1883 {
1884  SolarMutexGuard aGuard;
1885  sal_uInt16 nCount = aRefreshListeners.size();
1886  for ( sal_uInt16 n=nCount; n--; )
1887  {
1888  uno::Reference<util::XRefreshListener>& rObj = aRefreshListeners[n];
1889  if ( rObj == xListener )
1890  {
1891  aRefreshListeners.erase( aRefreshListeners.begin() + n );
1892  if ( aRefreshListeners.empty() )
1893  release(); // release ref for listeners
1894  break;
1895  }
1896  }
1897 }
1898 
1900 {
1901  lang::EventObject aEvent;
1902  aEvent.Source = static_cast<cppu::OWeakObject*>(this);
1903  for (uno::Reference<util::XRefreshListener> & xRefreshListener : aRefreshListeners)
1904  xRefreshListener->refreshed( aEvent );
1905 }
1906 
1907 // XCellRangeSource
1908 
1909 uno::Reference<table::XCellRange> SAL_CALL ScDatabaseRangeObj::getReferredCells()
1910 {
1911  SolarMutexGuard aGuard;
1913  if ( pData )
1914  {
1916  ScRange aRange;
1917 
1918  pData->GetArea(aRange);
1919  if ( aRange.aStart == aRange.aEnd )
1920  return new ScCellObj( pDocShell, aRange.aStart );
1921  else
1922  return new ScCellRangeObj( pDocShell, aRange );
1923  }
1924  return nullptr;
1925 }
1926 
1927 // XPropertySet
1928 
1929 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDatabaseRangeObj::getPropertySetInfo()
1930 {
1931  SolarMutexGuard aGuard;
1932  static uno::Reference<beans::XPropertySetInfo> aRef(
1934  return aRef;
1935 }
1936 
1938  const OUString& aPropertyName, const uno::Any& aValue )
1939 {
1940  SolarMutexGuard aGuard;
1942  if ( !(pDocShell && pData) )
1943  return;
1944 
1945  ScDBData aNewData( *pData );
1946  bool bDo = true;
1947 
1948  if ( aPropertyName == SC_UNONAME_KEEPFORM )
1949  aNewData.SetKeepFmt( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
1950  else if ( aPropertyName == SC_UNONAME_MOVCELLS )
1951  aNewData.SetDoSize( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
1952  else if ( aPropertyName == SC_UNONAME_STRIPDAT )
1953  aNewData.SetStripData( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
1954  else if (aPropertyName == SC_UNONAME_AUTOFLT )
1955  {
1956  bool bAutoFilter(ScUnoHelpFunctions::GetBoolFromAny( aValue ));
1957  aNewData.SetAutoFilter(bAutoFilter);
1958  ScRange aRange;
1959  aNewData.GetArea(aRange);
1960  ScDocument& rDoc = pDocShell->GetDocument();
1961  if (bAutoFilter)
1962  rDoc.ApplyFlagsTab( aRange.aStart.Col(), aRange.aStart.Row(),
1963  aRange.aEnd.Col(), aRange.aStart.Row(),
1964  aRange.aStart.Tab(), ScMF::Auto );
1965  else if (!bAutoFilter)
1966  rDoc.RemoveFlagsTab(aRange.aStart.Col(), aRange.aStart.Row(),
1967  aRange.aEnd.Col(), aRange.aStart.Row(),
1968  aRange.aStart.Tab(), ScMF::Auto );
1969  ScRange aPaintRange(aRange.aStart, aRange.aEnd);
1970  aPaintRange.aEnd.SetRow(aPaintRange.aStart.Row());
1971  pDocShell->PostPaint(aPaintRange, PaintPartFlags::Grid);
1972  }
1973  else if (aPropertyName == SC_UNONAME_USEFLTCRT )
1974  {
1975  if (ScUnoHelpFunctions::GetBoolFromAny( aValue ))
1976  {
1977  // only here to set bIsAdvanced in ScDBData
1978  ScRange aRange;
1979  (void)aNewData.GetAdvancedQuerySource(aRange);
1980  aNewData.SetAdvancedQuerySource(&aRange);
1981  }
1982  else
1983  aNewData.SetAdvancedQuerySource(nullptr);
1984  }
1985  else if (aPropertyName == SC_UNONAME_FLTCRT )
1986  {
1987  table::CellRangeAddress aRange;
1988  if (aValue >>= aRange)
1989  {
1990  ScRange aCoreRange;
1991  ScUnoConversion::FillScRange(aCoreRange, aRange);
1992 
1993  aNewData.SetAdvancedQuerySource(&aCoreRange);
1994  }
1995  }
1996  else if (aPropertyName == SC_UNONAME_FROMSELECT )
1997  {
1998  aNewData.SetImportSelection(::cppu::any2bool(aValue));
1999  }
2000  else if (aPropertyName == SC_UNONAME_REFPERIOD )
2001  {
2002  sal_Int32 nRefresh = 0;
2003  if (aValue >>= nRefresh)
2004  {
2005  ScDocument& rDoc = pDocShell->GetDocument();
2006  aNewData.SetRefreshDelay(nRefresh);
2007  if (rDoc.GetDBCollection())
2008  {
2009  aNewData.SetRefreshHandler( rDoc.GetDBCollection()->GetRefreshHandler() );
2011  }
2012  }
2013  }
2014  else if (aPropertyName == SC_UNONAME_CONRES )
2015  {
2016  }
2017  else if ( aPropertyName == SC_UNONAME_TOTALSROW )
2018  aNewData.SetTotals( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
2019  else if ( aPropertyName == SC_UNONAME_CONTHDR )
2020  aNewData.SetHeader( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
2021  else
2022  bDo = false;
2023 
2024  if (bDo)
2025  {
2026  ScDBDocFunc aFunc(*pDocShell);
2027  aFunc.ModifyDBData(aNewData);
2028  }
2029 }
2030 
2031 uno::Any SAL_CALL ScDatabaseRangeObj::getPropertyValue( const OUString& aPropertyName )
2032 {
2033  SolarMutexGuard aGuard;
2034  uno::Any aRet;
2036  if ( pData )
2037  {
2038  if ( aPropertyName == SC_UNONAME_KEEPFORM )
2039  aRet <<= pData->IsKeepFmt();
2040  else if ( aPropertyName == SC_UNONAME_MOVCELLS )
2041  aRet <<= pData->IsDoSize();
2042  else if ( aPropertyName == SC_UNONAME_STRIPDAT )
2043  aRet <<= pData->IsStripData();
2044  else if ( aPropertyName == SC_UNONAME_ISUSER )
2045  {
2046  // all database ranges except "unnamed" are user defined
2047  aRet <<= (pData->GetName() != STR_DB_LOCAL_NONAME);
2048  }
2049  else if ( aPropertyName == SC_UNO_LINKDISPBIT )
2050  {
2051  // no target bitmaps for individual entries (would be all equal)
2052  // ScLinkTargetTypeObj::SetLinkTargetBitmap( aRet, SC_LINKTARGETTYPE_DBAREA );
2053  }
2054  else if ( aPropertyName == SC_UNO_LINKDISPNAME )
2055  aRet <<= aName;
2056  else if (aPropertyName == SC_UNONAME_AUTOFLT )
2057  {
2058  bool bAutoFilter(GetDBData_Impl()->HasAutoFilter());
2059 
2060  aRet <<= bAutoFilter;
2061  }
2062  else if (aPropertyName == SC_UNONAME_USEFLTCRT )
2063  {
2064  ScRange aRange;
2065  bool bIsAdvancedSource(GetDBData_Impl()->GetAdvancedQuerySource(aRange));
2066 
2067  aRet <<= bIsAdvancedSource;
2068  }
2069  else if (aPropertyName == SC_UNONAME_FLTCRT )
2070  {
2071  table::CellRangeAddress aRange;
2072  ScRange aCoreRange;
2073  if (GetDBData_Impl()->GetAdvancedQuerySource(aCoreRange))
2074  ScUnoConversion::FillApiRange(aRange, aCoreRange);
2075 
2076  aRet <<= aRange;
2077  }
2078  else if (aPropertyName == SC_UNONAME_FROMSELECT )
2079  {
2080  aRet <<= GetDBData_Impl()->HasImportSelection();
2081  }
2082  else if (aPropertyName == SC_UNONAME_REFPERIOD )
2083  {
2084  sal_Int32 nRefresh(GetDBData_Impl()->GetRefreshDelaySeconds());
2085  aRet <<= nRefresh;
2086  }
2087  else if (aPropertyName == SC_UNONAME_CONRES )
2088  {
2089  }
2090  else if (aPropertyName == SC_UNONAME_TOKENINDEX )
2091  {
2092  // get index for use in formula tokens (read-only)
2093  aRet <<= static_cast<sal_Int32>(GetDBData_Impl()->GetIndex());
2094  }
2095  else if (aPropertyName == SC_UNONAME_TOTALSROW )
2096  {
2097  bool bTotals(GetDBData_Impl()->HasTotals());
2098 
2099  aRet <<= bTotals;
2100  }
2101  else if (aPropertyName == SC_UNONAME_CONTHDR )
2102  {
2103  bool bHeader(GetDBData_Impl()->HasHeader());
2104 
2105  aRet <<= bHeader;
2106  }
2107  }
2108  return aRet;
2109 }
2110 
2112 
2113 // XServiceInfo
2114 OUString SAL_CALL ScDatabaseRangeObj::getImplementationName()
2115 {
2116  return "ScDatabaseRangeObj";
2117 }
2118 
2119 sal_Bool SAL_CALL ScDatabaseRangeObj::supportsService( const OUString& rServiceName )
2120 {
2121  return cppu::supportsService(this, rServiceName);
2122 }
2123 
2124 uno::Sequence<OUString> SAL_CALL ScDatabaseRangeObj::getSupportedServiceNames()
2125 {
2126  return {"com.sun.star.sheet.DatabaseRange",
2128 }
2129 
2131  pDocShell( pDocSh )
2132 {
2134 }
2135 
2137 {
2138  SolarMutexGuard g;
2139 
2140  if (pDocShell)
2142 }
2143 
2145 {
2146  // reference update does not matter here
2147 
2148  if ( rHint.GetId() == SfxHintId::Dying )
2149  {
2150  pDocShell = nullptr;
2151  }
2152 }
2153 
2154 // XDatabaseRanges
2155 
2157 {
2158  if (!pDocShell)
2159  return nullptr;
2160 
2162  if (!pNames)
2163  return nullptr;
2164 
2165  const ScDBCollection::NamedDBs& rDBs = pNames->getNamedDBs();
2166  if (rDBs.empty() || nIndex >= rDBs.size())
2167  return nullptr;
2168 
2170  ::std::advance(itr, nIndex); // boundary check is done above.
2171  return new ScDatabaseRangeObj(pDocShell, (*itr)->GetName());
2172 }
2173 
2175 {
2176  if ( pDocShell && hasByName(aName) )
2177  {
2178  return new ScDatabaseRangeObj( pDocShell, aName );
2179  }
2180  return nullptr;
2181 }
2182 
2183 void SAL_CALL ScDatabaseRangesObj::addNewByName( const OUString& aName,
2184  const table::CellRangeAddress& aRange )
2185 {
2186  SolarMutexGuard aGuard;
2187  bool bDone = false;
2188  if (pDocShell)
2189  {
2190  ScDBDocFunc aFunc(*pDocShell);
2191 
2192  ScRange aNameRange( static_cast<SCCOL>(aRange.StartColumn), static_cast<SCROW>(aRange.StartRow), aRange.Sheet,
2193  static_cast<SCCOL>(aRange.EndColumn), static_cast<SCROW>(aRange.EndRow), aRange.Sheet );
2194  bDone = aFunc.AddDBRange( aName, aNameRange );
2195  }
2196  if (!bDone)
2197  throw uno::RuntimeException(); // no other exceptions specified
2198 }
2199 
2200 void SAL_CALL ScDatabaseRangesObj::removeByName( const OUString& aName )
2201 {
2202  SolarMutexGuard aGuard;
2203  bool bDone = false;
2204  if (pDocShell)
2205  {
2206  ScDBDocFunc aFunc(*pDocShell);
2207  bDone = aFunc.DeleteDBRange( aName );
2208  }
2209  if (!bDone)
2210  throw uno::RuntimeException(); // no other exceptions specified
2211 }
2212 
2213 // XEnumerationAccess
2214 
2215 uno::Reference<container::XEnumeration> SAL_CALL ScDatabaseRangesObj::createEnumeration()
2216 {
2217  SolarMutexGuard aGuard;
2218  return new ScIndexEnumeration(this, "com.sun.star.sheet.DatabaseRangesEnumeration");
2219 }
2220 
2221 // XIndexAccess
2222 
2223 sal_Int32 SAL_CALL ScDatabaseRangesObj::getCount()
2224 {
2225  SolarMutexGuard aGuard;
2226 
2228 
2229  if (pDocShell)
2230  {
2232  if (pNames)
2233  return static_cast<sal_Int32>(pNames->getNamedDBs().size());
2234  }
2235  return 0;
2236 }
2237 
2238 uno::Any SAL_CALL ScDatabaseRangesObj::getByIndex( sal_Int32 nIndex )
2239 {
2240  SolarMutexGuard aGuard;
2241  if (nIndex < 0)
2242  throw lang::IndexOutOfBoundsException();
2243 
2244  uno::Reference<sheet::XDatabaseRange> xRange(GetObjectByIndex_Impl(static_cast<size_t>(nIndex)));
2245  if (!xRange.is())
2246  throw lang::IndexOutOfBoundsException();
2247 
2248  return uno::Any(xRange);
2249 }
2250 
2252 {
2253  SolarMutexGuard aGuard;
2255 }
2256 
2258 {
2259  SolarMutexGuard aGuard;
2260  return ( getCount() != 0 );
2261 }
2262 
2263 // XNameAccess
2264 
2265 uno::Any SAL_CALL ScDatabaseRangesObj::getByName( const OUString& aName )
2266 {
2267  SolarMutexGuard aGuard;
2268  uno::Reference<sheet::XDatabaseRange> xRange(GetObjectByName_Impl(aName));
2269  if (!xRange.is())
2270  throw container::NoSuchElementException();
2271 
2272  return uno::Any(xRange);
2273 }
2274 
2275 uno::Sequence<OUString> SAL_CALL ScDatabaseRangesObj::getElementNames()
2276 {
2277  SolarMutexGuard aGuard;
2278 
2280 
2281  if (pDocShell)
2282  {
2284  if (pNames)
2285  {
2286  const ScDBCollection::NamedDBs& rDBs = pNames->getNamedDBs();
2287  uno::Sequence<OUString> aSeq(rDBs.size());
2288  auto aSeqRange = asNonConstRange(aSeq);
2289  size_t i = 0;
2290  for (const auto& rDB : rDBs)
2291  {
2292  aSeqRange[i] = rDB->GetName();
2293  ++i;
2294  }
2295 
2296  return aSeq;
2297  }
2298  }
2299  return {};
2300 }
2301 
2302 sal_Bool SAL_CALL ScDatabaseRangesObj::hasByName( const OUString& aName )
2303 {
2304  SolarMutexGuard aGuard;
2305 
2307 
2308  if (pDocShell)
2309  {
2311  if (pNames)
2312  return pNames->getNamedDBs().findByUpperName(ScGlobal::getCharClass().uppercase(aName)) != nullptr;
2313  }
2314  return false;
2315 }
2316 
2318  pDocShell( pDocSh )
2319 {
2321 }
2322 
2324 {
2325  SolarMutexGuard g;
2326 
2327  if (pDocShell)
2329 }
2330 
2332 {
2333  // reference update does not matter here
2334 
2335  if ( rHint.GetId() == SfxHintId::Dying )
2336  {
2337  pDocShell = nullptr;
2338  }
2339 }
2340 
2341 // XUnnamedDatabaseRanges
2342 
2343 void ScUnnamedDatabaseRangesObj::setByTable( const table::CellRangeAddress& aRange )
2344 {
2345  SolarMutexGuard aGuard;
2346  bool bDone = false;
2347  if (pDocShell)
2348  {
2349  if ( pDocShell->GetDocument().GetTableCount() <= aRange.Sheet )
2350  throw lang::IndexOutOfBoundsException();
2351 
2352  ScDBDocFunc aFunc(*pDocShell);
2353  ScRange aUnnamedRange( static_cast<SCCOL>(aRange.StartColumn), static_cast<SCROW>(aRange.StartRow), aRange.Sheet,
2354  static_cast<SCCOL>(aRange.EndColumn), static_cast<SCROW>(aRange.EndRow), aRange.Sheet );
2355  bDone = aFunc.AddDBRange( STR_DB_LOCAL_NONAME, aUnnamedRange );
2356  }
2357  if (!bDone)
2358  throw uno::RuntimeException(); // no other exceptions specified
2359 }
2360 
2362 {
2363  SolarMutexGuard aGuard;
2364  if (!pDocShell)
2365  throw uno::RuntimeException();
2366 
2367  if ( pDocShell->GetDocument().GetTableCount() <= nTab )
2368  throw lang::IndexOutOfBoundsException();
2369  uno::Reference<sheet::XDatabaseRange> xRange(
2370  new ScDatabaseRangeObj(pDocShell, static_cast<SCTAB>(nTab)));
2371  if (!xRange.is())
2372  throw container::NoSuchElementException();
2373 
2374  return uno::Any(xRange);
2375 }
2376 
2378 {
2379  SolarMutexGuard aGuard;
2380  if (pDocShell)
2381  {
2382  if (pDocShell->GetDocument().GetTableCount() <= nTab)
2383  throw lang::IndexOutOfBoundsException();
2384  if (pDocShell->GetDocument().GetAnonymousDBData(static_cast<SCTAB>(nTab)))
2385  return true;
2386  return false;
2387  }
2388  else
2389  return false;
2390 }
2391 
2392 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScDocShell * pDocShell
Definition: datauno.hxx:403
static void FillProperties(css::uno::Sequence< css::beans::PropertyValue > &rSeq, const ScSortParam &rParam)
Definition: datauno.cxx:262
::std::vector< ScSortKeyState > maKeyState
Definition: sortparam.hxx:121
bool bGroupActive[MAXSUBTOTAL]
active groups
sal_uInt16 nUserIndex
Definition: sortparam.hxx:110
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: datauno.cxx:926
#define SC_UNONAME_SRCTYPE
Definition: unonames.hxx:292
virtual sal_Bool SAL_CALL getUseColumnHeaders() override
Definition: datauno.cxx:874
const Link< Timer *, void > & GetRefreshHandler() const
Definition: dbdata.hxx:341
SCCOL nColEnd
Definition: rangeutl.hxx:250
#define SC_UNONAME_CONTHDR
Definition: unonames.hxx:302
void SetQueryByEmpty()
Definition: queryentry.cxx:77
SCCOL nColStart
Definition: rangeutl.hxx:248
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
Definition: document.hxx:825
SfxItemPropertySet aPropSet
Definition: datauno.hxx:117
OUString getString() const
SCCOL nField[MAXSUBTOTAL]
associated field
virtual css::uno::Sequence< css::sheet::TableFilterField2 > SAL_CALL getFilterFields2() override
Definition: datauno.cxx:1192
std::vector< css::uno::Reference< css::util::XRefreshListener > > aRefreshListeners
Definition: datauno.hxx:407
ScAddress aStart
Definition: address.hxx:497
virtual void SAL_CALL setSources(const css::uno::Sequence< css::table::CellRangeAddress > &aSources) override
Definition: datauno.cxx:834
bool bUserDef
sort user defined
static sal_Int32 GetEnumFromAny(const css::uno::Any &aAny)
Definition: miscuno.cxx:160
SharedString intern(const OUString &rStr)
#define SC_UNONAME_COPYOUT
Definition: unonames.hxx:298
SC_DLLPUBLIC svl::SharedStringPool & GetSharedStringPool()
Definition: documen2.cxx:584
virtual void GetData(ScQueryParam &rParam) const =0
virtual void GetData(ScQueryParam &rParam) const override
Definition: datauno.cxx:1495
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: datauno.cxx:2124
rtl::Reference< ScSubTotalFieldObj > GetObjectByIndex_Impl(sal_uInt16 nIndex)
Definition: datauno.cxx:542
static void FillProperties(css::uno::Sequence< css::beans::PropertyValue > &rSeq, const ScImportParam &rParam)
Definition: datauno.cxx:167
SCROW nRowStart
Definition: rangeutl.hxx:249
SC_DLLPUBLIC ScDBData * GetAnonymousDBData(SCTAB nTab)
Definition: document.cxx:308
SCROW Row() const
Definition: address.hxx:274
virtual void SAL_CALL refresh() override
Definition: datauno.cxx:1843
SfxItemPropertySet aPropSet
Definition: datauno.hxx:283
std::unique_ptr< ScRefreshTimerControl > const & GetRefreshTimerControlAddress() const
Definition: document.hxx:2511
void SetImportSelection(bool bSet)
Definition: dbdata.hxx:202
void setDataSource(const OUString &_sDataSourceNameOrLocation)
OUString aDBName
Definition: global.hxx:444
virtual void PutData(const ScSubTotalParam &rParam)=0
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
Definition: datauno.cxx:634
css::lang::Locale aCollatorLocale
Definition: sortparam.hxx:122
virtual css::uno::Type SAL_CALL getElementType() override
Definition: datauno.cxx:2251
SCCOL nDestCol
Definition: sortparam.hxx:118
virtual void SAL_CALL addNew(const css::uno::Sequence< css::sheet::SubTotalColumn > &aSubTotalColumns, sal_Int32 nGroupColumn) override
Definition: datauno.cxx:563
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: datauno.cxx:1443
SC_DLLPUBLIC void GetSortParam(ScSortParam &rSortParam) const
Definition: dbdata.cxx:401
void GetSubTotalParam(ScSubTotalParam &rSubTotalParam) const
Definition: datauno.cxx:1769
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
Definition: datauno.cxx:2275
virtual css::uno::Type SAL_CALL getElementType() override
Definition: datauno.cxx:644
std::unique_ptr< sal_Int32[]> pData
sal_uInt16 char char * pDesc
Definition: callform.cxx:57
virtual ~ScSubTotalDescriptor() override
Definition: datauno.cxx:745
virtual ~ScFilterDescriptor() override
Definition: datauno.cxx:1491
WeakReference< XInterface > mxParent
virtual css::uno::Reference< css::sheet::XSubTotalDescriptor > SAL_CALL getSubTotalDescriptor() override
Definition: datauno.cxx:1822
const SCCOL SCCOL_MAX
Definition: address.hxx:56
virtual void SAL_CALL setGroupColumn(sal_Int32 nGroupColumn) override
Definition: datauno.cxx:467
void SetDoSize(bool bSet)
Definition: dbdata.hxx:137
SC_DLLPUBLIC bool ApplyFlagsTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, ScMF nFlags)
Definition: document.cxx:5069
ScRangeFilterDescriptor(ScDocShell *pDocSh, ScDatabaseRangeObj *pPar)
Definition: datauno.cxx:1510
sal_Int64 n
QueryItemsType & GetQueryItems()
Definition: queryentry.hxx:75
bool DoImport(SCTAB nTab, const ScImportParam &rParam, const svx::ODataAccessDescriptor *pDescriptor)
Definition: dbdocimp.cxx:121
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
Definition: datauno.cxx:2302
#define SC_UNONAME_DBNAME
Definition: unonames.hxx:280
void SetAreas(std::unique_ptr< ScArea[]> pAreas, sal_uInt16 nCount)
Definition: global2.cxx:184
#define SC_UNONAME_ULIST
Definition: unonames.hxx:295
virtual void GetData(ScSubTotalParam &rParam) const override
Definition: datauno.cxx:749
sal_uInt16 nDataAreaCount
Definition: global.hxx:892
SfxItemPropertySet aPropSet
Definition: datauno.hxx:405
SCCOLROW nField
Definition: queryentry.hxx:61
ScAddress aEnd
Definition: address.hxx:498
bool bDoSort
presort
#define SC_UNONAME_USEREGEX
Definition: unonames.hxx:294
virtual css::uno::Any SAL_CALL getByTable(sal_Int32 nTab) override
Definition: datauno.cxx:2361
std::unique_ptr< ScArea[]> pDataAreas
Definition: global.hxx:893
virtual ~ScUnnamedDatabaseRangesObj() override
Definition: datauno.cxx:2323
bool IsQueryByEmpty() const
Definition: queryentry.cxx:87
bool bPagebreak
page break at change of group
void SetKeepFmt(bool bSet)
Definition: dbdata.hxx:139
virtual css::uno::Sequence< css::sheet::TableFilterField > SAL_CALL getFilterFields() override
Definition: datauno.cxx:936
ScQueryParam aStoredParam
Definition: datauno.hxx:346
virtual ~ScRangeSubTotalDescriptor() override
Definition: datauno.cxx:769
void SetQueryParam(const ScQueryParam &rParam)
Definition: dpshttab.cxx:270
bool IsDoSize() const
Definition: dbdata.hxx:136
SfxHintId GetId() const
virtual void SAL_CALL setFilterFields3(const css::uno::Sequence< css::sheet::TableFilterField3 > &aFilterFields) override
Definition: datauno.cxx:1377
virtual ~ScConsolidationDescriptor() override
Definition: datauno.cxx:789
#define SC_UNONAME_ISSORTCOLUMNS
Definition: unonames.hxx:305
void GetQueryParam(ScQueryParam &rQueryParam) const
Definition: datauno.cxx:1715
#define SC_UNONAME_FORMATS
Definition: unonames.hxx:281
#define SC_UNONAME_OUTPOS
Definition: unonames.hxx:301
virtual css::sheet::GeneralFunction SAL_CALL getFunction() override
Definition: datauno.cxx:800
sal_uInt16 nPos
Definition: datauno.hxx:213
#define SC_UNONAME_MAXFLD
Definition: unonames.hxx:303
char sal_uInt16 & nParamCount
Definition: callform.cxx:53
sal_uInt16 nUserIndex
index into list
#define SC_UNONAME_MOVCELLS
Definition: unonames.hxx:284
bool RepeatDB(const OUString &rDBName, bool bApi, bool bIsUnnamed, SCTAB aTab=0)
Definition: dbdocfun.cxx:283
virtual void SAL_CALL setName(const OUString &aName) override
Definition: datauno.cxx:1645
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
Definition: address.hxx:44
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:315
ScUnnamedDatabaseRangesObj(ScDocShell *pDocSh)
Definition: datauno.cxx:2317
virtual OUString SAL_CALL getName() override
Definition: datauno.cxx:1639
#define SC_UNONAME_KEEPFORM
Definition: unonames.hxx:283
UNO3_GETIMPLEMENTATION_IMPL(ScSubTotalDescriptorBase)
#define SC_UNONAME_BINDFMT
Definition: unonames.hxx:297
int nCount
virtual void SAL_CALL setInsertLinks(sal_Bool bInsertLinks) override
Definition: datauno.cxx:904
SC_DLLPUBLIC SCSIZE GetEntryCount() const
Definition: queryparam.cxx:110
rtl::Reference< ScDatabaseRangeObj > GetObjectByName_Impl(const OUString &aName)
Definition: datauno.cxx:2174
virtual sal_Int32 SAL_CALL getCount() override
Definition: datauno.cxx:2223
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
SCROW nRowEnd
Definition: rangeutl.hxx:251
SC_DLLPUBLIC const ScQueryEntry & GetEntry(SCSIZE n) const
Definition: queryparam.cxx:115
Mode eMode
SCTAB Tab() const
Definition: address.hxx:283
SC_DLLPUBLIC void SetQueryParam(const ScQueryParam &rQueryParam)
Definition: dbdata.cxx:437
ScDocShell * pDocShell
Definition: datauno.hxx:489
void SetRow(SCROW nRowP)
Definition: address.hxx:287
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: datauno.cxx:1597
virtual ~ScDatabaseRangesObj() override
Definition: datauno.cxx:2136
virtual void PutData(const ScQueryParam &rParam) override
Definition: datauno.cxx:1500
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
Definition: datauno.cxx:2238
#define SC_UNONAME_UINDEX
Definition: unonames.hxx:296
const OUString & GetName() const
#define SC_UNONAME_CONRES
Definition: unonames.hxx:317
bool DeleteDBRange(const OUString &rName)
Definition: dbdocfun.cxx:118
virtual sal_Bool SAL_CALL hasElements() override
Definition: datauno.cxx:650
void SetSheetDesc(const ScSheetSourceDesc &rDesc)
Definition: dpobject.cxx:414
ScSubTotalFieldObj(ScSubTotalDescriptorBase *pDesc, sal_uInt16 nP)
Definition: datauno.cxx:445
sal_uInt16 GetIndex() const
Definition: dbdata.hxx:135
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getSortDescriptor() override
Definition: datauno.cxx:1692
void ClearDataAreas()
Definition: global2.cxx:119
void GetFilterEntries(SCCOL nCol, SCROW nRow, SCTAB nTab, ScFilterEntries &rFilterEntries)
Get a list of unique strings to use in filtering criteria.
Definition: documen3.cxx:1561
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: datauno.cxx:2144
ScRangeSubTotalDescriptor(ScDatabaseRangeObj *pPar)
Definition: datauno.cxx:764
virtual sal_Bool SAL_CALL getInsertLinks() override
Definition: datauno.cxx:898
#define SC_UNONAME_USEFLTCRT
Definition: unonames.hxx:314
const ScQueryParam & GetQueryParam() const
Definition: dpshttab.hxx:63
void SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
Definition: dbdata.cxx:322
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: datauno.cxx:1937
OUString aStatement
Definition: global.hxx:445
virtual ~ScFilterDescriptorBase() override
Definition: datauno.cxx:918
static const SfxItemPropertyMapEntry * lcl_GetSubTotalPropertyMap()
Definition: datauno.cxx:72
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
Definition: documen2.cxx:459
virtual void PutData(const ScQueryParam &rParam) override
Definition: datauno.cxx:1552
void SetRefreshHandler(const Link< Timer *, void > &rLink)
SCCOL nSubTotals[MAXSUBTOTAL]
number of SubTotals
int i
virtual void SAL_CALL clear() override
Definition: datauno.cxx:549
static tools::Long GetPropertyCount()
Definition: datauno.hxx:82
#define SC_UNONAME_ENUSLIST
Definition: unonames.hxx:308
bool IsQueryByNonEmpty() const
Definition: queryentry.cxx:109
ScFilterDescriptorBase(ScDocShell *pDocShell)
Definition: datauno.cxx:910
bool RenameDBRange(const OUString &rOld, const OUString &rNew)
Definition: dbdocfun.cxx:154
sal_Int32 getLength() const
sal_Int16 SCCOL
Definition: types.hxx:21
virtual css::uno::Sequence< css::table::CellRangeAddress > SAL_CALL getSources() override
Definition: datauno.cxx:812
static SC_DLLPUBLIC const CharClass & getCharClass()
Definition: global.cxx:1024
SC_DLLPUBLIC void SetAdvancedQuerySource(const ScRange *pSource)
Definition: dbdata.cxx:446
bool IsSheetData() const
Definition: dpobject.cxx:484
bool bNative
Definition: global.hxx:446
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: datauno.cxx:1929
void Resize(size_t nNew)
Definition: queryparam.cxx:195
float u
unsigned char sal_Bool
#define SC_UNONAME_FROMSELECT
Definition: unonames.hxx:316
virtual void SAL_CALL setUseColumnHeaders(sal_Bool bUseColumnHeaders) override
Definition: datauno.cxx:880
const OUString & GetName() const
Definition: dbdata.hxx:121
const SfxItemPropertyMap & getPropertyMap() const
void GetImportParam(ScImportParam &rImportParam) const
Definition: dbdata.cxx:480
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: datauno.cxx:2331
ScSubTotalParam aStoredParam
Definition: datauno.hxx:177
#define SC_UNONAME_AUTOFLT
Definition: unonames.hxx:312
bool IsKeepFmt() const
Definition: dbdata.hxx:138
void SetQueryParam(const ScQueryParam &rQueryParam)
Definition: datauno.cxx:1736
std::unique_ptr< ScSubTotalFunc[]> pFunctions[MAXSUBTOTAL]
array of associated functions
OUString aPropName
bool bCaseSens
Definition: sortparam.hxx:113
css::uno::Type const & get()
#define SC_SIMPLE_SERVICE_INFO(ClassName, ClassNameAscii, ServiceAscii)
Definition: miscuno.hxx:63
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: datauno.cxx:614
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: datauno.cxx:1391
constexpr OUStringLiteral STR_DB_LOCAL_NONAME
Definition: globalnames.hxx:14
#define SC_UNONAME_USINDEX
Definition: unonames.hxx:309
#define SC_UNONAME_TOTALSROW
Definition: unonames.hxx:320
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
Definition: docsh3.cxx:101
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
Definition: dbdata.cxx:300
size_t size() const
Definition: dbdata.cxx:1248
void SetHeader(bool bHasH)
Definition: dbdata.hxx:131
bool IsStripData() const
Definition: dbdata.hxx:140
svl::SharedString maString
Definition: queryentry.hxx:49
static void FillSortParam(ScSortParam &rParam, const css::uno::Sequence< css::beans::PropertyValue > &rSeq)
Definition: datauno.cxx:324
static css::sheet::GeneralFunction SubTotalToGeneral(ScSubTotalFunc eSubTotal)
Definition: datauno.cxx:142
#define SC_UNONAME_SRCOBJ
Definition: unonames.hxx:291
#define SC_IMPL_DUMMY_PROPERTY_LISTENER(ClassName)
Definition: miscuno.hxx:72
ScDataAreaExtras aDataAreaExtras
Definition: sortparam.hxx:109
SCCOL Col() const
Definition: address.hxx:279
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: datauno.cxx:2031
rtl::Reference< ScDatabaseRangeObj > mxParent
Definition: datauno.hxx:366
void GetSubTotalParam(ScSubTotalParam &rSubTotalParam) const
Definition: dbdata.cxx:463
ScDBData * findByUpperName(const OUString &rName)
Definition: dbdata.cxx:1196
void SetStripData(bool bSet)
Definition: dbdata.hxx:141
void AddUnoObject(SfxListener &rObject)
Definition: documen3.cxx:901
ScDataPilotFilterDescriptor(ScDocShell *pDocSh, ScDataPilotDescriptorBase *pPar)
Definition: datauno.cxx:1532
#define SC_UNONAME_ISCASE
Definition: unonames.hxx:299
constexpr OUStringLiteral SCLINKTARGET_SERVICE
Definition: targuno.hxx:41
void SetSubTotalParam(const ScSubTotalParam &rSubTotalParam)
Definition: datauno.cxx:1795
virtual sal_Int32 SAL_CALL getGroupColumn() override
Definition: datauno.cxx:458
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: datauno.cxx:658
virtual css::table::CellAddress SAL_CALL getStartOutputPosition() override
Definition: datauno.cxx:855
Stores global named database ranges.
Definition: dbdata.hxx:234
bool mbCellFormats
If TRUE, consider the presence of cell formats.
Definition: sortparam.hxx:50
virtual css::table::CellRangeAddress SAL_CALL getDataArea() override
Definition: datauno.cxx:1659
const PropertyValue * pValues
sal_Int32 SCROW
Definition: types.hxx:17
virtual void SAL_CALL setStartOutputPosition(const css::table::CellAddress &aStartOutputPosition) override
Definition: datauno.cxx:865
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: datauno.cxx:705
virtual void PutData(const ScQueryParam &rParam) override
Definition: datauno.cxx:1526
virtual void SAL_CALL setByTable(const css::table::CellRangeAddress &aRange) override
Definition: datauno.cxx:2343
virtual css::uno::Sequence< css::sheet::SubTotalColumn > SAL_CALL getSubTotalColumns() override
Definition: datauno.cxx:478
#define SC_UNONAME_ORIENT
Definition: unonames.hxx:304
#define SC_UNONAME_ISULIST
Definition: unonames.hxx:300
rtl::Reference< ScDatabaseRangeObj > mxParent
Definition: datauno.hxx:196
virtual void SAL_CALL setFilterFields2(const css::uno::Sequence< css::sheet::TableFilterField2 > &aFilterFields) override
Definition: datauno.cxx:1367
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: datauno.cxx:2215
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: datauno.cxx:2119
void GetInputLineString(const double &fOutNumber, sal_uInt32 nFIndex, OUString &rOutString, bool bFiltering=false, bool bForceSystemLocale=false)
bool has(DataAccessDescriptorProperty _eWhich) const
bool bHasHeader
Definition: sortparam.hxx:111
ScDatabaseRangesObj(ScDocShell *pDocSh)
Definition: datauno.cxx:2130
static void FillImportParam(ScImportParam &rParam, const css::uno::Sequence< css::beans::PropertyValue > &rSeq)
Definition: datauno.cxx:207
virtual void SAL_CALL setDataArea(const css::table::CellRangeAddress &aDataArea) override
Definition: datauno.cxx:1677
virtual ~ScDatabaseRangeObj() override
Definition: datauno.cxx:1589
sal_uInt8 nType
Definition: global.hxx:448
ScConsolidateParam aParam
Definition: datauno.hxx:238
ScDocShell * pDocSh
Definition: datauno.hxx:284
rtl::Reference< ScDatabaseRangeObj > GetObjectByIndex_Impl(size_t nIndex)
Definition: datauno.cxx:2156
ScDBData * GetDBData_Impl() const
Definition: datauno.cxx:1614
void SetRefreshControl(std::unique_ptr< ScRefreshTimerControl > const *pp)
void SetParam(const ScQueryParam &rNew)
Definition: datauno.cxx:1505
virtual ~ScRangeFilterDescriptor() override
Definition: datauno.cxx:1516
sal_uInt16 GetSortKeyCount() const
Definition: sortparam.hxx:139
OUString aName
#define SC_UNO_LINKDISPBIT
Definition: unonames.hxx:190
virtual void SAL_CALL setFunction(css::sheet::GeneralFunction nFunction) override
Definition: datauno.cxx:806
virtual css::uno::Reference< css::table::XCellRange > SAL_CALL getReferredCells() override
Definition: datauno.cxx:1909
virtual void SAL_CALL removeRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &l) override
Definition: datauno.cxx:1881
virtual ~ScSubTotalFieldObj() override
Definition: datauno.cxx:452
static const SfxItemPropertyMapEntry * lcl_GetFilterPropertyMap()
Definition: datauno.cxx:95
#define SC_UNONAME_ISNATIVE
Definition: unonames.hxx:286
SC_DLLPUBLIC bool RemoveFlagsTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, ScMF nFlags)
Definition: document.cxx:5080
ScSubTotalFunc eFunction
Definition: global.hxx:891
bool bIncludePattern
sort formats
really derive cell from range?
Definition: cellsuno.hxx:636
const ScSheetSourceDesc * GetSheetDesc() const
Definition: dpobject.hxx:156
DBsType::const_iterator const_iterator
Definition: dbdata.hxx:250
void RemoveUnoObject(SfxListener &rObject)
Definition: documen3.cxx:909
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getImportDescriptor() override
Definition: datauno.cxx:1828
void * p
bool empty() const
Definition: dbdata.cxx:1243
#define SC_UNONAME_ISUSER
Definition: unonames.hxx:285
Sequence< sal_Int8 > aSeq
const ScDocument & GetDocument() const
Definition: docsh.hxx:220
virtual void SAL_CALL removeByName(const OUString &aName) override
Definition: datauno.cxx:2200
SC_DLLPUBLIC void GetQueryParam(ScQueryParam &rQueryParam) const
Definition: dbdata.cxx:424
bool HasImportSelection() const
Definition: dbdata.hxx:201
static tools::Long GetPropertyCount()
SortAscending needs to get out of the SheetSortDescriptor service description.
Definition: datauno.hxx:97
void SetTotals(bool bTotals)
Definition: dbdata.hxx:133
ScQueryConnect eConnect
Definition: queryentry.hxx:63
OUString aCollatorAlgorithm
Definition: sortparam.hxx:123
bool bImport
Definition: global.hxx:443
#define SC_UNONAME_ENABSORT
Definition: unonames.hxx:315
NamedDBs & getNamedDBs()
Definition: dbdata.hxx:316
void SetRefreshDelay(sal_Int32 nSeconds)
virtual void SAL_CALL setSubTotalColumns(const css::uno::Sequence< css::sheet::SubTotalColumn > &aSubTotalColumns) override
Definition: datauno.cxx:496
std::vector< Item > QueryItemsType
Definition: queryentry.hxx:58
ScDatabaseRangeObj(ScDocShell *pDocSh, const OUString &rNm)
Definition: datauno.cxx:1569
void SetSubTotalParam(const ScSubTotalParam &rSubTotalParam)
Definition: dbdata.cxx:475
#define SC_UNONAME_SORTASC
Definition: unonames.hxx:307
static void FillApiRange(css::table::CellRangeAddress &rApiRange, const ScRange &rScRange)
Definition: convuno.hxx:87
SCTAB nTab
Definition: rangeutl.hxx:247
void SetParam(const ScSubTotalParam &rNew)
Definition: datauno.cxx:759
virtual sal_Bool SAL_CALL hasElements() override
Definition: datauno.cxx:2257
void ModifyDBData(const ScDBData &rNewData)
Definition: dbdocfun.cxx:201
SC_DLLPUBLIC bool GetAdvancedQuerySource(ScRange &rSource) const
Definition: dbdata.cxx:457
SCROW nDestRow
Definition: sortparam.hxx:119
#define SC_UNONAME_SORTFLD
Definition: unonames.hxx:306
virtual void PutData(const ScSubTotalParam &rParam) override
Definition: datauno.cxx:754
virtual sal_Bool SAL_CALL getUseRowHeaders() override
Definition: datauno.cxx:886
virtual void PutData(const ScSubTotalParam &rParam) override
Definition: datauno.cxx:779
virtual ~ScSubTotalDescriptorBase() override
Definition: datauno.cxx:536
virtual css::uno::Reference< css::sheet::XSheetFilterDescriptor > SAL_CALL getFilterDescriptor() override
Definition: datauno.cxx:1763
virtual void GetData(ScSubTotalParam &rParam) const =0
virtual void GetData(ScSubTotalParam &rParam) const override
Definition: datauno.cxx:773
ScSubTotalFunc
Definition: global.hxx:843
static bool GetBoolFromAny(const css::uno::Any &aAny)
Definition: miscuno.cxx:138
virtual void SAL_CALL addRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &l) override
Definition: datauno.cxx:1870
#define SC_UNONAME_CASE
Definition: unonames.hxx:279
static void FillScRange(ScRange &rScRange, const css::table::CellRangeAddress &rApiRange)
Definition: convuno.hxx:79
bool AddDBRange(const OUString &rName, const ScRange &rRange)
Definition: dbdocfun.cxx:65
std::unique_ptr< SCCOL[]> pSubTotals[MAXSUBTOTAL]
array of columns to be calculated
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: datauno.cxx:666
#define SC_UNONAME_FLTCRT
Definition: unonames.hxx:313
virtual css::uno::Sequence< css::sheet::TableFilterField3 > SAL_CALL getFilterFields3() override
Definition: datauno.cxx:1242
ScQueryOp eOp
Definition: queryentry.hxx:62
virtual sal_Int32 SAL_CALL getCount() override
Definition: datauno.cxx:622
void SetParam(const ScConsolidateParam &rNew)
Definition: datauno.cxx:793
#define SC_UNO_LINKDISPNAME
Definition: unonames.hxx:191
static const SfxItemPropertyMapEntry * lcl_GetDBRangePropertyMap()
Definition: datauno.cxx:113
virtual void SAL_CALL addNewByName(const OUString &aName, const css::table::CellRangeAddress &aRange) override
Definition: datauno.cxx:2183
This class contains authoritative information on the internal reference used as the data source for d...
Definition: dpshttab.hxx:39
virtual ~ScDataPilotFilterDescriptor() override
Definition: datauno.cxx:1538
virtual void GetData(ScQueryParam &rParam) const override
Definition: datauno.cxx:1520
aStr
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: datauno.cxx:1399
rtl::Reference< ScSubTotalDescriptorBase > xParent
Definition: datauno.hxx:212
#define SC_UNONAME_SAVEOUT
Definition: unonames.hxx:289
virtual void PutData(const ScQueryParam &rParam)=0
#define SC_UNONAME_INSBRK
Definition: unonames.hxx:282
virtual void SAL_CALL setFilterFields(const css::uno::Sequence< css::sheet::TableFilterField > &aFilterFields) override
Definition: datauno.cxx:1302
bool bAscending
sort ascending
Each instance of this struct represents a single filtering criteria.
Definition: queryentry.hxx:33
#define SC_UNONAME_COLLALG
Definition: unonames.hxx:311
void SetQueryByNonEmpty()
Definition: queryentry.cxx:99
#define SC_UNONAME_COLLLOC
Definition: unonames.hxx:310
AnyEventRef aEvent
utl::SearchParam::SearchType eSearchType
Definition: queryparam.hxx:43
virtual void SAL_CALL setUseRowHeaders(sal_Bool bUseRowHeaders) override
Definition: datauno.cxx:892
#define SC_UNONAME_SKIPDUP
Definition: unonames.hxx:290
rtl::Reference< ScDataPilotDescriptorBase > mxParent
Definition: datauno.hxx:382
#define SC_UNONAME_TOKENINDEX
Definition: unonames.hxx:318
sal_uInt16 nPos
static SC_DLLPUBLIC ScSubTotalFunc toSubTotalFunc(ScGeneralFunction eGenFunc)
Definition: dputil.cxx:395
sal_Int16 SCTAB
Definition: types.hxx:22
void SetAutoFilter(bool bSet)
Definition: dbdata.hxx:205
bool any2bool(const css::uno::Any &rAny)
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
Definition: datauno.cxx:2265
const SCSIZE MAXSUBTOTAL
Definition: global.hxx:81
bool m_bDetectedRangeSegmentation false
virtual void GetData(ScQueryParam &rParam) const override
Definition: datauno.cxx:1542
virtual sal_Bool SAL_CALL hasByTable(sal_Int32 nTab) override
Definition: datauno.cxx:2377
#define SC_UNONAME_REFPERIOD
Definition: unonames.hxx:370
SCTAB nDestTab
Definition: sortparam.hxx:117
#define SC_UNONAME_STRIPDAT
Definition: unonames.hxx:293
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo