Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
PIM Calendar Support
Commits
2215dc30
Commit
2215dc30
authored
Jul 03, 2021
by
Glen Ditchfield
🐛
Browse files
Fix line breaks and duplication in printed headers
parent
204d42fa
Pipeline
#68337
passed with stage
in 5 minutes and 36 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/printing/calprintdefaultplugins.cpp
View file @
2215dc30
...
...
@@ -786,10 +786,10 @@ void CalPrintDay::print(QPainter &p, int width, int height)
QString
line1
=
local
.
toString
(
mFromDate
,
QLocale
::
ShortFormat
);
QString
line2
=
local
.
toString
(
mToDate
,
QLocale
::
ShortFormat
);
QString
title
;
if
(
orientation
()
==
QPageLayout
::
Landscap
e
)
{
title
=
i18nc
(
"date from-to"
,
"%1 - %2"
,
line1
,
line2
)
;
if
(
mFromDate
==
mToDat
e
)
{
title
=
line1
;
}
else
{
title
=
i18nc
(
"date from-
\n
to"
,
"%1
-
\n
%2"
,
line1
,
line2
);
title
=
i18nc
(
"date from-to"
,
"%1
\u2013
%2"
,
line1
,
line2
);
}
drawHeader
(
p
,
title
,
mFromDate
,
QDate
(),
headerBox
);
if
(
mDayPrintType
==
Filofax
)
{
...
...
@@ -1039,11 +1039,7 @@ void CalPrintWeek::print(QPainter &p, int width, int height)
do
{
line1
=
local
.
toString
(
curWeek
.
addDays
(
-
6
),
QLocale
::
ShortFormat
);
line2
=
local
.
toString
(
curWeek
,
QLocale
::
ShortFormat
);
if
(
orientation
()
==
QPageLayout
::
Landscape
)
{
title
=
i18nc
(
"date from-to"
,
"%1 - %2"
,
line1
,
line2
);
}
else
{
title
=
i18nc
(
"date from-
\n
to"
,
"%1 -
\n
%2"
,
line1
,
line2
);
}
title
=
i18nc
(
"date from-to"
,
"%1\u2013%2"
,
line1
,
line2
);
drawHeader
(
p
,
title
,
curWeek
.
addDays
(
-
6
),
QDate
(),
headerBox
);
drawWeek
(
p
,
curWeek
,
mStartTime
,
mEndTime
,
weekBox
,
mSingleLineLimit
,
mShowNoteLines
,
...
...
@@ -1066,9 +1062,9 @@ void CalPrintWeek::print(QPainter &p, int width, int height)
line1
=
local
.
toString
(
curWeek
.
addDays
(
-
6
),
QLocale
::
ShortFormat
);
line2
=
local
.
toString
(
curWeek
,
QLocale
::
ShortFormat
);
if
(
orientation
()
==
QPageLayout
::
Landscape
)
{
title
=
i18nc
(
"date from - to (week number)"
,
"%1
-
%2 (Week %3)"
,
line1
,
line2
,
curWeek
.
weekNumber
());
title
=
i18nc
(
"date from - to (week number)"
,
"%1
\u2013
%2 (Week %3)"
,
line1
,
line2
,
curWeek
.
weekNumber
());
}
else
{
title
=
i18nc
(
"date from -
\n
to
(week number)"
,
"%1
-
\n
%2
(Week %3)"
,
line1
,
line2
,
curWeek
.
weekNumber
());
title
=
i18nc
(
"date from -
to
\\
n
(week number)"
,
"%1
\u2013%2
\n
(Week %3)"
,
line1
,
line2
,
curWeek
.
weekNumber
());
}
drawHeader
(
p
,
title
,
curWeek
,
QDate
(),
headerBox
);
...
...
src/printing/calprintpluginbase.cpp
View file @
2215dc30
...
...
@@ -2233,13 +2233,13 @@ void CalPrintPluginBase::drawSplitHeaderRight(QPainter &p, QDate fd, QDate td, Q
QLocale
locale
;
if
(
fd
.
month
()
==
td
.
month
())
{
title
=
i18nc
(
"Date range: Month dayStart - dayEnd"
,
"%1 %2
-
%3"
,
"%1 %2
\u2013
%3"
,
locale
.
monthName
(
fd
.
month
(),
QLocale
::
LongFormat
),
locale
.
toString
(
fd
,
QStringLiteral
(
"dd"
)),
locale
.
toString
(
td
,
QStringLiteral
(
"dd"
)));
}
else
{
title
=
i18nc
(
"Date range: monthStart dayStart - monthEnd dayEnd"
,
"%1 %2
-
%3 %4"
,
"%1 %2
\u2013
%3 %4"
,
locale
.
monthName
(
fd
.
month
(),
QLocale
::
LongFormat
),
locale
.
toString
(
fd
,
QStringLiteral
(
"dd"
)),
locale
.
monthName
(
td
.
month
(),
QLocale
::
LongFormat
),
...
...
src/printing/yearprint.cpp
View file @
2215dc30
...
...
@@ -139,12 +139,7 @@ void CalPrintYear::print(QPainter &p, int width, int height)
end
=
end
.
addDays
(
-
1
);
QString
stdate
=
locale
.
toString
(
start
,
QLocale
::
ShortFormat
);
QString
endate
=
locale
.
toString
(
end
,
QLocale
::
ShortFormat
);
QString
title
;
if
(
orientation
()
==
QPageLayout
::
Landscape
)
{
title
=
i18nc
(
"date from - to"
,
"%1 - %2"
,
stdate
,
endate
);
}
else
{
title
=
i18nc
(
"date from -
\n
to"
,
"%1 -
\n
%2"
,
stdate
,
endate
);
}
QString
title
=
i18nc
(
"date from-to"
,
"%1\u2013%2"
,
stdate
,
endate
);
drawHeader
(
p
,
title
,
start
.
addMonths
(
-
1
),
start
.
addMonths
(
monthsPerPage
),
headerBox
);
QRect
monthesBox
(
headerBox
);
...
...
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