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
458f22c3
Kaydet (Commit)
458f22c3
authored
Ara 12, 2014
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
reportbuilder: re-add numerous bits of dead code needed by bug fix
Change-Id: Ia0a8b8ec3b4684ad6766467c8e3413f91dc8bf67
üst
541800fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
1 deletion
+87
-1
FormattedTextLayoutController.java
...entaho/layoutprocessor/FormattedTextLayoutController.java
+81
-0
VariablesCollection.java
...e/report/pentaho/layoutprocessor/VariablesCollection.java
+6
-1
No files found.
reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormattedTextLayoutController.java
Dosyayı görüntüle @
458f22c3
...
...
@@ -18,13 +18,18 @@
package
org
.
libreoffice
.
report
.
pentaho
.
layoutprocessor
;
import
org.libreoffice.report.OfficeToken
;
import
org.libreoffice.report.pentaho.OfficeNamespaces
;
import
org.libreoffice.report.pentaho.model.FormattedTextElement
;
import
org.libreoffice.report.pentaho.model.OfficeDocument
;
import
org.libreoffice.report.pentaho.model.OfficeStyle
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.jfree.layouting.util.AttributeMap
;
import
org.jfree.report.DataFlags
;
import
org.jfree.report.DataSourceException
;
import
org.jfree.report.JFreeReportInfo
;
import
org.jfree.report.ReportDataFactoryException
;
import
org.jfree.report.ReportProcessingException
;
import
org.jfree.report.expressions.FormulaExpression
;
...
...
@@ -47,6 +52,27 @@ public class FormattedTextLayoutController
private
static
final
Log
LOGGER
=
LogFactory
.
getLog
(
FormattedTextLayoutController
.
class
);
private
VariablesCollection
getVariablesCollection
()
{
LayoutController
parent
=
getParent
();
while
(
parent
!=
null
)
{
if
(
parent
instanceof
OfficeRepeatingStructureLayoutController
)
{
final
OfficeRepeatingStructureLayoutController
orslc
=
(
OfficeRepeatingStructureLayoutController
)
parent
;
if
(
orslc
.
isNormalFlowProcessing
())
{
return
null
;
}
return
orslc
.
getVariablesCollection
();
}
parent
=
parent
.
getParent
();
}
return
null
;
}
@Override
public
boolean
isValueChanged
()
{
...
...
@@ -128,6 +154,21 @@ public class FormattedTextLayoutController
return
join
(
getFlowController
());
}
private
OfficeDocument
getDocument
()
{
LayoutController
parent
=
getParent
();
while
(
parent
!=
null
)
{
final
Object
node
=
parent
.
getNode
();
if
(
node
instanceof
OfficeDocument
)
{
return
(
OfficeDocument
)
node
;
}
parent
=
parent
.
getParent
();
}
return
null
;
}
private
Element
getParentTableCell
()
{
LayoutController
parent
=
getParent
();
...
...
@@ -143,4 +184,44 @@ public class FormattedTextLayoutController
return
null
;
}
private
String
computeValueStyle
()
{
final
Element
tce
=
getParentTableCell
();
if
(
tce
==
null
)
{
return
null
;
}
final
String
cellStyleName
=
(
String
)
tce
.
getAttribute
(
OfficeNamespaces
.
TABLE_NS
,
OfficeToken
.
STYLE_NAME
);
if
(
cellStyleName
==
null
)
{
return
null
;
}
final
OfficeDocument
document
=
getDocument
();
if
(
document
==
null
)
{
return
null
;
}
final
OfficeStyle
style
=
document
.
getStylesCollection
().
getStyle
(
"table-cell"
,
cellStyleName
);
return
(
String
)
style
.
getAttribute
(
OfficeNamespaces
.
STYLE_NS
,
"data-style-name"
);
}
private
String
computeValueType
()
{
final
Element
tce
=
getParentTableCell
();
if
(
tce
==
null
)
{
// NO particular format means: Fallback to string and hope and pray ..
throw
new
IllegalStateException
(
"A formatted text element must be a child of a Table-Cell."
);
}
final
String
type
=
(
String
)
tce
.
getAttribute
(
OfficeNamespaces
.
OFFICE_NS
,
FormatValueUtility
.
VALUE_TYPE
);
if
(
type
==
null
)
{
LOGGER
.
error
(
"The Table-Cell does not have a office:value attribute defined. Your content will be messed up."
);
return
"string"
;
}
return
type
;
}
}
reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/VariablesCollection.java
Dosyayı görüntüle @
458f22c3
...
...
@@ -68,7 +68,12 @@ public class VariablesCollection
return
namePrefix
;
}
public
String
addVariable
(
final
FormattedTextElement
element
)
{
variables
.
add
(
element
);
final
int
size
=
variables
.
size
();
return
namePrefix
+
size
;
}
public
FormattedTextElement
[]
getVariables
()
{
...
...
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