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