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