fnFixSize = function () {
                var $This = this.$();
                var iValue = 0;

                var sMaxHeight = this.getMaxHeight();
                var iMaxHeight = sMaxHeight ? parseInt(sMaxHeight) : 0;

                /*
                 * Fix the width (if necessary)
                 */
                var sMaxWidth = this.getMaxWidth();
                if (sMaxWidth) {
                    var iMaxWidth = parseInt(sMaxWidth);

                    var sBorderLeft = $This.css("border-left-width");
                    var iBorderLeft = parseInt(sBorderLeft);
                    var sBorderRight = $This.css("border-right-width");
                    var iBorderRight = parseInt(sBorderRight);

                    var sPaddingLeft = $This.css("padding-left");
                    var iPaddingLeft = parseInt(sPaddingLeft);
                    var sPaddingRight = $This.css("padding-right");
                    var iPaddingRight = parseInt(sPaddingRight);

                    iMaxWidth -= iBorderLeft + iPaddingLeft + iPaddingRight + iBorderRight;
                    $This.css("max-width", iMaxWidth + "px");
                } else {
                    $This.css("max-width", "");
                }

                /*
                 * Fix the height
                 */
                // get all paddings
                var sPaddingTop = $This.css("padding-top");
                var iPaddingTop = parseInt(sPaddingTop);
                var sPaddingBottom = $This.css("padding-bottom");
                var iPaddingBottom = parseInt(sPaddingBottom);

                // get all border widths
                var sBorderTop = $This.css("border-top-width");
                var iBorderTop = parseInt(sBorderTop);
                var sBorderBottom = $This.css("border-bottom-width");
                var iBorderBottom = parseInt(sBorderBottom);

                var iPaddings = iPaddingTop + iPaddingBottom + iBorderTop + iBorderBottom;

                // determine the corresponding scrollTop to calculate the proper bottom end of the ToolPopup
                var iScrollTop = jQuery(document).scrollTop();
                // jQuery Plugin "rect"
                var oThisRect = $This.rect();
                var iBottomEnd = oThisRect.top - iScrollTop + $This.outerHeight(true);

                // only use this mechanism when there is NO maxHeight set
                var iWinHeight = jQuery(window).height();
                var bTooHigh = (iBottomEnd > iWinHeight) && (iMaxHeight === 0);
                var iYOffset = 0;

                // check if an offset forces the ToolPopup out of the window
                // and below the opener
                if (bTooHigh) {
                    var $Opener = jQuery(document.getElementById(this.getOpener()));
                    // jQuery Plugin "rect"
                    var oOpenerRect = $Opener.rect();
                    var iOpenerBottom = oOpenerRect.top - iScrollTop + $Opener.outerHeight(true);

                    // if bottom of the ToolPopup is below the opener and there is a possible offset
                    var aOffset = this.oPopup._getPositionOffset();
                    if (iBottomEnd > iOpenerBottom && aOffset.length > 0) {
                        // check if the offset is responsible for pushing the ToolPopup below the opener
                        // and therefore out of the window
                        iYOffset = Math.abs(parseInt(aOffset[1]));

                        // this check inverts the variable to prevent any resize of the ToolPopup since it
                        // is pushed out of the window because of the offset
                        if ((iBottomEnd - iYOffset) < iWinHeight) {
                            bTooHigh = false;
                            var sMessage = "Offset of " + iYOffset + " pushes ToolPopup out of the window";
                            Log.warning(sMessage, "", "sap.ui.ux3.ToolPopup");
                        }
                    }

                    iMaxHeight = iMaxHeight ? iMaxHeight : iWinHeight - oThisRect.top;
                }

                $This.toggleClass("sapUiUx3TPLargeContent", bTooHigh);

                if (iMaxHeight || bTooHigh) {
                    $This.css("max-height", iMaxHeight + "px");

                    var $Title = this.$("title");
                    var $TitleSep = this.$("title-separator");

                    var $Buttons = this.$("buttons");
                    var $ButtonsSep = this.$("buttons-separator");

                    // Calculate the correct start value. Either simply take the set maxHeight
                    // or calculate the value between Popup.top and window end (incl. padding and offset)
                    iValue = iMaxHeight > 0 ? iMaxHeight : iWinHeight - oThisRect.top - iPaddingBottom - iYOffset;

                    // subtract all paddings and border-widths
                    iValue -= iPaddings;

                    // subtracting all corresponding values from top to down
                    iValue -= $Title.outerHeight(true);
                    iValue -= $TitleSep.outerHeight(true); // including margin

                    // height of content needn't to be subtracted

                    iValue -= $ButtonsSep.outerHeight(true); // including margin
                    iValue -= $Buttons.length > 0 ? $Buttons.outerHeight(true) : 0;

                    // if the height has to be corrected
                    iValue = parseInt(iValue);

                    var $Content = this.$("content");
                    $Content.css("max-height", iValue + "px");

                    $Content.toggleClass("sapUiUx3TPLargeContent", true);
                }

                fnSetArrow(this);
            }
This function fixes the height of the ToolPopup if the content is too large.
So the height will be set to the possible maximum and a scrollbar is provided.
Additionally the width of the ToolPopup is fixed as well since the scrollbar reduces
the possible space for the content.

@private