dbaccess/source/ui/app/AppController.cxx                        |    2 
 icon-themes/breeze/res/recentdoc_pin.png                        |binary
 icon-themes/breeze/res/recentdoc_pin_highlighted.png            |binary
 icon-themes/breeze_dark/res/recentdoc_pin.png                   |binary
 icon-themes/breeze_dark/res/recentdoc_pin_highlighted.png       |binary
 icon-themes/breeze_dark_svg/res/recentdoc_pin.svg               |    1 
 icon-themes/breeze_dark_svg/res/recentdoc_pin_highlighted.svg   |   14 
 icon-themes/breeze_svg/res/recentdoc_pin.svg                    |    1 
 icon-themes/breeze_svg/res/recentdoc_pin_highlighted.svg        |   14 
 icon-themes/colibre/res/recentdoc_pin.png                       |binary
 icon-themes/colibre/res/recentdoc_pin_highlighted.png           |binary
 icon-themes/colibre_dark/res/recentdoc_pin.png                  |binary
 icon-themes/colibre_dark/res/recentdoc_pin_highlighted.png      |binary
 icon-themes/colibre_dark_svg/res/recentdoc_pin.svg              |    1 
 icon-themes/colibre_dark_svg/res/recentdoc_pin_highlighted.svg  |   14 
 icon-themes/colibre_svg/res/recentdoc_pin.svg                   |    1 
 icon-themes/colibre_svg/res/recentdoc_pin_highlighted.svg       |   14 
 icon-themes/elementary/res/recentdoc_pin.png                    |binary
 icon-themes/elementary/res/recentdoc_pin_highlighted.png        |binary
 icon-themes/elementary_svg/res/recentdoc_pin.svg                |    1 
 icon-themes/elementary_svg/res/recentdoc_pin_highlighted.svg    |   14 
 icon-themes/sifr/res/recentdoc_pin.png                          |binary
 icon-themes/sifr/res/recentdoc_pin_highlighted.png              |binary
 icon-themes/sifr_dark/res/recentdoc_pin.png                     |binary
 icon-themes/sifr_dark/res/recentdoc_pin_highlighted.png         |binary
 icon-themes/sifr_dark_svg/res/recentdoc_pin.svg                 |    1 
 icon-themes/sifr_dark_svg/res/recentdoc_pin_highlighted.svg     |   14 
 icon-themes/sifr_svg/res/recentdoc_pin.svg                      |    1 
 icon-themes/sifr_svg/res/recentdoc_pin_highlighted.svg          |   14 
 icon-themes/sukapura/res/pin_document.png                       |binary
 icon-themes/sukapura/res/recentdoc_pin.png                      |binary
 icon-themes/sukapura/res/recentdoc_pin_highlighted.png          |binary
 icon-themes/sukapura/res/unpin_document.png                     |binary
 icon-themes/sukapura_dark/res/pin_document.png                  |binary
 icon-themes/sukapura_dark/res/recentdoc_pin.png                 |binary
 icon-themes/sukapura_dark/res/recentdoc_pin_highlighted.png     |binary
 icon-themes/sukapura_dark/res/unpin_document.png                |binary
 icon-themes/sukapura_dark_svg/res/pin_document.svg              |    7 
 icon-themes/sukapura_dark_svg/res/recentdoc_pin.svg             |    1 
 icon-themes/sukapura_dark_svg/res/recentdoc_pin_highlighted.svg |   14 
 icon-themes/sukapura_dark_svg/res/unpin_document.svg            |   17 +
 icon-themes/sukapura_svg/res/recentdoc_pin.svg                  |    1 
 icon-themes/sukapura_svg/res/recentdoc_pin_highlighted.svg      |   14 
 include/sfx2/thumbnailviewitem.hxx                              |   10 
 include/unotools/historyoptions.hxx                             |   25 +
 officecfg/registry/schema/org/openoffice/Office/Histories.xcs   |    5 
 sfx2/inc/bitmaps.hlst                                           |    2 
 sfx2/inc/recentdocsview.hxx                                     |    3 
 sfx2/source/appl/newhelp.cxx                                    |    4 
 sfx2/source/appl/sfxpicklist.cxx                                |    3 
 sfx2/source/control/recentdocsview.cxx                          |   10 
 sfx2/source/control/recentdocsviewitem.cxx                      |   14 
 sfx2/source/control/recentdocsviewitem.hxx                      |    6 
 sfx2/source/control/thumbnailview.cxx                           |   14 
 sfx2/source/control/thumbnailviewitem.cxx                       |   47 ++
 unotools/source/config/historyoptions.cxx                       |  165 
++++++++--
 56 files changed, 421 insertions(+), 48 deletions(-)

New commits:
commit 436f3f8eb5b45620842351a1f29ba49571043515
Author:     Andreas Heinisch <andreas.heini...@yahoo.de>
AuthorDate: Mon May 22 22:46:55 2023 +0200
Commit:     Andreas Heinisch <andreas.heini...@yahoo.de>
CommitDate: Tue Jun 6 07:08:09 2023 +0200

    tdf#38742 - Start Center: introduce push pins to favorite documents
    
    Change-Id: I879e4d93e1da222d9acabb776552ca1cf819574b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152136
    Tested-by: Andreas Heinisch <andreas.heini...@yahoo.de>
    Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de>

diff --git a/dbaccess/source/ui/app/AppController.cxx 
b/dbaccess/source/ui/app/AppController.cxx
index ad18bff5892c..175f56b39724 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -361,7 +361,7 @@ void SAL_CALL OApplicationController::disposing()
                             aURL.GetURLNoPass( 
INetURLObject::DecodeMechanism::NONE ),
                             aFilter,
                             getStrippedDatabaseName(),
-                            std::nullopt, std::nullopt);
+                            std::nullopt, std::nullopt, std::nullopt);
 
                     // add to recent document list
                     if ( aURL.GetProtocol() == INetProtocol::File )
diff --git a/icon-themes/breeze/res/recentdoc_pin.png 
b/icon-themes/breeze/res/recentdoc_pin.png
new file mode 100755
index 000000000000..a022906f65c6
Binary files /dev/null and b/icon-themes/breeze/res/recentdoc_pin.png differ
diff --git a/icon-themes/breeze/res/recentdoc_pin_highlighted.png 
b/icon-themes/breeze/res/recentdoc_pin_highlighted.png
new file mode 100755
index 000000000000..877b80bfafe0
Binary files /dev/null and 
b/icon-themes/breeze/res/recentdoc_pin_highlighted.png differ
diff --git a/icon-themes/breeze_dark/res/recentdoc_pin.png 
b/icon-themes/breeze_dark/res/recentdoc_pin.png
new file mode 100755
index 000000000000..a022906f65c6
Binary files /dev/null and b/icon-themes/breeze_dark/res/recentdoc_pin.png 
differ
diff --git a/icon-themes/breeze_dark/res/recentdoc_pin_highlighted.png 
b/icon-themes/breeze_dark/res/recentdoc_pin_highlighted.png
new file mode 100755
index 000000000000..877b80bfafe0
Binary files /dev/null and 
b/icon-themes/breeze_dark/res/recentdoc_pin_highlighted.png differ
diff --git a/icon-themes/breeze_dark_svg/res/recentdoc_pin.svg 
b/icon-themes/breeze_dark_svg/res/recentdoc_pin.svg
new file mode 100755
index 000000000000..a4578679d18d
--- /dev/null
+++ b/icon-themes/breeze_dark_svg/res/recentdoc_pin.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg 
xmlns="http://www.w3.org/2000/svg"; viewBox="0 0 64 
64"><defs><style>.cls-1{fill:#231f20;}</style></defs><title>20 Education Icon 
Set 64px</title><g id="Layer_2" data-name="Layer 2"><path class="cls-1" 
d="M40.73,26a4.84,4.84,0,0,0-4.4-1L20.51,13.88a2.82,2.82,0,0,0-.6-2.51c-1.38-1.39-4.45-.57-6.85,1.83s-3.21,5.46-1.83,6.85a2.82,2.82,0,0,0,2.51.59L24.81,36.46a4.86,4.86,0,0,0,1,4.4c1.61,1.61,4.54,1.48,7.55,0l20,12.5L40.67,33.52C42.2,30.52,42.33,27.59,40.73,26Z"/></g></svg>
\ No newline at end of file
diff --git a/icon-themes/breeze_dark_svg/res/recentdoc_pin_highlighted.svg 
b/icon-themes/breeze_dark_svg/res/recentdoc_pin_highlighted.svg
new file mode 100755
index 000000000000..fd8b1afa65ee
--- /dev/null
+++ b/icon-themes/breeze_dark_svg/res/recentdoc_pin_highlighted.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 23.0.0, SVG Export Plug-In . SVG Version: 
6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
+        viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" 
xml:space="preserve">
+<path 
d="M51.53,50.31L40.55,33.28c1.34-2.89,1.23-5.6-0.31-7.14c-1-1-2.49-1.41-4.24-1.19l-13.27-9.28c0.05-0.99-0.22-1.81-0.8-2.39
+       
c-0.8-0.8-2.03-1.03-3.45-0.65c-1.27,0.34-2.59,1.14-3.7,2.26c-2.46,2.46-3.17,5.6-1.61,7.15c0.58,0.58,1.4,0.86,2.39,0.8
+       
l9.28,13.27c-0.22,1.75,0.19,3.24,1.19,4.24c1.54,1.54,4.26,1.65,7.16,0.3l17.26,10.76c0.13,0.08,0.28,0.12,0.42,0.12
+       c0.21,0,0.42-0.08,0.57-0.24C51.7,51.04,51.74,50.63,51.53,50.31z 
M33.65,39.07c-0.13-0.08-0.28-0.12-0.42-0.12
+       
c-0.12,0-0.25,0.03-0.36,0.09c-2.41,1.23-4.6,1.3-5.71,0.2c-0.87-0.87-0.86-2.2-0.69-3.17c0.04-0.21-0.01-0.42-0.13-0.59
+       
l-9.74-13.92c-0.18-0.25-0.48-0.38-0.78-0.33c-0.48,0.08-1.13,0.09-1.52-0.3c-0.78-0.78-0.3-2.98,1.61-4.89
+       
c0.91-0.91,2-1.58,2.99-1.85c0.84-0.22,1.53-0.14,1.91,0.23c0.39,0.39,0.38,1.04,0.3,1.52c-0.05,0.3,0.08,0.61,0.33,0.78l13.92,9.74
+       
c0.17,0.12,0.39,0.17,0.59,0.13c0.96-0.17,2.29-0.18,3.17,0.69c0,0,0,0,0,0c1.11,1.11,1.03,3.29-0.19,5.7
+       c-0.13,0.25-0.11,0.56,0.04,0.8l9.29,14.4L33.65,39.07z"/>
+</svg>
diff --git a/icon-themes/breeze_svg/res/recentdoc_pin.svg 
b/icon-themes/breeze_svg/res/recentdoc_pin.svg
new file mode 100755
index 000000000000..a4578679d18d
--- /dev/null
+++ b/icon-themes/breeze_svg/res/recentdoc_pin.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg 
xmlns="http://www.w3.org/2000/svg"; viewBox="0 0 64 
64"><defs><style>.cls-1{fill:#231f20;}</style></defs><title>20 Education Icon 
Set 64px</title><g id="Layer_2" data-name="Layer 2"><path class="cls-1" 
d="M40.73,26a4.84,4.84,0,0,0-4.4-1L20.51,13.88a2.82,2.82,0,0,0-.6-2.51c-1.38-1.39-4.45-.57-6.85,1.83s-3.21,5.46-1.83,6.85a2.82,2.82,0,0,0,2.51.59L24.81,36.46a4.86,4.86,0,0,0,1,4.4c1.61,1.61,4.54,1.48,7.55,0l20,12.5L40.67,33.52C42.2,30.52,42.33,27.59,40.73,26Z"/></g></svg>
\ No newline at end of file
diff --git a/icon-themes/breeze_svg/res/recentdoc_pin_highlighted.svg 
b/icon-themes/breeze_svg/res/recentdoc_pin_highlighted.svg
new file mode 100755
index 000000000000..fd8b1afa65ee
--- /dev/null
+++ b/icon-themes/breeze_svg/res/recentdoc_pin_highlighted.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 23.0.0, SVG Export Plug-In . SVG Version: 
6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
+        viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" 
xml:space="preserve">
+<path 
d="M51.53,50.31L40.55,33.28c1.34-2.89,1.23-5.6-0.31-7.14c-1-1-2.49-1.41-4.24-1.19l-13.27-9.28c0.05-0.99-0.22-1.81-0.8-2.39
+       
c-0.8-0.8-2.03-1.03-3.45-0.65c-1.27,0.34-2.59,1.14-3.7,2.26c-2.46,2.46-3.17,5.6-1.61,7.15c0.58,0.58,1.4,0.86,2.39,0.8
+       
l9.28,13.27c-0.22,1.75,0.19,3.24,1.19,4.24c1.54,1.54,4.26,1.65,7.16,0.3l17.26,10.76c0.13,0.08,0.28,0.12,0.42,0.12
+       c0.21,0,0.42-0.08,0.57-0.24C51.7,51.04,51.74,50.63,51.53,50.31z 
M33.65,39.07c-0.13-0.08-0.28-0.12-0.42-0.12
+       
c-0.12,0-0.25,0.03-0.36,0.09c-2.41,1.23-4.6,1.3-5.71,0.2c-0.87-0.87-0.86-2.2-0.69-3.17c0.04-0.21-0.01-0.42-0.13-0.59
+       
l-9.74-13.92c-0.18-0.25-0.48-0.38-0.78-0.33c-0.48,0.08-1.13,0.09-1.52-0.3c-0.78-0.78-0.3-2.98,1.61-4.89
+       
c0.91-0.91,2-1.58,2.99-1.85c0.84-0.22,1.53-0.14,1.91,0.23c0.39,0.39,0.38,1.04,0.3,1.52c-0.05,0.3,0.08,0.61,0.33,0.78l13.92,9.74
+       
c0.17,0.12,0.39,0.17,0.59,0.13c0.96-0.17,2.29-0.18,3.17,0.69c0,0,0,0,0,0c1.11,1.11,1.03,3.29-0.19,5.7
+       c-0.13,0.25-0.11,0.56,0.04,0.8l9.29,14.4L33.65,39.07z"/>
+</svg>
diff --git a/icon-themes/colibre/res/recentdoc_pin.png 
b/icon-themes/colibre/res/recentdoc_pin.png
new file mode 100755
index 000000000000..a022906f65c6
Binary files /dev/null and b/icon-themes/colibre/res/recentdoc_pin.png differ
diff --git a/icon-themes/colibre/res/recentdoc_pin_highlighted.png 
b/icon-themes/colibre/res/recentdoc_pin_highlighted.png
new file mode 100755
index 000000000000..877b80bfafe0
Binary files /dev/null and 
b/icon-themes/colibre/res/recentdoc_pin_highlighted.png differ
diff --git a/icon-themes/colibre_dark/res/recentdoc_pin.png 
b/icon-themes/colibre_dark/res/recentdoc_pin.png
new file mode 100755
index 000000000000..a022906f65c6
Binary files /dev/null and b/icon-themes/colibre_dark/res/recentdoc_pin.png 
differ
diff --git a/icon-themes/colibre_dark/res/recentdoc_pin_highlighted.png 
b/icon-themes/colibre_dark/res/recentdoc_pin_highlighted.png
new file mode 100755
index 000000000000..877b80bfafe0
Binary files /dev/null and 
b/icon-themes/colibre_dark/res/recentdoc_pin_highlighted.png differ
diff --git a/icon-themes/colibre_dark_svg/res/recentdoc_pin.svg 
b/icon-themes/colibre_dark_svg/res/recentdoc_pin.svg
new file mode 100755
index 000000000000..a4578679d18d
--- /dev/null
+++ b/icon-themes/colibre_dark_svg/res/recentdoc_pin.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg 
xmlns="http://www.w3.org/2000/svg"; viewBox="0 0 64 
64"><defs><style>.cls-1{fill:#231f20;}</style></defs><title>20 Education Icon 
Set 64px</title><g id="Layer_2" data-name="Layer 2"><path class="cls-1" 
d="M40.73,26a4.84,4.84,0,0,0-4.4-1L20.51,13.88a2.82,2.82,0,0,0-.6-2.51c-1.38-1.39-4.45-.57-6.85,1.83s-3.21,5.46-1.83,6.85a2.82,2.82,0,0,0,2.51.59L24.81,36.46a4.86,4.86,0,0,0,1,4.4c1.61,1.61,4.54,1.48,7.55,0l20,12.5L40.67,33.52C42.2,30.52,42.33,27.59,40.73,26Z"/></g></svg>
\ No newline at end of file
diff --git a/icon-themes/colibre_dark_svg/res/recentdoc_pin_highlighted.svg 
b/icon-themes/colibre_dark_svg/res/recentdoc_pin_highlighted.svg
new file mode 100755
index 000000000000..fd8b1afa65ee
--- /dev/null
+++ b/icon-themes/colibre_dark_svg/res/recentdoc_pin_highlighted.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 23.0.0, SVG Export Plug-In . SVG Version: 
6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
+        viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" 
xml:space="preserve">
+<path 
d="M51.53,50.31L40.55,33.28c1.34-2.89,1.23-5.6-0.31-7.14c-1-1-2.49-1.41-4.24-1.19l-13.27-9.28c0.05-0.99-0.22-1.81-0.8-2.39
+       
c-0.8-0.8-2.03-1.03-3.45-0.65c-1.27,0.34-2.59,1.14-3.7,2.26c-2.46,2.46-3.17,5.6-1.61,7.15c0.58,0.58,1.4,0.86,2.39,0.8
+       
l9.28,13.27c-0.22,1.75,0.19,3.24,1.19,4.24c1.54,1.54,4.26,1.65,7.16,0.3l17.26,10.76c0.13,0.08,0.28,0.12,0.42,0.12
+       c0.21,0,0.42-0.08,0.57-0.24C51.7,51.04,51.74,50.63,51.53,50.31z 
M33.65,39.07c-0.13-0.08-0.28-0.12-0.42-0.12
+       
c-0.12,0-0.25,0.03-0.36,0.09c-2.41,1.23-4.6,1.3-5.71,0.2c-0.87-0.87-0.86-2.2-0.69-3.17c0.04-0.21-0.01-0.42-0.13-0.59
+       
l-9.74-13.92c-0.18-0.25-0.48-0.38-0.78-0.33c-0.48,0.08-1.13,0.09-1.52-0.3c-0.78-0.78-0.3-2.98,1.61-4.89
+       
c0.91-0.91,2-1.58,2.99-1.85c0.84-0.22,1.53-0.14,1.91,0.23c0.39,0.39,0.38,1.04,0.3,1.52c-0.05,0.3,0.08,0.61,0.33,0.78l13.92,9.74
+       
c0.17,0.12,0.39,0.17,0.59,0.13c0.96-0.17,2.29-0.18,3.17,0.69c0,0,0,0,0,0c1.11,1.11,1.03,3.29-0.19,5.7
+       c-0.13,0.25-0.11,0.56,0.04,0.8l9.29,14.4L33.65,39.07z"/>
+</svg>
diff --git a/icon-themes/colibre_svg/res/recentdoc_pin.svg 
b/icon-themes/colibre_svg/res/recentdoc_pin.svg
new file mode 100755
index 000000000000..a4578679d18d
--- /dev/null
+++ b/icon-themes/colibre_svg/res/recentdoc_pin.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg 
xmlns="http://www.w3.org/2000/svg"; viewBox="0 0 64 
64"><defs><style>.cls-1{fill:#231f20;}</style></defs><title>20 Education Icon 
Set 64px</title><g id="Layer_2" data-name="Layer 2"><path class="cls-1" 
d="M40.73,26a4.84,4.84,0,0,0-4.4-1L20.51,13.88a2.82,2.82,0,0,0-.6-2.51c-1.38-1.39-4.45-.57-6.85,1.83s-3.21,5.46-1.83,6.85a2.82,2.82,0,0,0,2.51.59L24.81,36.46a4.86,4.86,0,0,0,1,4.4c1.61,1.61,4.54,1.48,7.55,0l20,12.5L40.67,33.52C42.2,30.52,42.33,27.59,40.73,26Z"/></g></svg>
\ No newline at end of file
diff --git a/icon-themes/colibre_svg/res/recentdoc_pin_highlighted.svg 
b/icon-themes/colibre_svg/res/recentdoc_pin_highlighted.svg
new file mode 100755
index 000000000000..fd8b1afa65ee
--- /dev/null
+++ b/icon-themes/colibre_svg/res/recentdoc_pin_highlighted.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 23.0.0, SVG Export Plug-In . SVG Version: 
6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
+        viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" 
xml:space="preserve">
+<path 
d="M51.53,50.31L40.55,33.28c1.34-2.89,1.23-5.6-0.31-7.14c-1-1-2.49-1.41-4.24-1.19l-13.27-9.28c0.05-0.99-0.22-1.81-0.8-2.39
+       
c-0.8-0.8-2.03-1.03-3.45-0.65c-1.27,0.34-2.59,1.14-3.7,2.26c-2.46,2.46-3.17,5.6-1.61,7.15c0.58,0.58,1.4,0.86,2.39,0.8
+       
l9.28,13.27c-0.22,1.75,0.19,3.24,1.19,4.24c1.54,1.54,4.26,1.65,7.16,0.3l17.26,10.76c0.13,0.08,0.28,0.12,0.42,0.12
+       c0.21,0,0.42-0.08,0.57-0.24C51.7,51.04,51.74,50.63,51.53,50.31z 
M33.65,39.07c-0.13-0.08-0.28-0.12-0.42-0.12
+       
c-0.12,0-0.25,0.03-0.36,0.09c-2.41,1.23-4.6,1.3-5.71,0.2c-0.87-0.87-0.86-2.2-0.69-3.17c0.04-0.21-0.01-0.42-0.13-0.59
+       
l-9.74-13.92c-0.18-0.25-0.48-0.38-0.78-0.33c-0.48,0.08-1.13,0.09-1.52-0.3c-0.78-0.78-0.3-2.98,1.61-4.89
+       
c0.91-0.91,2-1.58,2.99-1.85c0.84-0.22,1.53-0.14,1.91,0.23c0.39,0.39,0.38,1.04,0.3,1.52c-0.05,0.3,0.08,0.61,0.33,0.78l13.92,9.74
+       
c0.17,0.12,0.39,0.17,0.59,0.13c0.96-0.17,2.29-0.18,3.17,0.69c0,0,0,0,0,0c1.11,1.11,1.03,3.29-0.19,5.7
+       c-0.13,0.25-0.11,0.56,0.04,0.8l9.29,14.4L33.65,39.07z"/>
+</svg>
diff --git a/icon-themes/elementary/res/recentdoc_pin.png 
b/icon-themes/elementary/res/recentdoc_pin.png
new file mode 100755
index 000000000000..a022906f65c6
Binary files /dev/null and b/icon-themes/elementary/res/recentdoc_pin.png differ
diff --git a/icon-themes/elementary/res/recentdoc_pin_highlighted.png 
b/icon-themes/elementary/res/recentdoc_pin_highlighted.png
new file mode 100755
index 000000000000..877b80bfafe0
Binary files /dev/null and 
b/icon-themes/elementary/res/recentdoc_pin_highlighted.png differ
diff --git a/icon-themes/elementary_svg/res/recentdoc_pin.svg 
b/icon-themes/elementary_svg/res/recentdoc_pin.svg
new file mode 100755
index 000000000000..a4578679d18d
--- /dev/null
+++ b/icon-themes/elementary_svg/res/recentdoc_pin.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg 
xmlns="http://www.w3.org/2000/svg"; viewBox="0 0 64 
64"><defs><style>.cls-1{fill:#231f20;}</style></defs><title>20 Education Icon 
Set 64px</title><g id="Layer_2" data-name="Layer 2"><path class="cls-1" 
d="M40.73,26a4.84,4.84,0,0,0-4.4-1L20.51,13.88a2.82,2.82,0,0,0-.6-2.51c-1.38-1.39-4.45-.57-6.85,1.83s-3.21,5.46-1.83,6.85a2.82,2.82,0,0,0,2.51.59L24.81,36.46a4.86,4.86,0,0,0,1,4.4c1.61,1.61,4.54,1.48,7.55,0l20,12.5L40.67,33.52C42.2,30.52,42.33,27.59,40.73,26Z"/></g></svg>
\ No newline at end of file
diff --git a/icon-themes/elementary_svg/res/recentdoc_pin_highlighted.svg 
b/icon-themes/elementary_svg/res/recentdoc_pin_highlighted.svg
new file mode 100755
index 000000000000..fd8b1afa65ee
--- /dev/null
+++ b/icon-themes/elementary_svg/res/recentdoc_pin_highlighted.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 23.0.0, SVG Export Plug-In . SVG Version: 
6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
+        viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" 
xml:space="preserve">
+<path 
d="M51.53,50.31L40.55,33.28c1.34-2.89,1.23-5.6-0.31-7.14c-1-1-2.49-1.41-4.24-1.19l-13.27-9.28c0.05-0.99-0.22-1.81-0.8-2.39
+       
c-0.8-0.8-2.03-1.03-3.45-0.65c-1.27,0.34-2.59,1.14-3.7,2.26c-2.46,2.46-3.17,5.6-1.61,7.15c0.58,0.58,1.4,0.86,2.39,0.8
+       
l9.28,13.27c-0.22,1.75,0.19,3.24,1.19,4.24c1.54,1.54,4.26,1.65,7.16,0.3l17.26,10.76c0.13,0.08,0.28,0.12,0.42,0.12
+       c0.21,0,0.42-0.08,0.57-0.24C51.7,51.04,51.74,50.63,51.53,50.31z 
M33.65,39.07c-0.13-0.08-0.28-0.12-0.42-0.12
+       
c-0.12,0-0.25,0.03-0.36,0.09c-2.41,1.23-4.6,1.3-5.71,0.2c-0.87-0.87-0.86-2.2-0.69-3.17c0.04-0.21-0.01-0.42-0.13-0.59
+       
l-9.74-13.92c-0.18-0.25-0.48-0.38-0.78-0.33c-0.48,0.08-1.13,0.09-1.52-0.3c-0.78-0.78-0.3-2.98,1.61-4.89
+       
c0.91-0.91,2-1.58,2.99-1.85c0.84-0.22,1.53-0.14,1.91,0.23c0.39,0.39,0.38,1.04,0.3,1.52c-0.05,0.3,0.08,0.61,0.33,0.78l13.92,9.74
+       
c0.17,0.12,0.39,0.17,0.59,0.13c0.96-0.17,2.29-0.18,3.17,0.69c0,0,0,0,0,0c1.11,1.11,1.03,3.29-0.19,5.7
+       c-0.13,0.25-0.11,0.56,0.04,0.8l9.29,14.4L33.65,39.07z"/>
+</svg>
diff --git a/icon-themes/sifr/res/recentdoc_pin.png 
b/icon-themes/sifr/res/recentdoc_pin.png
new file mode 100755
index 000000000000..a022906f65c6
Binary files /dev/null and b/icon-themes/sifr/res/recentdoc_pin.png differ
diff --git a/icon-themes/sifr/res/recentdoc_pin_highlighted.png 
b/icon-themes/sifr/res/recentdoc_pin_highlighted.png
new file mode 100755
index 000000000000..877b80bfafe0
Binary files /dev/null and b/icon-themes/sifr/res/recentdoc_pin_highlighted.png 
differ
diff --git a/icon-themes/sifr_dark/res/recentdoc_pin.png 
b/icon-themes/sifr_dark/res/recentdoc_pin.png
new file mode 100755
index 000000000000..a022906f65c6
Binary files /dev/null and b/icon-themes/sifr_dark/res/recentdoc_pin.png differ
diff --git a/icon-themes/sifr_dark/res/recentdoc_pin_highlighted.png 
b/icon-themes/sifr_dark/res/recentdoc_pin_highlighted.png
new file mode 100755
index 000000000000..877b80bfafe0
Binary files /dev/null and 
b/icon-themes/sifr_dark/res/recentdoc_pin_highlighted.png differ
diff --git a/icon-themes/sifr_dark_svg/res/recentdoc_pin.svg 
b/icon-themes/sifr_dark_svg/res/recentdoc_pin.svg
new file mode 100755
index 000000000000..a4578679d18d
--- /dev/null
+++ b/icon-themes/sifr_dark_svg/res/recentdoc_pin.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg 
xmlns="http://www.w3.org/2000/svg"; viewBox="0 0 64 
64"><defs><style>.cls-1{fill:#231f20;}</style></defs><title>20 Education Icon 
Set 64px</title><g id="Layer_2" data-name="Layer 2"><path class="cls-1" 
d="M40.73,26a4.84,4.84,0,0,0-4.4-1L20.51,13.88a2.82,2.82,0,0,0-.6-2.51c-1.38-1.39-4.45-.57-6.85,1.83s-3.21,5.46-1.83,6.85a2.82,2.82,0,0,0,2.51.59L24.81,36.46a4.86,4.86,0,0,0,1,4.4c1.61,1.61,4.54,1.48,7.55,0l20,12.5L40.67,33.52C42.2,30.52,42.33,27.59,40.73,26Z"/></g></svg>
\ No newline at end of file
diff --git a/icon-themes/sifr_dark_svg/res/recentdoc_pin_highlighted.svg 
b/icon-themes/sifr_dark_svg/res/recentdoc_pin_highlighted.svg
new file mode 100755
index 000000000000..fd8b1afa65ee
--- /dev/null
+++ b/icon-themes/sifr_dark_svg/res/recentdoc_pin_highlighted.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 23.0.0, SVG Export Plug-In . SVG Version: 
6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
+        viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" 
xml:space="preserve">
+<path 
d="M51.53,50.31L40.55,33.28c1.34-2.89,1.23-5.6-0.31-7.14c-1-1-2.49-1.41-4.24-1.19l-13.27-9.28c0.05-0.99-0.22-1.81-0.8-2.39
+       
c-0.8-0.8-2.03-1.03-3.45-0.65c-1.27,0.34-2.59,1.14-3.7,2.26c-2.46,2.46-3.17,5.6-1.61,7.15c0.58,0.58,1.4,0.86,2.39,0.8
+       
l9.28,13.27c-0.22,1.75,0.19,3.24,1.19,4.24c1.54,1.54,4.26,1.65,7.16,0.3l17.26,10.76c0.13,0.08,0.28,0.12,0.42,0.12
+       c0.21,0,0.42-0.08,0.57-0.24C51.7,51.04,51.74,50.63,51.53,50.31z 
M33.65,39.07c-0.13-0.08-0.28-0.12-0.42-0.12
+       
c-0.12,0-0.25,0.03-0.36,0.09c-2.41,1.23-4.6,1.3-5.71,0.2c-0.87-0.87-0.86-2.2-0.69-3.17c0.04-0.21-0.01-0.42-0.13-0.59
+       
l-9.74-13.92c-0.18-0.25-0.48-0.38-0.78-0.33c-0.48,0.08-1.13,0.09-1.52-0.3c-0.78-0.78-0.3-2.98,1.61-4.89
+       
c0.91-0.91,2-1.58,2.99-1.85c0.84-0.22,1.53-0.14,1.91,0.23c0.39,0.39,0.38,1.04,0.3,1.52c-0.05,0.3,0.08,0.61,0.33,0.78l13.92,9.74
+       
c0.17,0.12,0.39,0.17,0.59,0.13c0.96-0.17,2.29-0.18,3.17,0.69c0,0,0,0,0,0c1.11,1.11,1.03,3.29-0.19,5.7
+       c-0.13,0.25-0.11,0.56,0.04,0.8l9.29,14.4L33.65,39.07z"/>
+</svg>
diff --git a/icon-themes/sifr_svg/res/recentdoc_pin.svg 
b/icon-themes/sifr_svg/res/recentdoc_pin.svg
new file mode 100755
index 000000000000..a4578679d18d
--- /dev/null
+++ b/icon-themes/sifr_svg/res/recentdoc_pin.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg 
xmlns="http://www.w3.org/2000/svg"; viewBox="0 0 64 
64"><defs><style>.cls-1{fill:#231f20;}</style></defs><title>20 Education Icon 
Set 64px</title><g id="Layer_2" data-name="Layer 2"><path class="cls-1" 
d="M40.73,26a4.84,4.84,0,0,0-4.4-1L20.51,13.88a2.82,2.82,0,0,0-.6-2.51c-1.38-1.39-4.45-.57-6.85,1.83s-3.21,5.46-1.83,6.85a2.82,2.82,0,0,0,2.51.59L24.81,36.46a4.86,4.86,0,0,0,1,4.4c1.61,1.61,4.54,1.48,7.55,0l20,12.5L40.67,33.52C42.2,30.52,42.33,27.59,40.73,26Z"/></g></svg>
\ No newline at end of file
diff --git a/icon-themes/sifr_svg/res/recentdoc_pin_highlighted.svg 
b/icon-themes/sifr_svg/res/recentdoc_pin_highlighted.svg
new file mode 100755
index 000000000000..fd8b1afa65ee
--- /dev/null
+++ b/icon-themes/sifr_svg/res/recentdoc_pin_highlighted.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 23.0.0, SVG Export Plug-In . SVG Version: 
6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
+        viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" 
xml:space="preserve">
+<path 
d="M51.53,50.31L40.55,33.28c1.34-2.89,1.23-5.6-0.31-7.14c-1-1-2.49-1.41-4.24-1.19l-13.27-9.28c0.05-0.99-0.22-1.81-0.8-2.39
+       
c-0.8-0.8-2.03-1.03-3.45-0.65c-1.27,0.34-2.59,1.14-3.7,2.26c-2.46,2.46-3.17,5.6-1.61,7.15c0.58,0.58,1.4,0.86,2.39,0.8
+       
l9.28,13.27c-0.22,1.75,0.19,3.24,1.19,4.24c1.54,1.54,4.26,1.65,7.16,0.3l17.26,10.76c0.13,0.08,0.28,0.12,0.42,0.12
+       c0.21,0,0.42-0.08,0.57-0.24C51.7,51.04,51.74,50.63,51.53,50.31z 
M33.65,39.07c-0.13-0.08-0.28-0.12-0.42-0.12
+       
c-0.12,0-0.25,0.03-0.36,0.09c-2.41,1.23-4.6,1.3-5.71,0.2c-0.87-0.87-0.86-2.2-0.69-3.17c0.04-0.21-0.01-0.42-0.13-0.59
+       
l-9.74-13.92c-0.18-0.25-0.48-0.38-0.78-0.33c-0.48,0.08-1.13,0.09-1.52-0.3c-0.78-0.78-0.3-2.98,1.61-4.89
+       
c0.91-0.91,2-1.58,2.99-1.85c0.84-0.22,1.53-0.14,1.91,0.23c0.39,0.39,0.38,1.04,0.3,1.52c-0.05,0.3,0.08,0.61,0.33,0.78l13.92,9.74
+       
c0.17,0.12,0.39,0.17,0.59,0.13c0.96-0.17,2.29-0.18,3.17,0.69c0,0,0,0,0,0c1.11,1.11,1.03,3.29-0.19,5.7
+       c-0.13,0.25-0.11,0.56,0.04,0.8l9.29,14.4L33.65,39.07z"/>
+</svg>
diff --git a/icon-themes/sukapura/res/pin_document.png 
b/icon-themes/sukapura/res/pin_document.png
new file mode 100755
index 000000000000..59c3038c7a59
Binary files /dev/null and b/icon-themes/sukapura/res/pin_document.png differ
diff --git a/icon-themes/sukapura/res/recentdoc_pin.png 
b/icon-themes/sukapura/res/recentdoc_pin.png
new file mode 100755
index 000000000000..a022906f65c6
Binary files /dev/null and b/icon-themes/sukapura/res/recentdoc_pin.png differ
diff --git a/icon-themes/sukapura/res/recentdoc_pin_highlighted.png 
b/icon-themes/sukapura/res/recentdoc_pin_highlighted.png
new file mode 100755
index 000000000000..877b80bfafe0
Binary files /dev/null and 
b/icon-themes/sukapura/res/recentdoc_pin_highlighted.png differ
diff --git a/icon-themes/sukapura/res/unpin_document.png 
b/icon-themes/sukapura/res/unpin_document.png
new file mode 100755
index 000000000000..0b6fa261c62e
Binary files /dev/null and b/icon-themes/sukapura/res/unpin_document.png differ
diff --git a/icon-themes/sukapura_dark/res/pin_document.png 
b/icon-themes/sukapura_dark/res/pin_document.png
new file mode 100755
index 000000000000..59c3038c7a59
Binary files /dev/null and b/icon-themes/sukapura_dark/res/pin_document.png 
differ
diff --git a/icon-themes/sukapura_dark/res/recentdoc_pin.png 
b/icon-themes/sukapura_dark/res/recentdoc_pin.png
new file mode 100755
index 000000000000..a022906f65c6
Binary files /dev/null and b/icon-themes/sukapura_dark/res/recentdoc_pin.png 
differ
diff --git a/icon-themes/sukapura_dark/res/recentdoc_pin_highlighted.png 
b/icon-themes/sukapura_dark/res/recentdoc_pin_highlighted.png
new file mode 100755
index 000000000000..877b80bfafe0
Binary files /dev/null and 
b/icon-themes/sukapura_dark/res/recentdoc_pin_highlighted.png differ
diff --git a/icon-themes/sukapura_dark/res/unpin_document.png 
b/icon-themes/sukapura_dark/res/unpin_document.png
new file mode 100755
index 000000000000..0b6fa261c62e
Binary files /dev/null and b/icon-themes/sukapura_dark/res/unpin_document.png 
differ
diff --git a/icon-themes/sukapura_dark_svg/res/pin_document.svg 
b/icon-themes/sukapura_dark_svg/res/pin_document.svg
new file mode 100755
index 000000000000..881bbb3cdd11
--- /dev/null
+++ b/icon-themes/sukapura_dark_svg/res/pin_document.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; width="24px" height="24px" 
viewBox="0 0 24 24" version="1.1">
+<g id="surface1">
+<path style=" 
stroke:none;fill-rule:nonzero;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 
23.558594 6.242188 L 17.761719 0.441406 C 17.179688 -0.140625 16.238281 
-0.140625 15.652344 0.4375 C 15.574219 0.515625 15.507812 0.601562 15.445312 
0.695312 L 11.320312 7.179688 C 9.453125 6.734375 7.484375 7.023438 5.820312 
7.984375 C 5.109375 8.398438 4.871094 9.3125 5.289062 10.023438 C 5.351562 
10.132812 5.429688 10.234375 5.519531 10.324219 L 13.675781 18.476562 C 
14.003906 18.800781 14.460938 18.957031 14.917969 18.902344 C 15.378906 
18.84375 15.789062 18.578125 16.023438 18.175781 C 16.988281 16.515625 
17.277344 14.542969 16.828125 12.675781 L 23.308594 8.550781 C 24.003906 
8.109375 24.210938 7.191406 23.769531 6.496094 C 23.710938 6.402344 23.640625 
6.320312 23.566406 6.242188 Z M 17.320312 3.375 L 15.191406 6.730469 C 
15.035156 6.960938 14.730469 7.027344 14.496094 6.882812 C 14.261719 6.734375 
14.191406 6.425781 14.339844 6.191406 L 16.476562 2.835938 C 16.613281 2.597656 
16.921875 2.5117
 19 17.160156 2.652344 C 17.402344 2.789062 17.484375 3.097656 17.347656 
3.339844 Z M 17.320312 3.375 "/>
+<path style=" 
stroke:none;fill-rule:nonzero;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 6.417969 
15.449219 L 0.441406 21.425781 C -0.148438 22.015625 -0.148438 22.96875 
0.441406 23.558594 L 0.441406 23.5625 C 1.035156 24.140625 1.984375 24.140625 
2.578125 23.5625 L 8.554688 17.585938 C 9.152344 17.003906 9.167969 16.050781 
8.589844 15.449219 C 8.011719 14.851562 7.054688 14.835938 6.457031 15.414062 Z 
M 6.417969 15.449219 "/>
+</g>
+</svg>
diff --git a/icon-themes/sukapura_dark_svg/res/recentdoc_pin.svg 
b/icon-themes/sukapura_dark_svg/res/recentdoc_pin.svg
new file mode 100755
index 000000000000..a4578679d18d
--- /dev/null
+++ b/icon-themes/sukapura_dark_svg/res/recentdoc_pin.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg 
xmlns="http://www.w3.org/2000/svg"; viewBox="0 0 64 
64"><defs><style>.cls-1{fill:#231f20;}</style></defs><title>20 Education Icon 
Set 64px</title><g id="Layer_2" data-name="Layer 2"><path class="cls-1" 
d="M40.73,26a4.84,4.84,0,0,0-4.4-1L20.51,13.88a2.82,2.82,0,0,0-.6-2.51c-1.38-1.39-4.45-.57-6.85,1.83s-3.21,5.46-1.83,6.85a2.82,2.82,0,0,0,2.51.59L24.81,36.46a4.86,4.86,0,0,0,1,4.4c1.61,1.61,4.54,1.48,7.55,0l20,12.5L40.67,33.52C42.2,30.52,42.33,27.59,40.73,26Z"/></g></svg>
\ No newline at end of file
diff --git a/icon-themes/sukapura_dark_svg/res/recentdoc_pin_highlighted.svg 
b/icon-themes/sukapura_dark_svg/res/recentdoc_pin_highlighted.svg
new file mode 100755
index 000000000000..fd8b1afa65ee
--- /dev/null
+++ b/icon-themes/sukapura_dark_svg/res/recentdoc_pin_highlighted.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 23.0.0, SVG Export Plug-In . SVG Version: 
6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
+        viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" 
xml:space="preserve">
+<path 
d="M51.53,50.31L40.55,33.28c1.34-2.89,1.23-5.6-0.31-7.14c-1-1-2.49-1.41-4.24-1.19l-13.27-9.28c0.05-0.99-0.22-1.81-0.8-2.39
+       
c-0.8-0.8-2.03-1.03-3.45-0.65c-1.27,0.34-2.59,1.14-3.7,2.26c-2.46,2.46-3.17,5.6-1.61,7.15c0.58,0.58,1.4,0.86,2.39,0.8
+       
l9.28,13.27c-0.22,1.75,0.19,3.24,1.19,4.24c1.54,1.54,4.26,1.65,7.16,0.3l17.26,10.76c0.13,0.08,0.28,0.12,0.42,0.12
+       c0.21,0,0.42-0.08,0.57-0.24C51.7,51.04,51.74,50.63,51.53,50.31z 
M33.65,39.07c-0.13-0.08-0.28-0.12-0.42-0.12
+       
c-0.12,0-0.25,0.03-0.36,0.09c-2.41,1.23-4.6,1.3-5.71,0.2c-0.87-0.87-0.86-2.2-0.69-3.17c0.04-0.21-0.01-0.42-0.13-0.59
+       
l-9.74-13.92c-0.18-0.25-0.48-0.38-0.78-0.33c-0.48,0.08-1.13,0.09-1.52-0.3c-0.78-0.78-0.3-2.98,1.61-4.89
+       
c0.91-0.91,2-1.58,2.99-1.85c0.84-0.22,1.53-0.14,1.91,0.23c0.39,0.39,0.38,1.04,0.3,1.52c-0.05,0.3,0.08,0.61,0.33,0.78l13.92,9.74
+       
c0.17,0.12,0.39,0.17,0.59,0.13c0.96-0.17,2.29-0.18,3.17,0.69c0,0,0,0,0,0c1.11,1.11,1.03,3.29-0.19,5.7
+       c-0.13,0.25-0.11,0.56,0.04,0.8l9.29,14.4L33.65,39.07z"/>
+</svg>
diff --git a/icon-themes/sukapura_dark_svg/res/unpin_document.svg 
b/icon-themes/sukapura_dark_svg/res/unpin_document.svg
new file mode 100755
index 000000000000..89a49ea1e267
--- /dev/null
+++ b/icon-themes/sukapura_dark_svg/res/unpin_document.svg
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 24.1.1, SVG Export Plug-In . SVG Version: 
6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
+        viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" 
xml:space="preserve">
+<g>
+       <path 
d="M505.36,146.92L365.11,6.68c-8.9-8.9-22.82-8.9-31.72,0c-1.67,1.67-42.29,43.41-26.71,97.95l-63.44,63.44
+               
c-35.07-10.57-124.66-28.94-190.89,37.29c-8.9,8.91-8.9,22.82,0,31.72l95.72,95.72L6.72,474.16c-8.91,8.9-8.91,22.82,0,31.72
+               
c4.45,3.9,10.02,6.12,15.58,6.12s11.13-2.23,15.58-6.68l141.36-141.36l95.72,95.72c4.46,4.45,10.02,6.68,15.59,6.68
+               
s11.13-2.23,15.58-6.68c66.22-66.22,47.86-156.38,37.29-190.89l63.44-63.45c54.54,15.59,95.72-25.04,97.95-26.71
+               C514.26,169.74,514.26,155.82,505.36,146.92z 
M411.3,159.16c-8.35-3.89-18.36-2.23-25.04,4.45l-83.48,83.48
+               
c-6.12,6.12-8.35,16.14-5.01,23.93c0,0,10.02,25.04,11.68,57.32c1.67,32.28-5.01,59.55-20.03,82.36l-94.61-93.49l-94.61-94.61
+               
c59.55-40.07,136.35-10.02,139.68-8.35c8.35,3.34,17.81,1.67,24.49-5.01l83.48-83.48c6.68-6.68,8.35-16.7,4.45-25.04
+               
c-7.79-16.7-5.01-31.72,0-43.41l102.4,102.4C443.58,164.17,428,166.96,411.3,159.16z
 M279.41,279.93
+               
c0.55,1.67,7.79,17.81,7.23,35.06c0,10.58-8.91,18.92-19.48,18.92h-0.56c-10.57-0.56-19.48-9.46-18.92-20.04
+               
c0-7.23-2.78-15.58-3.9-18.36c-4.45-10.02,0-21.15,10.02-25.6C263.82,266.02,275.51,269.91,279.41,279.93z"/>
+</g>
+</svg>
diff --git a/icon-themes/sukapura_svg/res/recentdoc_pin.svg 
b/icon-themes/sukapura_svg/res/recentdoc_pin.svg
new file mode 100755
index 000000000000..a4578679d18d
--- /dev/null
+++ b/icon-themes/sukapura_svg/res/recentdoc_pin.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg 
xmlns="http://www.w3.org/2000/svg"; viewBox="0 0 64 
64"><defs><style>.cls-1{fill:#231f20;}</style></defs><title>20 Education Icon 
Set 64px</title><g id="Layer_2" data-name="Layer 2"><path class="cls-1" 
d="M40.73,26a4.84,4.84,0,0,0-4.4-1L20.51,13.88a2.82,2.82,0,0,0-.6-2.51c-1.38-1.39-4.45-.57-6.85,1.83s-3.21,5.46-1.83,6.85a2.82,2.82,0,0,0,2.51.59L24.81,36.46a4.86,4.86,0,0,0,1,4.4c1.61,1.61,4.54,1.48,7.55,0l20,12.5L40.67,33.52C42.2,30.52,42.33,27.59,40.73,26Z"/></g></svg>
\ No newline at end of file
diff --git a/icon-themes/sukapura_svg/res/recentdoc_pin_highlighted.svg 
b/icon-themes/sukapura_svg/res/recentdoc_pin_highlighted.svg
new file mode 100755
index 000000000000..fd8b1afa65ee
--- /dev/null
+++ b/icon-themes/sukapura_svg/res/recentdoc_pin_highlighted.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 23.0.0, SVG Export Plug-In . SVG Version: 
6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
+        viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" 
xml:space="preserve">
+<path 
d="M51.53,50.31L40.55,33.28c1.34-2.89,1.23-5.6-0.31-7.14c-1-1-2.49-1.41-4.24-1.19l-13.27-9.28c0.05-0.99-0.22-1.81-0.8-2.39
+       
c-0.8-0.8-2.03-1.03-3.45-0.65c-1.27,0.34-2.59,1.14-3.7,2.26c-2.46,2.46-3.17,5.6-1.61,7.15c0.58,0.58,1.4,0.86,2.39,0.8
+       
l9.28,13.27c-0.22,1.75,0.19,3.24,1.19,4.24c1.54,1.54,4.26,1.65,7.16,0.3l17.26,10.76c0.13,0.08,0.28,0.12,0.42,0.12
+       c0.21,0,0.42-0.08,0.57-0.24C51.7,51.04,51.74,50.63,51.53,50.31z 
M33.65,39.07c-0.13-0.08-0.28-0.12-0.42-0.12
+       
c-0.12,0-0.25,0.03-0.36,0.09c-2.41,1.23-4.6,1.3-5.71,0.2c-0.87-0.87-0.86-2.2-0.69-3.17c0.04-0.21-0.01-0.42-0.13-0.59
+       
l-9.74-13.92c-0.18-0.25-0.48-0.38-0.78-0.33c-0.48,0.08-1.13,0.09-1.52-0.3c-0.78-0.78-0.3-2.98,1.61-4.89
+       
c0.91-0.91,2-1.58,2.99-1.85c0.84-0.22,1.53-0.14,1.91,0.23c0.39,0.39,0.38,1.04,0.3,1.52c-0.05,0.3,0.08,0.61,0.33,0.78l13.92,9.74
+       
c0.17,0.12,0.39,0.17,0.59,0.13c0.96-0.17,2.29-0.18,3.17,0.69c0,0,0,0,0,0c1.11,1.11,1.03,3.29-0.19,5.7
+       c-0.13,0.25-0.11,0.56,0.04,0.8l9.29,14.4L33.65,39.07z"/>
+</svg>
diff --git a/include/sfx2/thumbnailviewitem.hxx 
b/include/sfx2/thumbnailviewitem.hxx
index bd72ee30c9d6..e34985c799d3 100644
--- a/include/sfx2/thumbnailviewitem.hxx
+++ b/include/sfx2/thumbnailviewitem.hxx
@@ -72,11 +72,16 @@ public:
     bool mbBorder;
     bool mbSelected;
     bool mbHover;
+    bool mbPinned;
     BitmapEx maPreview1;
     OUString maTitle;
     OUString maHelpText;
     css::uno::Reference< css::accessibility::XAccessible > mxAcc;
 
+    bool mbPinnedDocumentHighlighted;
+    BitmapEx maPinnedDocumentBitmap;
+    BitmapEx maPinnedDocumentBitmapHiglighted;
+
     ThumbnailViewItem(ThumbnailView& rView, sal_uInt16 nId);
 
     virtual ~ThumbnailViewItem ();
@@ -93,6 +98,10 @@ public:
 
     void setHighlight (bool state);
 
+    bool isPinned () const { return mbPinned; }
+
+    void setPinned (bool state);
+
     /** Updates own highlight status based on the aPoint position.
 
         Returns rectangle that needs to be invalidated.
@@ -132,6 +141,7 @@ protected:
 
     Point maTextPos;
     Point maPrev1Pos;
+    Point maPinPos;
     tools::Rectangle maDrawArea;
 };
 
diff --git a/include/unotools/historyoptions.hxx 
b/include/unotools/historyoptions.hxx
index 1f743e062cb2..8cf1aa744e31 100644
--- a/include/unotools/historyoptions.hxx
+++ b/include/unotools/historyoptions.hxx
@@ -44,7 +44,7 @@ namespace SvtHistoryOptions
 
         @param      eHistory select right history.
     */
-    UNOTOOLS_DLLPUBLIC void Clear(EHistoryType eHistory);
+    UNOTOOLS_DLLPUBLIC void Clear(EHistoryType eHistory, bool bClearPinned = 
false);
 
     /** Return the complete specified history list.
 
@@ -59,6 +59,7 @@ namespace SvtHistoryOptions
         OUString sPassword;
         OUString sThumbnail;
         bool isReadOnly = false;
+        bool isPinned = false;
     };
     UNOTOOLS_DLLPUBLIC std::vector< HistoryItem > GetList(EHistoryType 
eHistory);
 
@@ -66,18 +67,26 @@ namespace SvtHistoryOptions
 
         The oldest entry is deleted automatically when the size reaches the 
maximum.
 
-        @param eHistory  select right history.
-        @param sURL      URL to save in history
-        @param sFilter   filter name to save in history
-        @param sTitle    document title to save in history
+        @param eHistory    select right history.
+        @param sURL        URL to save in history
+        @param sFilter     filter name to save in history
+        @param sTitle      document title to save in history
+        @param sThumbnail  base64 encoded thumbnail of the item
+        @param oIsReadOnly item was opened editable or read-only
+        @param oIsPinned   item is pinned in the user-interface
     */
-    UNOTOOLS_DLLPUBLIC void AppendItem(EHistoryType eHistory,
-            const OUString& sURL, const OUString& sFilter, const OUString& 
sTitle,
-            const std::optional<OUString>& sThumbnail, std::optional<bool> 
oIsReadOnly);
+    UNOTOOLS_DLLPUBLIC void AppendItem(EHistoryType eHistory, const OUString& 
sURL,
+                                       const OUString& sFilter, const 
OUString& sTitle,
+                                       const std::optional<OUString>& 
sThumbnail,
+                                       std::optional<bool> oIsReadOnly,
+                                       std::optional<bool> oIsPinned);
 
     /** Delete item from the specified list.
     */
     UNOTOOLS_DLLPUBLIC void DeleteItem(EHistoryType eHistory, const OUString& 
sURL);
+
+    // tdf#38742 - toggle pinned state of an item
+    UNOTOOLS_DLLPUBLIC void TogglePinItem(EHistoryType eHistory, const 
OUString& sURL);
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/officecfg/registry/schema/org/openoffice/Office/Histories.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Histories.xcs
index 0f4894477d4c..e01534fb9aea 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Histories.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Histories.xcs
@@ -52,6 +52,11 @@
           <desc>Stores whether the document was opened editable or 
read-only.</desc>
         </info>
       </prop>
+      <prop oor:name="Pinned" oor:type="xs:boolean">
+        <info>
+          <desc>Stores whether the document is pinned in the 
user-interface.</desc>
+        </info>
+      </prop>
     </group>
     <group oor:name="HistoryOrder">
       <info>
diff --git a/sfx2/inc/bitmaps.hlst b/sfx2/inc/bitmaps.hlst
index 84b1e2946427..70597c881300 100644
--- a/sfx2/inc/bitmaps.hlst
+++ b/sfx2/inc/bitmaps.hlst
@@ -67,6 +67,8 @@ inline constexpr OUStringLiteral SFX_THUMBNAIL_BASE_256 = 
u"res/base_thumbnail_2
 
 inline constexpr OUStringLiteral BMP_RECENTDOC_REMOVE = 
u"res/recentdoc_remove.png";
 inline constexpr OUStringLiteral BMP_RECENTDOC_REMOVE_HIGHLIGHTED = 
u"res/recentdoc_remove_highlighted.png";
+inline constexpr OUStringLiteral BMP_PIN_DOC = u"res/recentdoc_pin.png";
+inline constexpr OUStringLiteral BMP_PIN_DOC_HIGHLIGHTED = 
u"res/recentdoc_pin_highlighted.png";
 inline constexpr OUStringLiteral BMP_DEFAULT = u"res/templatestar.png";
 
 inline constexpr OUStringLiteral BMP_128X128_CALC_DOC = 
u"sfx2/res/128x128_calc_doc-p.png";
diff --git a/sfx2/inc/recentdocsview.hxx b/sfx2/inc/recentdocsview.hxx
index 119bf6ee7267..38199818a34e 100644
--- a/sfx2/inc/recentdocsview.hxx
+++ b/sfx2/inc/recentdocsview.hxx
@@ -63,7 +63,8 @@ public:
     RecentDocsView(std::unique_ptr<weld::ScrolledWindow> xWindow, 
std::unique_ptr<weld::Menu> xMenu);
     virtual ~RecentDocsView() override;
 
-    void insertItem(const OUString &rURL, const OUString &rTitle, const 
OUString& rThumbnail, bool isReadOnly, sal_uInt16 nId);
+    void insertItem(const OUString& rURL, const OUString& rTitle, const 
OUString& rThumbnail,
+                    bool isReadOnly, bool isPinned, sal_uInt16 nId);
 
     static bool typeMatchesExtension(ApplicationType type, std::u16string_view 
rExt);
 
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index aae69dff4db2..5c2d7cf6c0e1 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -1174,7 +1174,9 @@ BookmarksTabPage_Impl::~BookmarksTabPage_Impl()
     const sal_Int32 nCount = m_xBookmarksBox->n_children();
     for (sal_Int32 i = 0; i < nCount; ++i)
     {
-        SvtHistoryOptions::AppendItem(EHistoryType::HelpBookmarks, 
m_xBookmarksBox->get_id(i), "", m_xBookmarksBox->get_text(i), std::nullopt, 
std::nullopt);
+        SvtHistoryOptions::AppendItem(EHistoryType::HelpBookmarks, 
m_xBookmarksBox->get_id(i), "",
+                                      m_xBookmarksBox->get_text(i), 
std::nullopt, std::nullopt,
+                                      std::nullopt);
     }
 
     m_xBookmarksBox.reset();
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index fb676d981d35..2451a8d0cad8 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -131,7 +131,8 @@ void SfxPickListImpl::AddDocumentToPickList( const 
SfxObjectShell* pDocSh )
             aFilter,
             aTitle,
             aThumbnail,
-            oIsReadOnly);
+            oIsReadOnly,
+            std::nullopt);
 
     if ( aURL.GetProtocol() == INetProtocol::File )
         Application::AddToRecentDocumentList( aURL.GetURLNoPass( 
INetURLObject::DecodeMechanism::NONE ),
diff --git a/sfx2/source/control/recentdocsview.cxx 
b/sfx2/source/control/recentdocsview.cxx
index c7c9efeb1c16..c094a4c966f8 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -144,9 +144,12 @@ bool RecentDocsView::isAcceptedFile(const INetURLObject& 
rURL) const
            (mnFileTypes & ApplicationType::TYPE_OTHER    && 
typeMatchesExtension(ApplicationType::TYPE_OTHER,   aExt));
 }
 
-void RecentDocsView::insertItem(const OUString &rURL, const OUString &rTitle, 
const OUString& rThumbnail, bool isReadOnly, sal_uInt16 nId)
+void RecentDocsView::insertItem(const OUString& rURL, const OUString& rTitle,
+                                const OUString& rThumbnail, bool isReadOnly, 
bool isPinned,
+                                sal_uInt16 nId)
 {
-    AppendItem( std::make_unique<RecentDocsViewItem>(*this, rURL, rTitle, 
rThumbnail, nId, mnItemMaxSize, isReadOnly) );
+    AppendItem(std::make_unique<RecentDocsViewItem>(*this, rURL, rTitle, 
rThumbnail, nId,
+                                                    mnItemMaxSize, isReadOnly, 
isPinned));
 }
 
 void RecentDocsView::Reload()
@@ -168,7 +171,8 @@ void RecentDocsView::Reload()
         //Remove extension from url's last segment and use it as title
         const OUString aTitle = aURLObj.GetBase(); 
//DecodeMechanism::WithCharset
 
-        insertItem(aURL, aTitle, rRecentEntry.sThumbnail, 
rRecentEntry.isReadOnly, i+1);
+        insertItem(aURL, aTitle, rRecentEntry.sThumbnail, 
rRecentEntry.isReadOnly,
+                   rRecentEntry.isPinned, i + 1);
     }
 
     CalculateItemPositions();
diff --git a/sfx2/source/control/recentdocsviewitem.cxx 
b/sfx2/source/control/recentdocsviewitem.cxx
index 9af2c114988f..57a670b37c53 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -123,11 +123,12 @@ BitmapEx getModuleOverlay(std::u16string_view rURL)
 RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView &rView, const 
OUString &rURL,
     const OUString &rTitle, std::u16string_view const sThumbnailBase64,
         sal_uInt16 const nId, tools::Long const nThumbnailSize,
-        bool const isReadOnly)
+        bool const isReadOnly, bool const isPinned)
     : ThumbnailViewItem(rView, nId),
       mrParentView(rView),
       maURL(rURL),
       m_isReadOnly(isReadOnly),
+      m_isPinned(isPinned),
       m_bRemoveIconHighlighted(false),
       m_aRemoveRecentBitmap(BMP_RECENTDOC_REMOVE),
       m_aRemoveRecentBitmapHighlighted(BMP_RECENTDOC_REMOVE_HIGHLIGHTED)
@@ -230,6 +231,7 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView 
&rView, const OUStri
 
     maTitle = aTitle;
     maPreview1 = aThumbnail;
+    mbPinned = m_isPinned;
 }
 
 ::tools::Rectangle RecentDocsViewItem::updateHighlight(bool bVisible, const 
Point& rPoint)
@@ -273,7 +275,7 @@ void 
RecentDocsViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProc
 {
     ThumbnailViewItem::Paint(pProcessor, pAttrs);
 
-    // paint the remove icon when highlighted
+    // paint the remove icon when hovered
     if (isHighlighted())
     {
         drawinglayer::primitive2d::Primitive2DContainer aSeq(1);
@@ -299,6 +301,14 @@ void RecentDocsViewItem::MouseButtonUp(const MouseEvent& 
rMEvt)
             return;
         }
 
+        const ::tools::Rectangle aPinPosRectangle(maPinPos, 
maPinnedDocumentBitmap.GetSizePixel());
+        if (aPinPosRectangle.Contains(rMEvt.GetPosPixel()))
+        {
+            SvtHistoryOptions::TogglePinItem(EHistoryType::PickList, maURL);
+            mrParent.Reload();
+            return;
+        }
+
         OpenDocument();
         return;
     }
