Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
b94cee29
Kaydet (Commit)
b94cee29
authored
Ock 29, 2001
tarafından
Niklas Nebel
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
leave out hidden or empty sheets
üst
f85f3eb3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
10 deletions
+64
-10
CDatabaseMetaData.cxx
connectivity/source/drivers/calc/CDatabaseMetaData.cxx
+64
-10
No files found.
connectivity/source/drivers/calc/CDatabaseMetaData.cxx
Dosyayı görüntüle @
b94cee29
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
*
*
* $RCSfile: CDatabaseMetaData.cxx,v $
* $RCSfile: CDatabaseMetaData.cxx,v $
*
*
* $Revision: 1.
1
$
* $Revision: 1.
2
$
*
*
* last change: $Author: nn $ $Date: 2001-01-2
6 19:05:48
$
* last change: $Author: nn $ $Date: 2001-01-2
9 19:25:10
$
*
*
* The Contents of this file are made available subject to the terms of
* The Contents of this file are made available subject to the terms of
* either of the following licenses
* either of the following licenses
...
@@ -90,6 +90,15 @@
...
@@ -90,6 +90,15 @@
#ifndef _COM_SUN_STAR_SHEET_XSPREADSHEETDOCUMENT_HPP_
#ifndef _COM_SUN_STAR_SHEET_XSPREADSHEETDOCUMENT_HPP_
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#endif
#endif
#ifndef _COM_SUN_STAR_SHEET_XSPREADSHEET_HPP_
#include <com/sun/star/sheet/XSpreadsheet.hpp>
#endif
#ifndef _COM_SUN_STAR_SHEET_XCELLRANGESQUERY_HPP_
#include <com/sun/star/sheet/XCellRangesQuery.hpp>
#endif
#ifndef _COM_SUN_STAR_SHEET_XCELLRANGEADDRESSABLE_HPP_
#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
#endif
#ifndef _URLOBJ_HXX //autogen wg. INetURLObject
#ifndef _URLOBJ_HXX //autogen wg. INetURLObject
#include <tools/urlobj.hxx>
#include <tools/urlobj.hxx>
#endif
#endif
...
@@ -111,6 +120,7 @@ using namespace ::com::sun::star::beans;
...
@@ -111,6 +120,7 @@ using namespace ::com::sun::star::beans;
using
namespace
::
com
::
sun
::
star
::
sdbcx
;
using
namespace
::
com
::
sun
::
star
::
sdbcx
;
using
namespace
::
com
::
sun
::
star
::
sdbc
;
using
namespace
::
com
::
sun
::
star
::
sdbc
;
using
namespace
::
com
::
sun
::
star
::
container
;
using
namespace
::
com
::
sun
::
star
::
container
;
using
namespace
::
com
::
sun
::
star
::
table
;
using
namespace
::
com
::
sun
::
star
::
sheet
;
using
namespace
::
com
::
sun
::
star
::
sheet
;
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
...
@@ -463,6 +473,50 @@ sal_Int32 SAL_CALL OCalcDatabaseMetaData::getMaxColumnsInTable( ) throw(SQLExce
...
@@ -463,6 +473,50 @@ sal_Int32 SAL_CALL OCalcDatabaseMetaData::getMaxColumnsInTable( ) throw(SQLExce
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
sal_Bool
lcl_IsEmptyOrHidden
(
const
Reference
<
XSpreadsheets
>&
xSheets
,
const
::
rtl
::
OUString
&
rName
)
{
Any
aAny
=
xSheets
->
getByName
(
rName
);
Reference
<
XSpreadsheet
>
xSheet
;
if
(
aAny
>>=
xSheet
)
{
// test if sheet is hidden
Reference
<
XPropertySet
>
xProp
(
xSheet
,
UNO_QUERY
);
if
(
xProp
.
is
())
{
sal_Bool
bVisible
;
Any
aVisAny
=
xProp
->
getPropertyValue
(
::
rtl
::
OUString
::
createFromAscii
(
"IsVisible"
)
);
if
(
aVisAny
>>=
bVisible
)
if
(
!
bVisible
)
return
sal_True
;
// hidden
}
// test if sheet is empty
Reference
<
XCellRangeAddressable
>
xAddr
(
xSheet
,
UNO_QUERY
);
Reference
<
XCellRangesQuery
>
xQuery
(
xSheet
,
UNO_QUERY
);
if
(
xAddr
.
is
()
&&
xQuery
.
is
()
)
{
CellRangeAddress
aTotalRange
=
xAddr
->
getRangeAddress
();
// queryIntersection to get a ranges object
Reference
<
XSheetCellRanges
>
xRanges
=
xQuery
->
queryIntersection
(
aTotalRange
);
if
(
xRanges
.
is
())
{
Reference
<
XEnumerationAccess
>
xCells
=
xRanges
->
getCells
();
if
(
xCells
.
is
())
{
if
(
!
xCells
->
hasElements
()
)
return
sal_True
;
// empty
}
}
}
}
return
sal_False
;
}
// -------------------------------------------------------------------------
Reference
<
XResultSet
>
SAL_CALL
OCalcDatabaseMetaData
::
getTables
(
Reference
<
XResultSet
>
SAL_CALL
OCalcDatabaseMetaData
::
getTables
(
const
Any
&
catalog
,
const
::
rtl
::
OUString
&
schemaPattern
,
const
Any
&
catalog
,
const
::
rtl
::
OUString
&
schemaPattern
,
const
::
rtl
::
OUString
&
tableNamePattern
,
const
Sequence
<
::
rtl
::
OUString
>&
types
)
const
::
rtl
::
OUString
&
tableNamePattern
,
const
Sequence
<
::
rtl
::
OUString
>&
types
)
...
@@ -513,15 +567,15 @@ Reference< XResultSet > SAL_CALL OCalcDatabaseMetaData::getTables(
...
@@ -513,15 +567,15 @@ Reference< XResultSet > SAL_CALL OCalcDatabaseMetaData::getTables(
sal_Int32
nSheetCount
=
aSheetNames
.
getLength
();
sal_Int32
nSheetCount
=
aSheetNames
.
getLength
();
for
(
sal_Int32
nSheet
=
0
;
nSheet
<
nSheetCount
;
nSheet
++
)
for
(
sal_Int32
nSheet
=
0
;
nSheet
<
nSheetCount
;
nSheet
++
)
{
{
//! leave out hidden or empty sheets?
::
rtl
::
OUString
aName
=
aSheetNames
[
nSheet
];
::
rtl
::
OUString
aName
=
aSheetNames
[
nSheet
];
if
(
!
lcl_IsEmptyOrHidden
(
xSheets
,
aName
)
)
ORow
aRow
(
3
);
{
aRow
.
push_back
(
makeAny
(
aName
));
ORow
aRow
(
3
);
aRow
.
push_back
(
makeAny
(
aTable
));
aRow
.
push_back
(
makeAny
(
aName
));
aRow
.
push_back
(
Any
());
aRow
.
push_back
(
makeAny
(
aTable
));
aRows
.
push_back
(
aRow
);
aRow
.
push_back
(
Any
());
aRows
.
push_back
(
aRow
);
}
}
}
pResult
->
setRows
(
aRows
);
pResult
->
setRows
(
aRows
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment