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