diff --git a/sfx2/source/control/recentdocsviewitem.hxx 
b/sfx2/source/control/recentdocsviewitem.hxx
index 3f5f6d3faab2..0fe399a1fe3b 100644
--- a/sfx2/source/control/recentdocsviewitem.hxx
+++ b/sfx2/source/control/recentdocsviewitem.hxx
@@ -20,8 +20,9 @@ namespace sfx2
 class RecentDocsViewItem final : public ThumbnailViewItem
 {
 public:
-    RecentDocsViewItem(sfx2::RecentDocsView &rView, const OUString &rURL,
-        const OUString &rTitle, std::u16string_view sThumbnailBase64, 
sal_uInt16 nId, tools::Long nThumbnailSize, bool isReadOnly);
+    RecentDocsViewItem(sfx2::RecentDocsView& rView, const OUString& rURL, 
const OUString& rTitle,
+                       std::u16string_view sThumbnailBase64, sal_uInt16 nId,
+                       tools::Long nThumbnailSize, bool isReadOnly, bool 
isPinned);
 
     /** Updates own highlight status based on the aPoint position.
 
@@ -51,6 +52,7 @@ private:
     OUString maURL;
 
     bool m_isReadOnly = false;
+    bool m_isPinned = false;
 
     OUString m_sHelpText;
 
diff --git a/sfx2/source/control/thumbnailview.cxx 
b/sfx2/source/control/thumbnailview.cxx
index e48dea30e7d5..ca839162f0a2 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -411,11 +411,25 @@ void ThumbnailView::CalculateItemPositions(bool 
bScrollBarUsed)
     // If want also draw parts of items in the last line,
     // then we add one more line if parts of this line are visible
 
+    bool bPinnedItems = true;
     size_t nCurCount = 0;
     for ( size_t i = 0; i < nItemCount; i++ )
     {
         ThumbnailViewItem *const pItem = mFilteredItemList[i];
 
+        // tdf#38742 - show pinned items in a separate line
+        if (bPinnedItems && !pItem->isPinned())
+        {
+            bPinnedItems = false;
+            // Start a new line only if the entire line is not filled
+            if ((nCurCount + 1) % mnCols && nCurCount > nFirstItem)
+            {
+                x = nStartX;
+                y += mnItemHeight + nVItemSpace;
+            }
+            nCurCount = 0;
+        }
+
         if ((nCurCount >= nFirstItem) && (nCurCount < nLastItem))
         {
             if( !pItem->isVisible())
diff --git a/sfx2/source/control/thumbnailviewitem.cxx 
b/sfx2/source/control/thumbnailviewitem.cxx
index 8b2b8a4ea2a4..077a9b3c6bcc 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -33,10 +33,15 @@
 #include <drawinglayer/primitive2d/textlayoutdevice.hxx>
 #include <drawinglayer/primitive2d/textprimitive2d.hxx>
 #include <drawinglayer/processor2d/baseprocessor2d.hxx>
+#include <vcl/event.hxx>
 #include <vcl/graph.hxx>
 #include <vcl/mnemonic.hxx>
 #include <vcl/outdev.hxx>
 #include <vcl/texteng.hxx>
+#include <bitmaps.hlst>
+#include <drawinglayer/primitive2d/discretebitmapprimitive2d.hxx>
+#include <unotools/historyoptions.hxx>
+
 
 using namespace basegfx;
 using namespace basegfx::utils;
@@ -51,6 +56,10 @@ ThumbnailViewItem::ThumbnailViewItem(ThumbnailView& rView, 
sal_uInt16 nId)
     , mbBorder(true)
     , mbSelected(false)
     , mbHover(false)
+    , mbPinned(false)
+    , mbPinnedDocumentHighlighted(false)
+    , maPinnedDocumentBitmap(BMP_PIN_DOC)
+    , maPinnedDocumentBitmapHiglighted(BMP_PIN_DOC_HIGHLIGHTED)
 {
 }
 
@@ -77,6 +86,11 @@ void ThumbnailViewItem::setHighlight (bool state)
     mbHover = state;
 }
 
+void ThumbnailViewItem::setPinned (bool state)
+{
+    mbPinned = state;
+}
+
 ::tools::Rectangle ThumbnailViewItem::updateHighlight(bool bVisible, const 
Point& rPoint)
 {
     bool bNeedsPaint = false;
@@ -94,6 +108,20 @@ void ThumbnailViewItem::setHighlight (bool state)
         setHighlight(false);
     }
 
+    const ::tools::Rectangle aPinPosRectangle(maPinPos, 
maPinnedDocumentBitmap.GetSizePixel());
+    if (bVisible && aPinPosRectangle.Contains(rPoint))
+    {
+        if (!mbPinnedDocumentHighlighted)
+            bNeedsPaint = true;
+        mbPinnedDocumentHighlighted = true;
+    }
+    else
+    {
+        if (mbPinnedDocumentHighlighted)
+            bNeedsPaint = true;
+        mbPinnedDocumentHighlighted = false;
+    }
+
     if (bNeedsPaint)
         return getDrawArea();
 
@@ -134,6 +162,9 @@ void ThumbnailViewItem::calculateItemsPosition (const 
tools::Long nThumbnailHeig
     const Point aPos = maDrawArea.TopCenter();
     maPrev1Pos = aPos + Point(-aImageSize.Width() / 2, nPadding + 
(nThumbnailHeight - aImageSize.Height()) / 2);
 
+    // Calculate pin position
+    maPinPos = maDrawArea.TopLeft() + Point(nPadding, nPadding);
+
     // Calculate text position
     maTextPos = aPos + Point(-aTextDev.getTextWidth(maTitle, 0, 
nMaxTextLength) / 2, nThumbnailHeight + nPadding * 2);
 }
@@ -142,7 +173,7 @@ void ThumbnailViewItem::Paint 
(drawinglayer::processor2d::BaseProcessor2D *pProc
                                const ThumbnailItemAttributes *pAttrs)
 {
     BColor aFillColor = pAttrs->aFillColor;
-    drawinglayer::primitive2d::Primitive2DContainer aSeq(4);
+    drawinglayer::primitive2d::Primitive2DContainer aSeq(5);
     double fTransparence = 0.0;
 
     // Draw background
@@ -176,6 +207,20 @@ void ThumbnailViewItem::Paint 
(drawinglayer::processor2d::BaseProcessor2D *pProc
                                                             false)
                                         ));
 
+    // tdf#38742 - draw pinned icon
+    if (mbPinned)
+    {
+        const BitmapEx& aBitmapEx
+            = mbHover ? maPinnedDocumentBitmapHiglighted : 
maPinnedDocumentBitmap;
+        aSeq[nPrimitive++] = drawinglayer::primitive2d::Primitive2DReference(
+            new DiscreteBitmapPrimitive2D(aBitmapEx, B2DPoint(maPinPos.X(), 
maPinPos.Y())));
+    }
+    else if (mbHover)
+        aSeq[nPrimitive++]
+            = drawinglayer::primitive2d::Primitive2DReference(new 
DiscreteBitmapPrimitive2D(
+                maPinnedDocumentBitmap, B2DPoint(maPinPos.X(), maPinPos.Y())));
+
+
     if (mbBorder)
     {
         // draw thumbnail borders
diff --git a/unotools/source/config/historyoptions.cxx 
b/unotools/source/config/historyoptions.cxx
index 27cd3a2d97b8..7578bd190d47 100644
--- a/unotools/source/config/historyoptions.cxx
+++ b/unotools/source/config/historyoptions.cxx
@@ -43,6 +43,7 @@ namespace {
     constexpr OUStringLiteral s_sPassword = u"Password";
     constexpr OUStringLiteral s_sThumbnail = u"Thumbnail";
     constexpr OUStringLiteral s_sReadOnly = u"ReadOnly";
+    constexpr OUStringLiteral s_sPinned = u"Pinned";
 }
 
 static uno::Reference<container::XNameAccess> GetConfig();
@@ -54,6 +55,14 @@ static void TruncateList(
         const uno::Reference<container::XNameAccess>& xCfg,
         const uno::Reference<container::XNameAccess>& xList,
         sal_uInt32 nSize);
+
+static void PrependItem(const uno::Reference<container::XNameAccess>& xCfg,
+                        uno::Reference<container::XNameContainer>& xList, 
std::u16string_view sURL);
+static void MoveItemToUnpinned(const uno::Reference<container::XNameAccess>& 
xCfg,
+                               uno::Reference<container::XNameContainer>& 
xOrderList,
+                               uno::Reference<container::XNameContainer>& 
xItemList,
+                               std::u16string_view sURL);
+
 static sal_uInt32 GetCapacity(const uno::Reference<container::XNameAccess>& 
xCommonXCU, EHistoryType eHistory);
 
 namespace SvtHistoryOptions
@@ -125,6 +134,8 @@ std::vector< HistoryItem > GetList( EHistoryType eHistory )
                 xSet->getPropertyValue(s_sPassword) >>= aItem.sPassword;
                 xSet->getPropertyValue(s_sThumbnail) >>= aItem.sThumbnail;
                 xSet->getPropertyValue(s_sReadOnly) >>= aItem.isReadOnly;
+                xSet->getPropertyValue(s_sPinned) >>= aItem.isPinned;
+
                 aRet.push_back(aItem);
             }
             catch(const uno::Exception&)
@@ -147,10 +158,9 @@ std::vector< HistoryItem > GetList( EHistoryType eHistory )
     return aRet;
 }
 
-void AppendItem(EHistoryType eHistory,
-        const OUString& sURL, const OUString& sFilter, const OUString& sTitle,
-        const std::optional<OUString>& sThumbnail,
-        ::std::optional<bool> const oIsReadOnly)
+void AppendItem(EHistoryType eHistory, const OUString& sURL, const OUString& 
sFilter,
+                const OUString& sTitle, const std::optional<OUString>& 
sThumbnail,
+                ::std::optional<bool> const oIsReadOnly, ::std::optional<bool> 
const oIsPinned)
 {
     try
     {
@@ -184,33 +194,17 @@ void AppendItem(EHistoryType eHistory,
             {
                 xSet->setPropertyValue(s_sReadOnly, uno::Any(*oIsReadOnly));
             }
-
-            for (sal_Int32 i=0; i<nLength; ++i)
+            if (oIsPinned)
             {
-                OUString aItem;
-                xOrderList->getByName(OUString::number(i)) >>= xSet;
-                xSet->getPropertyValue(s_sHistoryItemRef) >>= aItem;
-
-                if (aItem == sURL)
-                {
-                    for (sal_Int32 j = i - 1; j >= 0; --j)
-                    {
-                        uno::Reference<beans::XPropertySet> xPrevSet;
-                        uno::Reference<beans::XPropertySet> xNextSet;
-                        xOrderList->getByName(OUString::number(j+1)) >>= 
xPrevSet;
-                        xOrderList->getByName(OUString::number(j))   >>= 
xNextSet;
-
-                        OUString sTemp;
-                        xNextSet->getPropertyValue(s_sHistoryItemRef) >>= 
sTemp;
-                        xPrevSet->setPropertyValue(s_sHistoryItemRef, 
uno::Any(sTemp));
-                    }
-                    xOrderList->getByName(OUString::number(0)) >>= xSet;
-                    xSet->setPropertyValue(s_sHistoryItemRef, uno::Any(aItem));
-                    break;
-                }
+                xSet->setPropertyValue(s_sPinned, uno::Any(*oIsPinned));
+                if (*oIsPinned)
+                    PrependItem(xCfg, xOrderList, sURL);
+                else
+                    MoveItemToUnpinned(xCfg, xOrderList, xItemList, sURL);
             }
+            else
+                MoveItemToUnpinned(xCfg, xOrderList, xItemList, sURL);
 
-            ::comphelper::ConfigurationHelper::flush(xCfg);
         }
         else // The item to be appended does not exist yet
         {
@@ -276,6 +270,10 @@ void AppendItem(EHistoryType eHistory,
             {
                 xSet->setPropertyValue(s_sReadOnly, uno::Any(*oIsReadOnly));
             }
+            if (oIsPinned)
+            {
+                xSet->setPropertyValue(s_sPinned, uno::Any(*oIsPinned));
+            }
 
             ::comphelper::ConfigurationHelper::flush(xCfg);
         }
@@ -348,6 +346,43 @@ void DeleteItem(EHistoryType eHistory, const OUString& 
sURL)
     }
 }
 
+void TogglePinItem(EHistoryType eHistory, const OUString& sURL)
+{
+    try
+    {
+        uno::Reference<container::XNameAccess> xCfg = GetConfig();
+        uno::Reference<container::XNameAccess> xListAccess(GetListAccess(xCfg, 
eHistory));
+
+        uno::Reference<container::XNameContainer> xItemList;
+        xListAccess->getByName(s_sItemList)  >>= xItemList;
+
+        // Check if item exists
+        if (xItemList->hasByName(sURL))
+        {
+            // Toggle pinned option
+            uno::Reference<beans::XPropertySet> xSet;
+            xItemList->getByName(sURL) >>= xSet;
+            bool bIsItemPinned = false;
+            if (xSet->getPropertySetInfo()->hasPropertyByName(s_sPinned))
+                xSet->getPropertyValue(s_sPinned) >>= bIsItemPinned;
+            xSet->setPropertyValue(s_sPinned, uno::Any(!bIsItemPinned));
+
+            uno::Reference<container::XNameContainer> xOrderList;
+            xListAccess->getByName(s_sOrderList) >>= xOrderList;
+
+            // Shift item to the beginning of the document list if is not 
pinned now
+            if (bIsItemPinned)
+                MoveItemToUnpinned(xCfg, xOrderList, xItemList, sURL);
+            else
+                PrependItem(xCfg, xOrderList, sURL);
+        }
+    }
+    catch (const uno::Exception&)
+    {
+        DBG_UNHANDLED_EXCEPTION("unotools.config");
+    }
+}
+
 } // namespace
 
 
@@ -417,7 +452,81 @@ static void TruncateList(
     ::comphelper::ConfigurationHelper::flush(xCfg);
 }
 
+static void PrependItem(const uno::Reference<container::XNameAccess>& xCfg,
+                        uno::Reference<container::XNameContainer>& xList, 
std::u16string_view sURL)
+{
+    uno::Reference<beans::XPropertySet> xSet;
+    const sal_Int32 nLength = xList->getElementNames().getLength();
+    for (sal_Int32 i = 0; i < nLength; i++)
+    {
+        OUString aItem;
+        xList->getByName(OUString::number(i)) >>= xSet;
+        xSet->getPropertyValue(s_sHistoryItemRef) >>= aItem;
+
+        if (aItem == sURL)
+        {
+            for (sal_Int32 j = i - 1; j >= 0; --j)
+            {
+                uno::Reference<beans::XPropertySet> xPrevSet;
+                uno::Reference<beans::XPropertySet> xNextSet;
+                xList->getByName(OUString::number(j + 1)) >>= xPrevSet;
+                xList->getByName(OUString::number(j)) >>= xNextSet;
 
+                OUString sTemp;
+                xNextSet->getPropertyValue(s_sHistoryItemRef) >>= sTemp;
+                xPrevSet->setPropertyValue(s_sHistoryItemRef, uno::Any(sTemp));
+            }
+            xList->getByName(OUString::number(0)) >>= xSet;
+            xSet->setPropertyValue(s_sHistoryItemRef, uno::Any(aItem));
+            ::comphelper::ConfigurationHelper::flush(xCfg);
+            return;
+        }
+    }
+}
+
+static void MoveItemToUnpinned(const uno::Reference<container::XNameAccess>& 
xCfg,
+                               uno::Reference<container::XNameContainer>& 
xOrderList,
+                               uno::Reference<container::XNameContainer>& 
xItemList,
+                               std::u16string_view sURL)
+{
+    uno::Reference<beans::XPropertySet> xSet;
+    const sal_Int32 nLength = xOrderList->getElementNames().getLength();
+    // Search for item in the ordered list list
+    for (sal_Int32 i = 0; i < nLength; i++)
+    {
+        OUString aItem;
+        xOrderList->getByName(OUString::number(i)) >>= xSet;
+        xSet->getPropertyValue(s_sHistoryItemRef) >>= aItem;
+
+        if (aItem == sURL)
+        {
+            // Move item to the unpinned document section
+            for (sal_Int32 j = i + 1; j < nLength - 1; j++)
+            {
+                uno::Reference<beans::XPropertySet> xNextSet;
+                xOrderList->getByName(OUString::number(j)) >>= xNextSet;
+
+                OUString aNextItem;
+                xNextSet->getPropertyValue(s_sHistoryItemRef) >>= aNextItem;
+
+                uno::Reference<beans::XPropertySet> xNextItemSet;
+                xItemList->getByName(aNextItem) >>= xNextItemSet;
+                bool bIsItemPinned = false;
+                if 
(xNextItemSet->getPropertySetInfo()->hasPropertyByName(s_sPinned))
+                    xNextItemSet->getPropertyValue(s_sPinned) >>= 
bIsItemPinned;
+                if (bIsItemPinned)
+                {
+                    xSet->setPropertyValue(s_sHistoryItemRef, 
uno::Any(aNextItem));
+                    xNextSet->setPropertyValue(s_sHistoryItemRef, 
uno::Any(aItem));
+                }
+                else
+                    break;
+            }
+            ::comphelper::ConfigurationHelper::flush(xCfg);
+            return;
+        }
+    }
+}
 
 static sal_uInt32 GetCapacity(const uno::Reference<container::XNameAccess>& 
xCommonXCU, EHistoryType eHistory)
 {

Reply via email to