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
512ccd16
Kaydet (Commit)
512ccd16
authored
Eki 09, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make the same change to the orcus interface & remove unused methods.
Change-Id: I1263026133b694e531c0a99b16d622e1ae12db48
üst
0eabc71b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
94 deletions
+15
-94
tokenarray.hxx
sc/inc/tokenarray.hxx
+2
-0
sharedformulagroups.cxx
sc/source/filter/ftools/sharedformulagroups.cxx
+0
-33
sharedformulagroups.hxx
sc/source/filter/inc/sharedformulagroups.hxx
+0
-23
interface.cxx
sc/source/filter/orcus/interface.cxx
+13
-38
No files found.
sc/inc/tokenarray.hxx
Dosyayı görüntüle @
512ccd16
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
#include "scdllapi.h"
#include "scdllapi.h"
#include "types.hxx"
#include "types.hxx"
#include "calcmacros.hxx"
#include "calcmacros.hxx"
#include "address.hxx"
#include "global.hxx"
#include <formula/tokenarray.hxx>
#include <formula/tokenarray.hxx>
namespace
sc
{
namespace
sc
{
...
...
sc/source/filter/ftools/sharedformulagroups.cxx
Dosyayı görüntüle @
512ccd16
...
@@ -11,50 +11,17 @@
...
@@ -11,50 +11,17 @@
namespace
sc
{
namespace
sc
{
SharedFormulaGroups
::
Key
::
Key
(
size_t
nId
,
SCCOL
nCol
)
:
mnId
(
nId
),
mnCol
(
nCol
)
{}
bool
SharedFormulaGroups
::
Key
::
operator
==
(
const
Key
&
rOther
)
const
{
return
mnId
==
rOther
.
mnId
&&
mnCol
==
rOther
.
mnCol
;
}
bool
SharedFormulaGroups
::
Key
::
operator
!=
(
const
Key
&
rOther
)
const
{
return
!
operator
==
(
rOther
);
}
size_t
SharedFormulaGroups
::
KeyHash
::
operator
()(
const
Key
&
rKey
)
const
{
double
nVal
=
rKey
.
mnId
;
nVal
*=
256.0
;
nVal
+=
rKey
.
mnCol
;
return
static_cast
<
size_t
>
(
nVal
);
}
void
SharedFormulaGroups
::
set
(
size_t
nSharedId
,
ScTokenArray
*
pArray
)
void
SharedFormulaGroups
::
set
(
size_t
nSharedId
,
ScTokenArray
*
pArray
)
{
{
maStore
.
insert
(
nSharedId
,
pArray
);
maStore
.
insert
(
nSharedId
,
pArray
);
}
}
void
SharedFormulaGroups
::
set
(
size_t
nSharedId
,
SCCOL
nCol
,
const
ScFormulaCellGroupRef
&
xGroup
)
{
Key
aKey
(
nSharedId
,
nCol
);
maColStore
.
insert
(
ColStoreType
::
value_type
(
aKey
,
xGroup
));
}
const
ScTokenArray
*
SharedFormulaGroups
::
get
(
size_t
nSharedId
)
const
const
ScTokenArray
*
SharedFormulaGroups
::
get
(
size_t
nSharedId
)
const
{
{
StoreType
::
const_iterator
it
=
maStore
.
find
(
nSharedId
);
StoreType
::
const_iterator
it
=
maStore
.
find
(
nSharedId
);
return
it
==
maStore
.
end
()
?
NULL
:
it
->
second
;
return
it
==
maStore
.
end
()
?
NULL
:
it
->
second
;
}
}
ScFormulaCellGroupRef
SharedFormulaGroups
::
get
(
size_t
nSharedId
,
SCCOL
nCol
)
const
{
Key
aKey
(
nSharedId
,
nCol
);
ColStoreType
::
const_iterator
it
=
maColStore
.
find
(
aKey
);
return
it
==
maColStore
.
end
()
?
ScFormulaCellGroupRef
()
:
it
->
second
;
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/filter/inc/sharedformulagroups.hxx
Dosyayı görüntüle @
512ccd16
...
@@ -10,43 +10,20 @@
...
@@ -10,43 +10,20 @@
#ifndef SC_FILTER_SHAREDFORMULAGROUPS_HXX
#ifndef SC_FILTER_SHAREDFORMULAGROUPS_HXX
#define SC_FILTER_SHAREDFORMULAGROUPS_HXX
#define SC_FILTER_SHAREDFORMULAGROUPS_HXX
#include "address.hxx"
#include "formulacell.hxx"
#include "tokenarray.hxx"
#include "tokenarray.hxx"
#include <boost/ptr_container/ptr_map.hpp>
#include <boost/ptr_container/ptr_map.hpp>
#include <boost/unordered_map.hpp>
namespace
sc
{
namespace
sc
{
class
SharedFormulaGroups
class
SharedFormulaGroups
{
{
struct
Key
{
size_t
mnId
;
SCCOL
mnCol
;
Key
(
size_t
nId
,
SCCOL
nCol
);
bool
operator
==
(
const
Key
&
rOther
)
const
;
bool
operator
!=
(
const
Key
&
rOther
)
const
;
};
struct
KeyHash
{
size_t
operator
()
(
const
Key
&
rKey
)
const
;
};
typedef
boost
::
ptr_map
<
size_t
,
ScTokenArray
>
StoreType
;
typedef
boost
::
ptr_map
<
size_t
,
ScTokenArray
>
StoreType
;
typedef
boost
::
unordered_map
<
Key
,
ScFormulaCellGroupRef
,
KeyHash
>
ColStoreType
;
ColStoreType
maColStore
;
StoreType
maStore
;
StoreType
maStore
;
public
:
public
:
void
set
(
size_t
nSharedId
,
ScTokenArray
*
pArray
);
void
set
(
size_t
nSharedId
,
ScTokenArray
*
pArray
);
void
set
(
size_t
nSharedId
,
SCCOL
nCol
,
const
ScFormulaCellGroupRef
&
xGroup
);
const
ScTokenArray
*
get
(
size_t
nSharedId
)
const
;
const
ScTokenArray
*
get
(
size_t
nSharedId
)
const
;
ScFormulaCellGroupRef
get
(
size_t
nSharedId
,
SCCOL
nCol
)
const
;
};
};
}
}
...
...
sc/source/filter/orcus/interface.cxx
Dosyayı görüntüle @
512ccd16
...
@@ -340,29 +340,13 @@ void ScOrcusSheet::set_formula_result(os::row_t row, os::col_t col, const char*
...
@@ -340,29 +340,13 @@ void ScOrcusSheet::set_formula_result(os::row_t row, os::col_t col, const char*
pCell
->
SetHybridString
(
aResult
);
pCell
->
SetHybridString
(
aResult
);
}
}
void
ScOrcusSheet
::
set_shared_formula
(
os
::
row_t
/*row*/
,
os
::
col_t
/*col*/
,
os
::
formula_grammar_t
/*grammar*/
,
size_t
/*sindex*/
,
const
char
*
/*p_formula*/
,
size_t
/*n_formula*/
)
{
// TODO: We need to revise this interface in orcus.
}
void
ScOrcusSheet
::
set_shared_formula
(
void
ScOrcusSheet
::
set_shared_formula
(
os
::
row_t
row
,
os
::
col_t
col
,
os
::
formula_grammar_t
grammar
,
size_t
sindex
,
os
::
row_t
row
,
os
::
col_t
col
,
os
::
formula_grammar_t
grammar
,
size_t
sindex
,
const
char
*
p_formula
,
size_t
n_formula
,
const
char
*
p_range
,
size_t
n_range
)
const
char
*
p_formula
,
size_t
n_formula
)
{
{
ScAddress
aPos
(
col
,
row
,
mnTab
);
ScAddress
aPos
(
col
,
row
,
mnTab
);
OUString
aFormula
(
p_formula
,
n_formula
,
RTL_TEXTENCODING_UTF8
);
OUString
aFormula
(
p_formula
,
n_formula
,
RTL_TEXTENCODING_UTF8
);
OUString
aRangeStr
(
p_range
,
n_range
,
RTL_TEXTENCODING_UTF8
);
formula
::
FormulaGrammar
::
Grammar
eGram
=
getCalcGrammarFromOrcus
(
grammar
);
formula
::
FormulaGrammar
::
Grammar
eGram
=
getCalcGrammarFromOrcus
(
grammar
);
formula
::
FormulaGrammar
::
AddressConvention
eConv
=
formula
::
FormulaGrammar
::
extractRefConvention
(
eGram
);
// Convert the shared formula range.
ScRange
aRange
;
sal_uInt16
nRes
=
aRange
.
Parse
(
aRangeStr
,
&
mrDoc
.
getDoc
(),
eConv
);
if
(
!
(
nRes
&
SCA_VALID
))
// Conversion failed.
return
;
// Compile the formula expression into tokens.
// Compile the formula expression into tokens.
ScCompiler
aComp
(
&
mrDoc
.
getDoc
(),
aPos
);
ScCompiler
aComp
(
&
mrDoc
.
getDoc
(),
aPos
);
...
@@ -372,24 +356,9 @@ void ScOrcusSheet::set_shared_formula(
...
@@ -372,24 +356,9 @@ void ScOrcusSheet::set_shared_formula(
// Tokenization failed.
// Tokenization failed.
return
;
return
;
for
(
sal_Int32
nCol
=
aRange
.
aStart
.
Col
();
nCol
<=
aRange
.
aEnd
.
Col
();
++
nCol
)
maFormulaGroups
.
set
(
sindex
,
pArray
);
{
// Create one group per column, since Calc doesn't support shared
// formulas across multiple columns.
ScFormulaCellGroupRef
xNewGroup
(
new
ScFormulaCellGroup
);
xNewGroup
->
mnStart
=
aRange
.
aStart
.
Row
();
xNewGroup
->
mnLength
=
1
;
xNewGroup
->
setCode
(
*
pArray
);
maFormulaGroups
.
set
(
sindex
,
nCol
,
xNewGroup
);
}
ScFormulaCellGroupRef
xGroup
=
maFormulaGroups
.
get
(
sindex
,
aPos
.
Col
());
if
(
!
xGroup
)
return
;
// Generate code for the top cell only.
ScFormulaCell
*
pCell
=
new
ScFormulaCell
(
&
mrDoc
.
getDoc
(),
aPos
,
pArray
);
xGroup
->
compileCode
(
mrDoc
.
getDoc
(),
aPos
,
formula
::
FormulaGrammar
::
GRAM_DEFAULT
);
ScFormulaCell
*
pCell
=
new
ScFormulaCell
(
&
mrDoc
.
getDoc
(),
aPos
,
xGroup
);
mrDoc
.
setFormulaCell
(
aPos
,
pCell
);
mrDoc
.
setFormulaCell
(
aPos
,
pCell
);
cellInserted
();
cellInserted
();
...
@@ -398,16 +367,22 @@ void ScOrcusSheet::set_shared_formula(
...
@@ -398,16 +367,22 @@ void ScOrcusSheet::set_shared_formula(
pCell
->
StartListeningTo
(
&
mrDoc
.
getDoc
());
pCell
->
StartListeningTo
(
&
mrDoc
.
getDoc
());
}
}
void
ScOrcusSheet
::
set_shared_formula
(
os
::
row_t
row
,
os
::
col_t
col
,
os
::
formula_grammar_t
grammar
,
size_t
sindex
,
const
char
*
p_formula
,
size_t
n_formula
,
const
char
*
/*p_range*/
,
size_t
/*n_range*/
)
{
set_shared_formula
(
row
,
col
,
grammar
,
sindex
,
p_formula
,
n_formula
);
}
void
ScOrcusSheet
::
set_shared_formula
(
os
::
row_t
row
,
os
::
col_t
col
,
size_t
sindex
)
void
ScOrcusSheet
::
set_shared_formula
(
os
::
row_t
row
,
os
::
col_t
col
,
size_t
sindex
)
{
{
ScAddress
aPos
(
col
,
row
,
mnTab
);
ScAddress
aPos
(
col
,
row
,
mnTab
);
ScFormulaCellGroupRef
xGroup
=
maFormulaGroups
.
get
(
sindex
,
aPos
.
Col
()
);
const
ScTokenArray
*
pArray
=
maFormulaGroups
.
get
(
sindex
);
if
(
!
xGroup
)
if
(
!
pArray
)
return
;
return
;
xGroup
->
mnLength
=
aPos
.
Row
()
-
xGroup
->
mnStart
+
1
;
ScFormulaCell
*
pCell
=
new
ScFormulaCell
(
&
mrDoc
.
getDoc
(),
aPos
,
pArray
);
ScFormulaCell
*
pCell
=
new
ScFormulaCell
(
&
mrDoc
.
getDoc
(),
aPos
,
xGroup
);
mrDoc
.
setFormulaCell
(
aPos
,
pCell
);
mrDoc
.
setFormulaCell
(
aPos
,
pCell
);
cellInserted
();
cellInserted
();
...
...
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