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
f76b2b3b
Kaydet (Commit)
f76b2b3b
authored
Haz 09, 2015
tarafından
Jan Holesovsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
calc mapmode: Convert ScOutputData::DrawGrid to draw in logic units.
Change-Id: Ie641c31e9023accf9d6bc510f8ca0b25ced3031b
üst
6a55792c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
33 deletions
+62
-33
gridmerg.hxx
sc/source/ui/inc/gridmerg.hxx
+2
-2
output.hxx
sc/source/ui/inc/output.hxx
+1
-1
gridmerg.cxx
sc/source/ui/view/gridmerg.cxx
+18
-2
gridwin4.cxx
sc/source/ui/view/gridwin4.cxx
+9
-4
hdrcont.cxx
sc/source/ui/view/hdrcont.cxx
+2
-2
output.cxx
sc/source/ui/view/output.cxx
+28
-20
printfun.cxx
sc/source/ui/view/printfun.cxx
+2
-2
No files found.
sc/source/ui/inc/gridmerg.hxx
Dosyayı görüntüle @
f76b2b3b
...
...
@@ -42,8 +42,8 @@ public:
ScGridMerger
(
OutputDevice
*
pOutDev
,
long
nOnePixelX
,
long
nOnePixelY
);
~
ScGridMerger
();
void
AddHorLine
(
long
nX1
,
long
nX2
,
long
nY
);
void
AddVerLine
(
long
nX
,
long
nY1
,
long
nY2
);
void
AddHorLine
(
bool
bWorksInPixels
,
long
nX1
,
long
nX2
,
long
nY
);
void
AddVerLine
(
bool
bWorksInPixels
,
long
nX
,
long
nY1
,
long
nY2
);
void
Flush
();
};
...
...
sc/source/ui/inc/output.hxx
Dosyayı görüntüle @
f76b2b3b
...
...
@@ -297,7 +297,7 @@ public:
void
SetSnapPixel
(
bool
bSet
=
true
);
void
DrawGrid
(
bool
bGrid
,
bool
bPage
);
void
DrawGrid
(
vcl
::
RenderContext
&
rRenderContext
,
bool
bGrid
,
bool
bPage
);
void
DrawStrings
(
bool
bPixelToLogic
=
false
);
/// Draw all strings, or provide Rectangle where the text (defined by rAddress) would be drawn.
...
...
sc/source/ui/view/gridmerg.cxx
Dosyayı görüntüle @
f76b2b3b
...
...
@@ -86,8 +86,16 @@ void ScGridMerger::AddLine( long nStart, long nEnd, long nPos )
}
}
void
ScGridMerger
::
AddHorLine
(
long
nX1
,
long
nX2
,
long
nY
)
void
ScGridMerger
::
AddHorLine
(
bool
bWorksInPixels
,
long
nX1
,
long
nX2
,
long
nY
)
{
if
(
bWorksInPixels
)
{
Point
aPoint
(
pDev
->
PixelToLogic
(
Point
(
nX1
,
nY
)));
nX1
=
aPoint
.
X
();
nY
=
aPoint
.
Y
();
nX2
=
pDev
->
PixelToLogic
(
Point
(
nX2
,
0
)).
X
();
}
if
(
bOptimize
)
{
if
(
bVertical
)
...
...
@@ -101,8 +109,16 @@ void ScGridMerger::AddHorLine( long nX1, long nX2, long nY )
pDev
->
DrawLine
(
Point
(
nX1
,
nY
),
Point
(
nX2
,
nY
)
);
}
void
ScGridMerger
::
AddVerLine
(
long
nX
,
long
nY1
,
long
nY2
)
void
ScGridMerger
::
AddVerLine
(
bool
bWorksInPixels
,
long
nX
,
long
nY1
,
long
nY2
)
{
if
(
bWorksInPixels
)
{
Point
aPoint
(
pDev
->
PixelToLogic
(
Point
(
nX
,
nY1
)));
nX
=
aPoint
.
X
();
nY1
=
aPoint
.
Y
();
nY2
=
pDev
->
PixelToLogic
(
Point
(
0
,
nY2
)).
Y
();
}
if
(
bOptimize
)
{
if
(
!
bVertical
)
...
...
sc/source/ui/view/gridwin4.cxx
Dosyayı görüntüle @
f76b2b3b
...
...
@@ -720,15 +720,20 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
aOutputData
.
DrawDocumentBackground
();
pContentDev
->
SetMapMode
(
MAP_PIXEL
);
if
(
bGridFirst
&&
(
bGrid
||
bPage
)
)
aOutputData
.
DrawGrid
(
bGrid
,
bPage
);
aOutputData
.
DrawGrid
(
*
pContentDev
,
bGrid
,
bPage
);
MapMode
aPrevMapMode
=
pContentDev
->
GetMapMode
();
pContentDev
->
SetMapMode
(
MAP_PIXEL
);
aOutputData
.
DrawBackground
();
pContentDev
->
SetMapMode
(
aPrevMapMode
);
if
(
!
bGridFirst
&&
(
bGrid
||
bPage
)
)
aOutputData
.
DrawGrid
(
bGrid
,
bPage
);
aOutputData
.
DrawGrid
(
*
pContentDev
,
bGrid
,
bPage
);
pContentDev
->
SetMapMode
(
MAP_PIXEL
);
if
(
bPageMode
)
{
...
...
sc/source/ui/view/hdrcont.cxx
Dosyayı görüntüle @
f76b2b3b
...
...
@@ -498,9 +498,9 @@ void ScHeaderControl::Paint( vcl::RenderContext& /*rRenderContext*/, const Recta
if
(
nPass
==
(
bNextToMark
?
SC_HDRPAINT_SEL_BOTTOM
:
SC_HDRPAINT_BOTTOM
)
)
{
if
(
bVertical
)
aGrid
.
AddHorLine
(
aScrPos
.
X
(),
aEndPos
.
X
(),
aEndPos
.
Y
()
);
aGrid
.
AddHorLine
(
/* here we work in pixels */
true
,
aScrPos
.
X
(),
aEndPos
.
X
(),
aEndPos
.
Y
()
);
else
aGrid
.
AddVerLine
(
aEndPos
.
X
(),
aScrPos
.
Y
(),
aEndPos
.
Y
()
);
aGrid
.
AddVerLine
(
/* here we work in pixels */
true
,
aEndPos
.
X
(),
aScrPos
.
Y
(),
aEndPos
.
Y
()
);
// thick bottom for hidden rows
// (drawn directly, without aGrid)
...
...
sc/source/ui/view/output.cxx
Dosyayı görüntüle @
f76b2b3b
...
...
@@ -307,7 +307,7 @@ void ScOutputData::SetSyntaxMode( bool bNewMode )
}
}
void
ScOutputData
::
DrawGrid
(
bool
bGrid
,
bool
bPage
)
void
ScOutputData
::
DrawGrid
(
vcl
::
RenderContext
&
rRenderContext
,
bool
bGrid
,
bool
bPage
)
{
SCCOL
nX
;
SCROW
nY
;
...
...
@@ -324,20 +324,16 @@ void ScOutputData::DrawGrid( bool bGrid, bool bPage )
if
(
bPagebreakMode
)
bPage
=
false
;
// no "normal" breaks over the whole width/height
//! um den einen Pixel sieht das Metafile (oder die Druck-Ausgabe) anders aus
//! als die Bildschirmdarstellung, aber wenigstens passen Druck und Metafile zusammen
Size
aOnePixel
=
mpDev
->
PixelToLogic
(
Size
(
1
,
1
));
long
nOneX
=
aOnePixel
.
Width
();
long
nOneY
=
aOnePixel
.
Height
();
if
(
bMetaFile
)
nOneX
=
nOneY
=
1
;
long
nLayoutSign
=
bLayoutRTL
?
-
1
:
1
;
long
nSignedOneX
=
nOneX
*
nLayoutSign
;
// It is a big mess to distinguish when we are using pixels and when logic
// units for drawing. Ultimately we want to work only in the logic units,
// but until that happens, we need to special-case:
// * metafile
// * drawing to the screen - everything is internally counted in pixels there
bool
bWorksInPixels
=
bMetaFile
;
if
(
eType
==
OUTTYPE_WINDOW
)
{
bWorksInPixels
=
true
;
const
svtools
::
ColorConfig
&
rColorCfg
=
SC_MOD
()
->
GetColorConfig
();
aPageColor
.
SetColor
(
rColorCfg
.
GetColorValue
(
svtools
::
CALCPAGEBREAKAUTOMATIC
).
nColor
);
aManualColor
.
SetColor
(
rColorCfg
.
GetColorValue
(
svtools
::
CALCPAGEBREAKMANUAL
).
nColor
);
...
...
@@ -348,8 +344,20 @@ void ScOutputData::DrawGrid( bool bGrid, bool bPage )
aManualColor
=
aGridColor
;
}
mpDev
->
SetLineColor
(
aGridColor
);
ScGridMerger
aGrid
(
mpDev
,
nOneX
,
nOneY
);
long
nOneX
=
1
;
long
nOneY
=
1
;
if
(
!
bWorksInPixels
)
{
Size
aOnePixel
=
rRenderContext
.
PixelToLogic
(
Size
(
1
,
1
));
nOneX
=
aOnePixel
.
Width
();
nOneY
=
aOnePixel
.
Height
();
}
long
nLayoutSign
=
bLayoutRTL
?
-
1
:
1
;
long
nSignedOneX
=
nOneX
*
nLayoutSign
;
rRenderContext
.
SetLineColor
(
aGridColor
);
ScGridMerger
aGrid
(
&
rRenderContext
,
nOneX
,
nOneY
);
// vertical lines
...
...
@@ -383,7 +391,7 @@ void ScOutputData::DrawGrid( bool bGrid, bool bPage )
if
(
nBreak
!=
nBreakOld
)
{
aGrid
.
Flush
();
mpDev
->
SetLineColor
(
(
nBreak
&
BREAK_MANUAL
)
?
aManualColor
:
rRenderContext
.
SetLineColor
(
(
nBreak
&
BREAK_MANUAL
)
?
aManualColor
:
nBreak
?
aPageColor
:
aGridColor
);
nBreakOld
=
nBreak
;
}
...
...
@@ -441,14 +449,14 @@ void ScOutputData::DrawGrid( bool bGrid, bool bPage )
if
(
pThisRowInfo
->
bChanged
&&
!
bHOver
)
{
aGrid
.
AddVerLine
(
nPosX
-
nSignedOneX
,
nPosY
,
nNextY
-
nOneY
);
aGrid
.
AddVerLine
(
bWorksInPixels
,
nPosX
-
nSignedOneX
,
nPosY
,
nNextY
-
nOneY
);
}
nPosY
=
nNextY
;
}
}
else
{
aGrid
.
AddVerLine
(
nPosX
-
nSignedOneX
,
nScrY
,
nScrY
+
nScrH
-
nOneY
);
aGrid
.
AddVerLine
(
bWorksInPixels
,
nPosX
-
nSignedOneX
,
nScrY
,
nScrY
+
nScrH
-
nOneY
);
}
}
}
...
...
@@ -489,7 +497,7 @@ void ScOutputData::DrawGrid( bool bGrid, bool bPage )
if
(
nBreakOld
!=
nBreak
)
{
aGrid
.
Flush
();
mpDev
->
SetLineColor
(
(
nBreak
&
BREAK_MANUAL
)
?
aManualColor
:
rRenderContext
.
SetLineColor
(
(
nBreak
&
BREAK_MANUAL
)
?
aManualColor
:
(
nBreak
)
?
aPageColor
:
aGridColor
);
nBreakOld
=
nBreak
;
}
...
...
@@ -535,7 +543,7 @@ void ScOutputData::DrawGrid( bool bGrid, bool bPage )
}
if
(
!
bVOver
)
{
aGrid
.
AddHorLine
(
nPosX
,
nNextX
-
nSignedOneX
,
nPosY
-
nOneY
);
aGrid
.
AddHorLine
(
bWorksInPixels
,
nPosX
,
nNextX
-
nSignedOneX
,
nPosY
-
nOneY
);
}
}
nPosX
=
nNextX
;
...
...
@@ -543,7 +551,7 @@ void ScOutputData::DrawGrid( bool bGrid, bool bPage )
}
else
{
aGrid
.
AddHorLine
(
nScrX
,
nScrX
+
nScrW
-
nOneX
,
nPosY
-
nOneY
);
aGrid
.
AddHorLine
(
bWorksInPixels
,
nScrX
,
nScrX
+
nScrW
-
nOneX
,
nPosY
-
nOneY
);
}
}
}
...
...
sc/source/ui/view/printfun.cxx
Dosyayı görüntüle @
f76b2b3b
...
...
@@ -563,7 +563,7 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr
if
(
!
bMetaFile
&&
pViewData
)
pDev
->
SetMapMode
(
aMode
);
aOutputData
.
DrawGrid
(
true
,
false
);
// no page breaks
aOutputData
.
DrawGrid
(
*
pDev
,
true
,
false
);
// no page breaks
pDev
->
SetLineColor
(
COL_BLACK
);
...
...
@@ -1619,7 +1619,7 @@ void ScPrintFunc::PrintArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
}
if
(
aTableParam
.
bGrid
)
aOutputData
.
DrawGrid
(
true
,
false
);
// no page breaks
aOutputData
.
DrawGrid
(
*
pDev
,
true
,
false
);
// no page breaks
aOutputData
.
AddPDFNotes
();
// has no effect if not rendering PDF with notes enabled
...
...
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